Commit 8dfa4003 authored by Rafael Monnerat's avatar Rafael Monnerat

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

parent b1e4b357
Pipeline #17518 failed with stage
in 0 seconds
...@@ -8,9 +8,18 @@ if simulation_state in require_state_list: ...@@ -8,9 +8,18 @@ if simulation_state in require_state_list:
if not current_release: if not current_release:
# This upgrade decision is not valid # This upgrade decision is not valid
return False 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: if current_release.getUrlString() == new_url_string:
# Cannot cancel because the software releases are the same # Cannot cancel because the software releases are the same
return False return False
if simulation_state in cancellable_state_list: if simulation_state in cancellable_state_list:
upgrade_decision.cancel() upgrade_decision.cancel()
return True 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