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
Labels
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Jobs
Commits
Open sidebar
Rafael Monnerat
slapos.core
Commits
22c7a6fe
Commit
22c7a6fe
authored
Apr 27, 2016
by
Rafael Monnerat
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Do not post same connection parameters of slaves.
parent
b992c34e
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
50 additions
and
23 deletions
+50
-23
master/bt5/slapos_slap_tool/TestTemplateItem/portal_components/test.erp5.testSlapOSSlapTool.py
...ateItem/portal_components/test.erp5.testSlapOSSlapTool.py
+10
-6
master/bt5/slapos_slap_tool/TestTemplateItem/portal_components/test.erp5.testSlapOSSlapTool.xml
...teItem/portal_components/test.erp5.testSlapOSSlapTool.xml
+13
-13
master/product/Vifib/Tool/SlapTool.py
master/product/Vifib/Tool/SlapTool.py
+6
-2
slapos/slap/slap.py
slapos/slap/slap.py
+21
-2
No files found.
master/bt5/slapos_slap_tool/TestTemplateItem/portal_components/test.erp5.testSlapOSSlapTool.py
View file @
22c7a6fe
...
@@ -1223,6 +1223,8 @@ class TestSlapOSSlapToolInstanceAccess(TestSlapOSSlapToolMixin):
...
@@ -1223,6 +1223,8 @@ class TestSlapOSSlapToolInstanceAccess(TestSlapOSSlapToolMixin):
<string>slave_instance_list</string>
<string>slave_instance_list</string>
<list id='i9'>
<list id='i9'>
<dictionary id='i10'>
<dictionary id='i10'>
<string>connection-parameter-key-list</string>
<list id='i11'/>
<unicode>paramé</unicode>
<unicode>paramé</unicode>
<unicode>%(slave_1_param)s</unicode>
<unicode>%(slave_1_param)s</unicode>
<string>slap_software_type</string>
<string>slap_software_type</string>
...
@@ -1245,16 +1247,16 @@ class TestSlapOSSlapToolInstanceAccess(TestSlapOSSlapToolMixin):
...
@@ -1245,16 +1247,16 @@ class TestSlapOSSlapToolInstanceAccess(TestSlapOSSlapToolMixin):
<string>_requested_state</string>
<string>_requested_state</string>
<string>started</string>
<string>started</string>
<string>_software_release_document</string>
<string>_software_release_document</string>
<object id='i1
1
' module='slapos.slap.slap' class='SoftwareRelease'>
<object id='i1
2
' module='slapos.slap.slap' class='SoftwareRelease'>
<tuple>
<tuple>
<unicode>%(software_release_url)s</unicode>
<unicode>%(software_release_url)s</unicode>
<unicode>%(computer_id)s</unicode>
<unicode>%(computer_id)s</unicode>
</tuple>
</tuple>
<dictionary id='i1
2
'>
<dictionary id='i1
3
'>
<string>_computer_guid</string>
<string>_computer_guid</string>
<unicode>%(computer_id)s</unicode>
<unicode>%(computer_id)s</unicode>
<string>_software_instance_list</string>
<string>_software_instance_list</string>
<list id='i1
3
'/>
<list id='i1
4
'/>
<string>_software_release</string>
<string>_software_release</string>
<unicode>%(software_release_url)s</unicode>
<unicode>%(software_release_url)s</unicode>
</dictionary>
</dictionary>
...
@@ -2316,6 +2318,8 @@ class TestSlapOSSlapToolPersonAccess(TestSlapOSSlapToolMixin):
...
@@ -2316,6 +2318,8 @@ class TestSlapOSSlapToolPersonAccess(TestSlapOSSlapToolMixin):
<string>slave_instance_list</string>
<string>slave_instance_list</string>
<list id='i9'>
<list id='i9'>
<dictionary id='i10'>
<dictionary id='i10'>
<string>connection-parameter-key-list</string>
<list id='i11'/>
<unicode>paramé</unicode>
<unicode>paramé</unicode>
<unicode>%(slave_1_param)s</unicode>
<unicode>%(slave_1_param)s</unicode>
<string>slap_software_type</string>
<string>slap_software_type</string>
...
@@ -2338,16 +2342,16 @@ class TestSlapOSSlapToolPersonAccess(TestSlapOSSlapToolMixin):
...
@@ -2338,16 +2342,16 @@ class TestSlapOSSlapToolPersonAccess(TestSlapOSSlapToolMixin):
<string>_requested_state</string>
<string>_requested_state</string>
<string>started</string>
<string>started</string>
<string>_software_release_document</string>
<string>_software_release_document</string>
<object id='i1
1
' module='slapos.slap.slap' class='SoftwareRelease'>
<object id='i1
2
' module='slapos.slap.slap' class='SoftwareRelease'>
<tuple>
<tuple>
<unicode>%(software_release_url)s</unicode>
<unicode>%(software_release_url)s</unicode>
<unicode>%(computer_id)s</unicode>
<unicode>%(computer_id)s</unicode>
</tuple>
</tuple>
<dictionary id='i1
2
'>
<dictionary id='i1
3
'>
<string>_computer_guid</string>
<string>_computer_guid</string>
<unicode>%(computer_id)s</unicode>
<unicode>%(computer_id)s</unicode>
<string>_software_instance_list</string>
<string>_software_instance_list</string>
<list id='i1
3
'/>
<list id='i1
4
'/>
<string>_software_release</string>
<string>_software_release</string>
<unicode>%(software_release_url)s</unicode>
<unicode>%(software_release_url)s</unicode>
</dictionary>
</dictionary>
...
...
master/bt5/slapos_slap_tool/TestTemplateItem/portal_components/test.erp5.testSlapOSSlapTool.xml
View file @
22c7a6fe
...
@@ -51,19 +51,19 @@
...
@@ -51,19 +51,19 @@
<string>
W:517, 13: Use of eval (eval-used)
</string>
<string>
W:517, 13: Use of eval (eval-used)
</string>
<string>
W:568, 13: Use of eval (eval-used)
</string>
<string>
W:568, 13: Use of eval (eval-used)
</string>
<string>
W:793, 13: Use of eval (eval-used)
</string>
<string>
W:793, 13: Use of eval (eval-used)
</string>
<string>
W:1
399
, 13: Use of eval (eval-used)
</string>
<string>
W:1
401
, 13: Use of eval (eval-used)
</string>
<string>
W:151
2
, 13: Use of eval (eval-used)
</string>
<string>
W:151
4
, 13: Use of eval (eval-used)
</string>
<string>
W:156
6
, 13: Use of eval (eval-used)
</string>
<string>
W:156
8
, 13: Use of eval (eval-used)
</string>
<string>
W:160
6
, 13: Use of eval (eval-used)
</string>
<string>
W:160
8
, 13: Use of eval (eval-used)
</string>
<string>
W:201
3
, 2: Arguments number differs from overridden \'afterSetUp\' method (arguments-differ)
</string>
<string>
W:201
5
, 2: Arguments number differs from overridden \'afterSetUp\' method (arguments-differ)
</string>
<string>
W:21
09
, 13: Use of eval (eval-used)
</string>
<string>
W:21
11
, 13: Use of eval (eval-used)
</string>
<string>
W:249
2
, 13: Use of eval (eval-used)
</string>
<string>
W:249
6
, 13: Use of eval (eval-used)
</string>
<string>
W:25
46
, 13: Use of eval (eval-used)
</string>
<string>
W:25
50
, 13: Use of eval (eval-used)
</string>
<string>
W:257
3
, 13: Use of eval (eval-used)
</string>
<string>
W:257
7
, 13: Use of eval (eval-used)
</string>
<string>
W:27
28
, 13: Use of eval (eval-used)
</string>
<string>
W:27
32
, 13: Use of eval (eval-used)
</string>
<string>
W:27
56
, 13: Use of eval (eval-used)
</string>
<string>
W:27
60
, 13: Use of eval (eval-used)
</string>
<string>
W:280
5
, 13: Use of eval (eval-used)
</string>
<string>
W:280
9
, 13: Use of eval (eval-used)
</string>
<string>
W:285
2
, 13: Use of eval (eval-used)
</string>
<string>
W:285
6
, 13: Use of eval (eval-used)
</string>
</tuple>
</tuple>
</value>
</value>
</item>
</item>
...
...
master/product/Vifib/Tool/SlapTool.py
View file @
22c7a6fe
...
@@ -826,12 +826,16 @@ class SlapTool(BaseTool):
...
@@ -826,12 +826,16 @@ class SlapTool(BaseTool):
slap_partition
.
_instance_guid
=
parameter_dict
.
pop
(
'instance_guid'
)
slap_partition
.
_instance_guid
=
parameter_dict
.
pop
(
'instance_guid'
)
for
slave_instance_dict
in
parameter_dict
.
get
(
"slave_instance_list"
,
[]):
for
slave_instance_dict
in
parameter_dict
.
get
(
"slave_instance_list"
,
[]):
if
slave_instance_dict
.
has_key
(
"connection_xml"
):
if
slave_instance_dict
.
has_key
(
"connection_xml"
):
slave_instance_dict
.
update
(
self
.
_instanceXmlToDict
(
connection_dict
=
self
.
_instanceXmlToDict
(
slave_instance_dict
.
pop
(
"connection_xml"
)))
slave_instance_dict
.
pop
(
"connection_xml"
))
slave_instance_dict
.
update
(
connection_dict
)
slave_instance_dict
[
'connection-parameter-key-list'
]
=
\
connection_dict
.
keys
()
if
slave_instance_dict
.
has_key
(
"xml"
):
if
slave_instance_dict
.
has_key
(
"xml"
):
slave_instance_dict
.
update
(
self
.
_instanceXmlToDict
(
slave_instance_dict
.
update
(
self
.
_instanceXmlToDict
(
slave_instance_dict
.
pop
(
"xml"
)))
slave_instance_dict
.
pop
(
"xml"
)))
slap_partition
.
_parameter_dict
.
update
(
parameter_dict
)
slap_partition
.
_parameter_dict
.
update
(
parameter_dict
)
result
=
xml_marshaller
.
xml_marshaller
.
dumps
(
slap_partition
)
result
=
xml_marshaller
.
xml_marshaller
.
dumps
(
slap_partition
)
# Keep in cache server for 7 days
# Keep in cache server for 7 days
...
...
slapos/slap/slap.py
View file @
22c7a6fe
...
@@ -564,8 +564,27 @@ class ComputerPartition(SlapRequester):
...
@@ -564,8 +564,27 @@ class ComputerPartition(SlapRequester):
return
self
.
_software_release_document
return
self
.
_software_release_document
def
setConnectionDict
(
self
,
connection_dict
,
slave_reference
=
None
):
def
setConnectionDict
(
self
,
connection_dict
,
slave_reference
=
None
):
if
self
.
getConnectionParameterDict
()
!=
connection_dict
:
if
self
.
getConnectionParameterDict
()
==
connection_dict
:
self
.
_connection_helper
.
POST
(
'setComputerPartitionConnectionXml'
,
data
=
{
return
if
slave_reference
is
not
None
:
# check the connection parameters from the slave
# Should we check existence?
slave_parameter_list
=
self
.
getInstanceParameter
(
"slave_instance_list"
)
slave_connection_dict
=
{}
for
slave_parameter_dict
in
slave_parameter_list
:
if
slave_parameter_dict
[
"reference"
]
==
slave_reference
:
for
key
in
slave_parameter_dict
.
get
(
"connection-parameter-key-list"
,
[]):
slave_connection_dict
[
key
]
=
slave_parameter_dict
[
key
]
break
# Skip as nothing changed for the slave
if
slave_connection_dict
==
connection_dict
:
return
self
.
_connection_helper
.
POST
(
'setComputerPartitionConnectionXml'
,
data
=
{
'computer_id'
:
self
.
_computer_id
,
'computer_id'
:
self
.
_computer_id
,
'computer_partition_id'
:
self
.
_partition_id
,
'computer_partition_id'
:
self
.
_partition_id
,
'connection_xml'
:
xml_marshaller
.
dumps
(
connection_dict
),
'connection_xml'
:
xml_marshaller
.
dumps
(
connection_dict
),
...
...
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