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
Roque
slapos.core
Commits
b1b19629
Commit
b1b19629
authored
Mar 10, 2015
by
Alain Takoudjou
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update computer from dict: Save network information of tap interface (without bridge)
parent
684c6366
Changes
4
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
346 additions
and
10 deletions
+346
-10
master/bt5/slapos_slap_tool/SkinTemplateItem/portal_skins/slapos_slap_tool/Computer_updateFromDict.xml
...portal_skins/slapos_slap_tool/Computer_updateFromDict.xml
+14
-0
master/bt5/slapos_slap_tool/TestTemplateItem/portal_components/test.erp5.testSlapOSSlapToolComputerUpdateFromDict.py
...nts/test.erp5.testSlapOSSlapToolComputerUpdateFromDict.py
+286
-0
master/bt5/slapos_slap_tool/TestTemplateItem/portal_components/test.erp5.testSlapOSSlapToolComputerUpdateFromDict.xml
...ts/test.erp5.testSlapOSSlapToolComputerUpdateFromDict.xml
+35
-7
master/product/Vifib/Tool/SlapTool.py
master/product/Vifib/Tool/SlapTool.py
+11
-3
No files found.
master/bt5/slapos_slap_tool/SkinTemplateItem/portal_skins/slapos_slap_tool/Computer_updateFromDict.xml
View file @
b1b19629
...
...
@@ -65,6 +65,10 @@
if current_dict in to_add_ip_dict_list:\n
to_add_ip_dict_list.remove(current_dict)\n
else:\n
# XXX - Only delete if Network interface are supposed to be the same\n
if additional_dict.has_key(\'network_interface\'):\n
if address.getNetworkInterface(\'\') and additional_dict[\'network_interface\'] != address.getNetworkInterface():\n
continue\n
to_delete_ip_id_list.append(address.getId())\n
\n
for address in to_add_ip_dict_list:\n
...
...
@@ -114,6 +118,16 @@ for send_partition in computer_dict[\'partition_list\']:\n
partition.edit(reference=send_partition[\'reference\'])\n
network_interface = send_partition[\'tap\'][\'name\']\n
compareAndUpdateAddressList(partition, send_partition[\'address_list\'], {\'network_interface\': network_interface})\n
tap_addr_list = []\n
additional_dict = {\'network_interface\': \'route_\' + network_interface}\n
if send_partition[\'tap\'].has_key(\'ipv4_addr\') and send_partition[\'tap\'][\'ipv4_addr\']:\n
tap_addr_list.append({\n
\'addr\': send_partition[\'tap\'][\'ipv4_addr\'],\n
\'netmask\': send_partition[\'tap\'][\'ipv4_netmask\']\n
})\n
additional_dict[\'gateway_ip_address\'] = send_partition[\'tap\'][\'ipv4_gateway\']\n
additional_dict[\'network_address\'] = send_partition[\'tap\'][\'ipv4_network\']\n
compareAndUpdateAddressList(partition, tap_addr_list, additional_dict)\n
\n
# Desactivate all other partitions\n
for key, value in existing_partition_dict.items():\n
...
...
master/bt5/slapos_slap_tool/TestTemplateItem/portal_components/test.erp5.testSlapOSSlapToolComputerUpdateFromDict.py
View file @
b1b19629
This diff is collapsed.
Click to expand it.
master/bt5/slapos_slap_tool/TestTemplateItem/portal_components/test.erp5.testSlapOSSlapToolComputerUpdateFromDict.xml
View file @
b1b19629
...
...
@@ -6,10 +6,22 @@
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
_recorded_property_dict
</string>
</key>
<value>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAAI=
</string>
</persistent>
</value>
</item>
<item>
<key>
<string>
default_reference
</string>
</key>
<value>
<string>
testSlapOSSlapToolComputerUpdateFromDict
</string>
</value>
</item>
<item>
<key>
<string>
description
</string>
</key>
<value>
<none/>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
test.erp5.testSlapOSSlapToolComputerUpdateFromDict
</string>
</value>
...
...
@@ -34,10 +46,11 @@
<key>
<string>
text_content_warning_message
</string>
</key>
<value>
<tuple>
<string>
W:274, 4: Unused variable \'default_address\' (unused-variable)
</string>
<string>
W:270, 4: Unused variable \'other_address\' (unused-variable)
</string>
<string>
W:315, 4: Unused variable \'default_address\' (unused-variable)
</string>
<string>
W:311, 4: Unused variable \'other_address\' (unused-variable)
</string>
<string>
W:423, 4: Unused variable \'other_address2\' (unused-variable)
</string>
<string>
W:560, 4: Unused variable \'default_address\' (unused-variable)
</string>
<string>
W:556, 4: Unused variable \'other_address\' (unused-variable)
</string>
<string>
W:601, 4: Unused variable \'default_address\' (unused-variable)
</string>
<string>
W:597, 4: Unused variable \'other_address\' (unused-variable)
</string>
</tuple>
</value>
</item>
...
...
@@ -48,13 +61,28 @@
<item>
<key>
<string>
workflow_history
</string>
</key>
<value>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAA
I
=
</string>
</persistent>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAA
M
=
</string>
</persistent>
</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>
...
...
@@ -67,7 +95,7 @@
<item>
<key>
<string>
component_validation_workflow
</string>
</key>
<value>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAA
M
=
</string>
</persistent>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAA
Q
=
</string>
</persistent>
</value>
</item>
</dictionary>
...
...
@@ -76,7 +104,7 @@
</dictionary>
</pickle>
</record>
<record
id=
"
3"
aka=
"AAAAAAAAAAM
="
>
<record
id=
"
4"
aka=
"AAAAAAAAAAQ
="
>
<pickle>
<global
name=
"WorkflowHistoryList"
module=
"Products.ERP5Type.patches.WorkflowTool"
/>
</pickle>
...
...
master/product/Vifib/Tool/SlapTool.py
View file @
b1b19629
...
...
@@ -1429,9 +1429,17 @@ class SlapTool(BaseTool):
ip_list
=
[]
for
internet_protocol_address
in
computer_partition
.
contentValues
(
portal_type
=
'Internet Protocol Address'
):
ip_list
.
append
((
# XXX - There is new values, and we must keep compatibility
address_tuple
=
(
internet_protocol_address
.
getNetworkInterface
(
''
).
decode
(
"UTF-8"
),
internet_protocol_address
.
getIpAddress
().
decode
(
"UTF-8"
)))
internet_protocol_address
.
getIpAddress
().
decode
(
"UTF-8"
))
if
internet_protocol_address
.
getGatewayIpAddress
(
''
)
and
\
internet_protocol_address
.
getNetmask
(
''
):
address_tuple
=
address_tuple
+
(
internet_protocol_address
.
getGatewayIpAddress
().
decode
(
"UTF-8"
),
internet_protocol_address
.
getNetmask
().
decode
(
"UTF-8"
),
internet_protocol_address
.
getNetworkAddress
(
''
).
decode
(
"UTF-8"
))
ip_list
.
append
(
address_tuple
)
slave_instance_list
=
[]
if
(
software_instance
.
getPortalType
()
==
"Software Instance"
):
...
...
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