Commit dae79ee9 authored by Romain Courteaud's avatar Romain Courteaud

slapos_pdm: do not upgrade if there is no instance yet

parent 5c96df7f
......@@ -28,6 +28,7 @@ if software_product is None:
assert software_release.getUrlString() == instance_tree.getUrlString()
compute_node = None
root_instance = None
root_instance_list = [
q for q in instance_tree.getSuccessorValueList(portal_type=["Software Instance", "Slave Instance"])
if q.getSlapState() != 'destroy_requested']
......@@ -65,7 +66,8 @@ allocation_cell_list = software_product.getFollowUpValue().Project_getSoftwarePr
predicate_portal_type='Allocation Supply Cell'
)
if compute_node is None:
if (compute_node is None) and (root_instance is not None):
# Do not upgrade if there is no instance yet
allocation_cell_node_list = [(x, [y.getPortalType() for y in x.getParentValue().getParentValue().getAggregateValueList()]) for x in allocation_cell_list]
if (root_instance.getPortalType() == 'Slave Instance'):
allocation_cell_list = [x for x, y in allocation_cell_node_list if ("Remote Node" in y) or ("Instance Node" in y)]
......
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