Commit 8276413b authored by Cédric Le Ninivin's avatar Cédric Le Ninivin Committed by Romain Courteaud

slapos_cloud: Catch not found computer when getting compute partition

parent 2ea8df23
......@@ -71,9 +71,13 @@ class SlapOSCatalogToolCacheMixin(object):
@UnrestrictedMethod
def _getNonCachedComputeNodeUid(self, reference):
return self.unrestrictedSearchResults(
portal_type=['Compute Node', 'Remote Node'], reference=reference,
validation_state="validated")[0].UID
compute_node_list = self.unrestrictedSearchResults(
portal_type='Compute Node', reference=reference,
validation_state="validated")
if len(compute_node_list) != 1:
raise NotFound, "No document found with parameters: %s" % reference
return compute_node_list[0].UID
def getComputePartitionObject(self, compute_node_reference,
compute_partition_reference):
......
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