Commit 9c2b697c authored by Rafael Monnerat's avatar Rafael Monnerat

slapos_pdm: Cancel Upgrade Decision if the SR is already running the proper version

parent 27df5117
......@@ -8,9 +8,18 @@ if simulation_state in require_state_list:
if not current_release:
# This upgrade decision is not valid
return False
instance_tree = upgrade_decision.UpgradeDecision_getInstanceTree()
if instance_tree is not None:
current_instance_tree_release = instance_tree.getUrlString()
if current_instance_tree_release == new_url_string:
if simulation_state in cancellable_state_list:
upgrade_decision.cancel()
return True
if current_release.getUrlString() == new_url_string:
# Cannot cancel because the software releases are the same
return False
if simulation_state in cancellable_state_list:
upgrade_decision.cancel()
return True
......
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