Handle AggregateNotFound when deleting aggregate
If an error occurs during lease create and an aggregate isn't created, an exception will be raised in cleanup_resources when trying to delete the missing aggregate. Handle this gracefully and continue. Closes-Bug: #1938241 Change-Id: I866bc7c369fb390f8c9204e36c06fadea17f6dd5
This commit is contained in:
parent
63d94170b5
commit
339e91342d
|
@ -278,7 +278,11 @@ class ReservationPool(NovaClientWrapper):
|
|||
|
||||
"""
|
||||
|
||||
agg = self.get_aggregate_from_name_or_id(pool)
|
||||
try:
|
||||
agg = self.get_aggregate_from_name_or_id(pool)
|
||||
except manager_exceptions.AggregateNotFound:
|
||||
LOG.warn("Aggregate '%s' not found, skipping deletion", pool)
|
||||
return
|
||||
|
||||
hosts = agg.hosts
|
||||
if len(hosts) > 0 and not force:
|
||||
|
|
Loading…
Reference in New Issue