Merge "Catch specific exception on claim"

This commit is contained in:
Zuul 2018-03-11 00:09:46 +00:00 committed by Gerrit Code Review
commit eb664225a3
2 changed files with 2 additions and 4 deletions

View File

@ -79,7 +79,7 @@ class Claim(NopClaim):
self._pci_requests = pci_requests
# Check claim at constructor to avoid mess code
# Raise exception ComputeResourcesUnavailable if claim failed
# Raise exception ResourcesUnavailable if claim failed
self._claim_test(resources, limits)
@property

View File

@ -309,9 +309,7 @@ class Manager(periodic_task.PeriodicTasks):
context, container, requested_networks, requested_volumes,
sandbox, limits, reraise)
return created_container
except Exception as e:
# Other exception has handled in create sandbox and create base,
# exception occured here only can be the claim failed.
except exception.ResourcesUnavailable as e:
with excutils.save_and_reraise_exception(reraise=reraise):
LOG.exception("Container resource claim failed: %s",
six.text_type(e))