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
Ophélie Gagnard
slapos.core
Commits
6c9d9c1c
Commit
6c9d9c1c
authored
Mar 01, 2012
by
Łukasz Nowak
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/master' into performance-hack
Conflicts: master/bt5/vifib_base/bt/revision
parents
8e41d0b3
57df0ffb
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
315 additions
and
14 deletions
+315
-14
master/bt5/vifib_base/DocumentTemplateItem/SoftwareInstance.py
...r/bt5/vifib_base/DocumentTemplateItem/SoftwareInstance.py
+30
-13
master/bt5/vifib_base/PropertySheetTemplateItem/portal_property_sheets/SoftwareInstanceConstraint/connection_xml_valid_xml_constraint.xml
...nstanceConstraint/connection_xml_valid_xml_constraint.xml
+104
-0
master/bt5/vifib_base/PropertySheetTemplateItem/portal_property_sheets/SoftwareInstanceConstraint/sla_xml_valid_xml_constraint.xml
...ftwareInstanceConstraint/sla_xml_valid_xml_constraint.xml
+104
-0
master/bt5/vifib_base/PropertySheetTemplateItem/portal_property_sheets/SoftwareInstanceConstraint/text_content_valid_xml_constraint.xml
...eInstanceConstraint/text_content_valid_xml_constraint.xml
+76
-0
master/bt5/vifib_base/bt/revision
master/bt5/vifib_base/bt/revision
+1
-1
No files found.
master/bt5/vifib_base/DocumentTemplateItem/SoftwareInstance.py
View file @
6c9d9c1c
...
...
@@ -50,23 +50,40 @@ class SoftwareInstance(Item):
security
.
declareObjectProtected
(
Permissions
.
AccessContentsInformation
)
def
_getXmlAsDict
(
self
,
xml
):
result_dict
=
{}
if
xml
is
None
or
xml
==
''
:
return
result_dict
tree
=
etree
.
fromstring
(
xml
.
encode
(
'utf-8'
))
for
element
in
tree
.
findall
(
'parameter'
):
key
=
element
.
get
(
'id'
)
value
=
result_dict
.
get
(
key
,
None
)
if
value
is
not
None
:
value
=
value
+
' '
+
element
.
text
else
:
value
=
element
.
text
result_dict
[
key
]
=
value
return
result_dict
security
.
declareProtected
(
Permissions
.
AccessContentsInformation
,
'getSlaXmlAsDict'
)
def
getSlaXmlAsDict
(
self
):
"""Returns SLA XML as python dictionary"""
re
sult_dict
=
{}
xml
=
self
.
getSlaXml
()
if
xml
is
not
None
and
xml
!=
''
:
tree
=
etree
.
fromstring
(
xml
.
encode
(
'utf-8'
)
)
for
element
in
tree
.
findall
(
'parameter'
):
key
=
element
.
get
(
'id'
)
value
=
result_dict
.
get
(
key
,
None
)
if
value
is
not
None
:
value
=
value
+
' '
+
element
.
text
else
:
value
=
element
.
text
result_dict
[
key
]
=
value
return
result_dict
re
turn
self
.
_getXmlAsDict
(
self
.
getSlaXml
())
security
.
declareProtected
(
Permissions
.
AccessContentsInformation
,
'getInstanceXmlAsDict'
)
def
getInstanceXmlAsDict
(
self
):
"""Returns Instance XML as python dictionary"""
return
self
.
_getXmlAsDict
(
self
.
getTextContent
()
)
security
.
declareProtected
(
Permissions
.
AccessContentsInformation
,
'getConnectionXmlAsDict'
)
def
getConnectionXmlAsDict
(
self
):
"""Returns Connection XML as python dictionary"""
return
self
.
_getXmlAsDict
(
self
.
getConnectionXml
())
security
.
declareProtected
(
Permissions
.
AccessContentsInformation
,
'checkNotCyclic'
)
...
...
master/bt5/vifib_base/PropertySheetTemplateItem/portal_property_sheets/SoftwareInstanceConstraint/connection_xml_valid_xml_constraint.xml
0 → 100644
View file @
6c9d9c1c
<?xml version="1.0"?>
<ZopeData>
<record
id=
"1"
aka=
"AAAAAAAAAAE="
>
<pickle>
<global
name=
"TALES Constraint"
module=
"erp5.portal_type"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
_identity_criterion
</string>
</key>
<value>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAAI=
</string>
</persistent>
</value>
</item>
<item>
<key>
<string>
_range_criterion
</string>
</key>
<value>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAAM=
</string>
</persistent>
</value>
</item>
<item>
<key>
<string>
description
</string>
</key>
<value>
<none/>
</value>
</item>
<item>
<key>
<string>
expression
</string>
</key>
<value>
<string>
python: context.getConnectionXml()
</string>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
connection_xml_valid_xml_constraint
</string>
</value>
</item>
<item>
<key>
<string>
int_index
</string>
</key>
<value>
<none/>
</value>
</item>
<item>
<key>
<string>
membership_criterion_category
</string>
</key>
<value>
<tuple/>
</value>
</item>
<item>
<key>
<string>
message_expression_error
</string>
</key>
<value>
<string>
Connection XML is invalid: ${error}
</string>
</value>
</item>
<item>
<key>
<string>
portal_type
</string>
</key>
<value>
<string>
TALES Constraint
</string>
</value>
</item>
<item>
<key>
<string>
string_index
</string>
</key>
<value>
<none/>
</value>
</item>
<item>
<key>
<string>
test_method_id
</string>
</key>
<value>
<tuple/>
</value>
</item>
<item>
<key>
<string>
test_tales_expression
</string>
</key>
<value>
<string>
python: context.getConnectionXml() is not None
</string>
</value>
</item>
</dictionary>
</pickle>
</record>
<record
id=
"2"
aka=
"AAAAAAAAAAI="
>
<pickle>
<global
name=
"PersistentMapping"
module=
"Persistence.mapping"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
data
</string>
</key>
<value>
<dictionary/>
</value>
</item>
</dictionary>
</pickle>
</record>
<record
id=
"3"
aka=
"AAAAAAAAAAM="
>
<pickle>
<global
name=
"PersistentMapping"
module=
"Persistence.mapping"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
data
</string>
</key>
<value>
<dictionary/>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
master/bt5/vifib_base/PropertySheetTemplateItem/portal_property_sheets/SoftwareInstanceConstraint/sla_xml_valid_xml_constraint.xml
0 → 100644
View file @
6c9d9c1c
<?xml version="1.0"?>
<ZopeData>
<record
id=
"1"
aka=
"AAAAAAAAAAE="
>
<pickle>
<global
name=
"TALES Constraint"
module=
"erp5.portal_type"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
_identity_criterion
</string>
</key>
<value>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAAI=
</string>
</persistent>
</value>
</item>
<item>
<key>
<string>
_range_criterion
</string>
</key>
<value>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAAM=
</string>
</persistent>
</value>
</item>
<item>
<key>
<string>
description
</string>
</key>
<value>
<none/>
</value>
</item>
<item>
<key>
<string>
expression
</string>
</key>
<value>
<string>
python: context.getSlaXmlAsDict()
</string>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
sla_xml_valid_xml_constraint
</string>
</value>
</item>
<item>
<key>
<string>
int_index
</string>
</key>
<value>
<none/>
</value>
</item>
<item>
<key>
<string>
membership_criterion_category
</string>
</key>
<value>
<tuple/>
</value>
</item>
<item>
<key>
<string>
message_expression_error
</string>
</key>
<value>
<string>
Sla XML is invalid: ${error}
</string>
</value>
</item>
<item>
<key>
<string>
portal_type
</string>
</key>
<value>
<string>
TALES Constraint
</string>
</value>
</item>
<item>
<key>
<string>
string_index
</string>
</key>
<value>
<none/>
</value>
</item>
<item>
<key>
<string>
test_method_id
</string>
</key>
<value>
<tuple/>
</value>
</item>
<item>
<key>
<string>
test_tales_expression
</string>
</key>
<value>
<string>
python: context.getSlaXml() is not None
</string>
</value>
</item>
</dictionary>
</pickle>
</record>
<record
id=
"2"
aka=
"AAAAAAAAAAI="
>
<pickle>
<global
name=
"PersistentMapping"
module=
"Persistence.mapping"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
data
</string>
</key>
<value>
<dictionary/>
</value>
</item>
</dictionary>
</pickle>
</record>
<record
id=
"3"
aka=
"AAAAAAAAAAM="
>
<pickle>
<global
name=
"PersistentMapping"
module=
"Persistence.mapping"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
data
</string>
</key>
<value>
<dictionary/>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
master/bt5/vifib_base/PropertySheetTemplateItem/portal_property_sheets/SoftwareInstanceConstraint/text_content_valid_xml_constraint.xml
0 → 100644
View file @
6c9d9c1c
<?xml version="1.0"?>
<ZopeData>
<record
id=
"1"
aka=
"AAAAAAAAAAE="
>
<pickle>
<global
name=
"TALES Constraint"
module=
"erp5.portal_type"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
_identity_criterion
</string>
</key>
<value>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAAI=
</string>
</persistent>
</value>
</item>
<item>
<key>
<string>
_range_criterion
</string>
</key>
<value>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAAM=
</string>
</persistent>
</value>
</item>
<item>
<key>
<string>
description
</string>
</key>
<value>
<none/>
</value>
</item>
<item>
<key>
<string>
expression
</string>
</key>
<value>
<string>
python: context.getInstanceXmlAsDict()
</string>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
text_content_valid_xml_constraint
</string>
</value>
</item>
<item>
<key>
<string>
message_expression_error
</string>
</key>
<value>
<string>
Instance XML is invalid: ${error}
</string>
</value>
</item>
<item>
<key>
<string>
portal_type
</string>
</key>
<value>
<string>
TALES Constraint
</string>
</value>
</item>
</dictionary>
</pickle>
</record>
<record
id=
"2"
aka=
"AAAAAAAAAAI="
>
<pickle>
<global
name=
"PersistentMapping"
module=
"Persistence.mapping"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
data
</string>
</key>
<value>
<dictionary/>
</value>
</item>
</dictionary>
</pickle>
</record>
<record
id=
"3"
aka=
"AAAAAAAAAAM="
>
<pickle>
<global
name=
"PersistentMapping"
module=
"Persistence.mapping"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
data
</string>
</key>
<value>
<dictionary/>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
master/bt5/vifib_base/bt/revision
View file @
6c9d9c1c
401
\ No newline at end of file
403
\ No newline at end of file
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