Commit 01bf1c59 authored by Cédric Le Ninivin's avatar Cédric Le Ninivin Committed by Cédric Le Ninivin

slapos_cloud: Catch not found computer when getting compute partition

parent f8a0c2b5
...@@ -71,9 +71,13 @@ class SlapOSCatalogToolCacheMixin(object): ...@@ -71,9 +71,13 @@ class SlapOSCatalogToolCacheMixin(object):
@UnrestrictedMethod @UnrestrictedMethod
def _getNonCachedComputeNodeUid(self, reference): def _getNonCachedComputeNodeUid(self, reference):
return self.unrestrictedSearchResults( compute_node_list = self.unrestrictedSearchResults(
portal_type='Compute Node', reference=reference, portal_type='Compute Node', reference=reference,
validation_state="validated")[0].UID 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, def getComputePartitionObject(self, compute_node_reference,
compute_partition_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