Commit a27807f1 authored by Romain Courteaud's avatar Romain Courteaud

slapos_upgrader: break network link if not consistent

parent 718ed2b4
......@@ -77,4 +77,4 @@ if run_count < 10:
# Because some object are migrated only after some others are migrated
context.activate(after_tag=tag).Base_triggerFullSiteMigrationToVirtualMasterStep2(run_count=run_count+1)
else:
context.activate(after_tag=tag).getId()
context.activate(after_tag=tag).Base_triggerFullSiteMigrationToVirtualMasterStep3(run_count=run_count)
portal = context.getPortalObject()
tag = script.id
migrated_select_dict={'follow_up__uid': '%'}
############################################
# Delete all object to drop
############################################
packet_kw = {
'activate_kw': {'tag': tag},# 'serialization_tag': tag},
'packet_size': 1, # Separate calls to many transactions (calculation can take time)
'activity_count': 1000,
}
portal.portal_catalog.searchAndActivate(
method_id='Base_deleteProcessedDocumentDuringPurge',
portal_type=["Internal Packing List"],
**packet_kw
)
############################################
# Gather compute node informations
############################################
portal.portal_catalog.searchAndActivate(
method_id='ComputeNode_fixupSiteMigrationToVirtualMaster',
activate_kw={'tag': tag, 'priority': 1},
portal_type="Compute Node",
**migrated_select_dict
)
if (run_count == 10):
context.activate(after_tag=tag).Base_triggerFullSiteMigrationToVirtualMasterStep2(run_count=run_count+1)
else:
context.activate(after_tag=tag).getId()
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="PythonScript" module="Products.PythonScripts.PythonScript"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_bind_names</string> </key>
<value>
<object>
<klass>
<global name="_reconstructor" module="copy_reg"/>
</klass>
<tuple>
<global name="NameAssignments" module="Shared.DC.Scripts.Bindings"/>
<global name="object" module="__builtin__"/>
<none/>
</tuple>
<state>
<dictionary>
<item>
<key> <string>_asgns</string> </key>
<value>
<dictionary>
<item>
<key> <string>name_container</string> </key>
<value> <string>container</string> </value>
</item>
<item>
<key> <string>name_context</string> </key>
<value> <string>context</string> </value>
</item>
<item>
<key> <string>name_m_self</string> </key>
<value> <string>script</string> </value>
</item>
<item>
<key> <string>name_subpath</string> </key>
<value> <string>traverse_subpath</string> </value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key> <string>_params</string> </key>
<value> <string>run_count=-1</string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>Base_triggerFullSiteMigrationToVirtualMasterStep3</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
from zExceptions import Unauthorized
if REQUEST is not None:
raise Unauthorized
compute_node = context.getObject()
computer_network = compute_node.getSubordinationValue()
if (computer_network is not None) and (compute_node.getFollowUp() != computer_network.getFollowUp()):
compute_node.edit(subordination=None)
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="PythonScript" module="Products.PythonScripts.PythonScript"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_bind_names</string> </key>
<value>
<object>
<klass>
<global name="_reconstructor" module="copy_reg"/>
</klass>
<tuple>
<global name="NameAssignments" module="Shared.DC.Scripts.Bindings"/>
<global name="object" module="__builtin__"/>
<none/>
</tuple>
<state>
<dictionary>
<item>
<key> <string>_asgns</string> </key>
<value>
<dictionary>
<item>
<key> <string>name_container</string> </key>
<value> <string>container</string> </value>
</item>
<item>
<key> <string>name_context</string> </key>
<value> <string>context</string> </value>
</item>
<item>
<key> <string>name_m_self</string> </key>
<value> <string>script</string> </value>
</item>
<item>
<key> <string>name_subpath</string> </key>
<value> <string>traverse_subpath</string> </value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key> <string>_params</string> </key>
<value> <string>force_migration=False, REQUEST=None</string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>ComputeNode_fixupSiteMigrationToVirtualMaster</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment