Commit 15ead388 authored by Romain Courteaud's avatar Romain Courteaud

slapos_pdm: no need to check all rejected decisions

parent 9485016a
......@@ -79,14 +79,14 @@ if len(allocation_cell_list) == 1:
if compute_node is not None:
assert compute_node.getRelativeUrl() in allocation_cell_list[0].getParentValue().getParentValue().getAggregateList()
for previous_upgrade_decision in portal.portal_catalog(
if portal.portal_catalog.getResultValue(
portal_type='Upgrade Decision',
aggregate__uid=instance_tree.getUid(),
simulation_state=['rejected']
simulation_state=['rejected'],
software_release__uid=allocation_cell_list[0].getSoftwareReleaseUid()
):
# If same upgrade decision has been rejected, do nothing
if previous_upgrade_decision.getSoftwareReleaseValue().getUrlString() == allocation_cell_list[0].getSoftwareReleaseValue().getUrlString():
return
return
decision_title = 'A new upgrade is available for %s' % instance_tree.getTitle()
upgrade_decision = portal.upgrade_decision_module.newContent(
......
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