Commit bad8e786 authored by Rafael Monnerat's avatar Rafael Monnerat

slapos_erp5: Don't update the upgrade_scope when change allocation_scope

   We just leave as it is, and let the user decide for himself the value.
parent 126bb776
compute_node = state_object["object"]
allocation_scope = compute_node.getAllocationScope()
upgrade_scope = compute_node.getUpgradeScope()
if allocation_scope in ['open/public', 'open/subscription']:
# Public compute_node capacity is handle by an alarm
capacity_scope = 'close'
monitor_scope = 'enabled'
if upgrade_scope in [None, 'ask_confirmation']:
upgrade_scope = 'auto'
elif allocation_scope == 'open/friend':
# Capacity is not handled for 'private' compute_nodes
capacity_scope = 'open'
monitor_scope = 'enabled'
if upgrade_scope in [None, 'ask_confirmation']:
upgrade_scope = 'auto'
elif allocation_scope == 'open/personal':
capacity_scope = 'open'
# Keep the same.
monitor_scope = compute_node.getMonitorScope("disabled")
if upgrade_scope is None:
upgrade_scope = 'ask_confirmation'
else:
monitor_scope = 'disabled'
capacity_scope = 'close'
edit_kw = {
'capacity_scope': capacity_scope,
'monitor_scope': monitor_scope,
'upgrade_scope': upgrade_scope
'monitor_scope': monitor_scope
}
self_person = compute_node.getSourceAdministrationValue(portal_type="Person")
......
......@@ -52,6 +52,12 @@
<key> <string>_params</string> </key>
<value> <string>state_object</string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>script_ComputeNode_updateAllocation</string> </value>
......
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