Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
slapos.core
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Paul Graydon
slapos.core
Commits
39f40076
Commit
39f40076
authored
May 10, 2012
by
Łukasz Nowak
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Store data as SlapTool - etree XML.
parent
17fe41e0
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
3 deletions
+10
-3
master/product/Vifib/Tool/VifibRestApiV1Tool.py
master/product/Vifib/Tool/VifibRestApiV1Tool.py
+10
-3
No files found.
master/product/Vifib/Tool/VifibRestApiV1Tool.py
View file @
39f40076
...
@@ -35,13 +35,21 @@ from Products.ERP5Type.Globals import InitializeClass
...
@@ -35,13 +35,21 @@ from Products.ERP5Type.Globals import InitializeClass
from
Products.ERP5Type
import
Permissions
from
Products.ERP5Type
import
Permissions
from
ComputedAttribute
import
ComputedAttribute
from
ComputedAttribute
import
ComputedAttribute
from
zLOG
import
LOG
,
ERROR
from
zLOG
import
LOG
,
ERROR
import
xml_marshaller
from
lxml
import
etree
import
json
import
json
import
transaction
import
transaction
class
WrongRequest
(
Exception
):
class
WrongRequest
(
Exception
):
pass
pass
def
etreeXml
(
d
):
r
=
etree
.
Element
(
'instance'
)
for
k
,
v
in
d
.
iteritems
():
v
=
str
(
v
)
etree
.
SubElement
(
r
,
"parameter"
,
attrib
=
{
'id'
:
k
}).
text
=
v
return
etree
.
tostring
(
r
,
pretty_print
=
True
,
xml_declaration
=
True
,
encoding
=
'utf-8'
)
def
requireHeader
(
header_dict
):
def
requireHeader
(
header_dict
):
def
outer
(
fn
):
def
outer
(
fn
):
def
wrapperRequireHeader
(
self
,
*
args
,
**
kwargs
):
def
wrapperRequireHeader
(
self
,
*
args
,
**
kwargs
):
...
@@ -210,8 +218,7 @@ class InstancePublisher(GenericPublisher):
...
@@ -210,8 +218,7 @@ class InstancePublisher(GenericPublisher):
(
'status'
,
'state'
)
(
'status'
,
'state'
)
):
):
if
k_j
in
(
'sla'
,
'parameter'
):
if
k_j
in
(
'sla'
,
'parameter'
):
request_dict
[
k_i
]
=
xml_marshaller
.
xml_marshaller
.
dumps
(
request_dict
[
k_i
]
=
etreeXml
(
self
.
jbody
[
k_j
])
self
.
jbody
[
k_j
])
else
:
else
:
request_dict
[
k_i
]
=
self
.
jbody
[
k_j
]
request_dict
[
k_i
]
=
self
.
jbody
[
k_j
]
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment