Commit 61b8f6f3 authored by Cédric Le Ninivin's avatar Cédric Le Ninivin Committed by Titouan Soulard

slapos_cloud: Catch not found computer when getting compute partition

parent 7ca3a9b7
...@@ -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', 'Remote Node'], reference=reference, portal_type=['Compute Node', 'Remote Node'],
validation_state="validated")[0].UID 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, 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