Commit 02968f33 authored by Romain Courteaud's avatar Romain Courteaud

slapos_pdm: drop upgrade_scope

parent f857cd33
...@@ -4,16 +4,6 @@ from DateTime import DateTime ...@@ -4,16 +4,6 @@ from DateTime import DateTime
portal = upgrade_decision.getPortalObject() portal = upgrade_decision.getPortalObject()
instance_tree = upgrade_decision.getAggregateValue() instance_tree = upgrade_decision.getAggregateValue()
# Get required arguments
kwargs = state_change.kwargs
# Required args
# Raise TypeError if all parameters are not provided
try:
upgrade_scope = kwargs['upgrade_scope']
except KeyError:
raise TypeError("UpgradeDecision_approveRegistration takes exactly 1 arguments")
tag = "%s_requestUpgradeDecisionCreation_inProgress" % instance_tree.getUid() tag = "%s_requestUpgradeDecisionCreation_inProgress" % instance_tree.getUid()
activate_kw = {'tag': tag} activate_kw = {'tag': tag}
if portal.portal_activities.countMessageWithTag(tag) > 0: if portal.portal_activities.countMessageWithTag(tag) > 0:
...@@ -25,9 +15,8 @@ with upgrade_decision.defaultActivateParameterDict(activate_kw): ...@@ -25,9 +15,8 @@ with upgrade_decision.defaultActivateParameterDict(activate_kw):
upgrade_decision.plan() upgrade_decision.plan()
upgrade_decision.setStartDate(DateTime()) upgrade_decision.setStartDate(DateTime())
if upgrade_scope == "auto": if upgrade_decision.getSimulationState() == "planned":
if upgrade_decision.getSimulationState() == "planned": upgrade_decision.start()
upgrade_decision.start()
# Prevent concurrent transaction to create 2 upgrade decision for the same instance_tree # Prevent concurrent transaction to create 2 upgrade decision for the same instance_tree
instance_tree.serialize() instance_tree.serialize()
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