Commit 5d54ce6c authored by Romain Courteaud's avatar Romain Courteaud

slapos_pdm: only create upgrade decision for SOftware Instance for now

parent a17a061f
......@@ -23,12 +23,19 @@ if software_product is None:
# No way to upgrade, if we can find which Software Product to upgrade
return
node = None
compute_node = None
root_instance_list = [
q for q in instance_tree.getSuccessorValueList(portal_type=["Software Instance", "Slave Instance"])
if q.getSlapState() != 'destroy_requested']
if len(root_instance_list) != 0:
root_instance = root_instance_list[0]
if root_instance.getPortalType() == 'Slave Instance':
# XXX do not upgrade Slave Instance for now
# should check Instance Node or allocation on same tree
return
partition = root_instance.getAggregateValue()
if partition is not None:
compute_node = partition.getParentValue()
person = context.getDestinationSectionValue()
# Search if the product with the same type
......@@ -38,6 +45,7 @@ allocation_cell_list = software_product.getFollowUpValue().Project_getSoftwarePr
software_product_type=software_type,
#software_product_release=software_release,
destination_value=person,
node_value=compute_node,
predicate_portal_type='Allocation Supply Cell'
)
......
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