Merge "Create group from snapshot-group failure leaves behind the volume"

This commit is contained in:
Zuul 2017-12-25 16:27:41 +00:00 committed by Gerrit Code Review
commit 0ec6fd5b1a
1 changed files with 8 additions and 0 deletions

View File

@ -315,6 +315,10 @@ class API(base.Base):
except Exception:
with excutils.save_and_reraise_exception():
try:
volumes = objects.VolumeList.get_all_by_generic_group(
context, group.id)
for vol in volumes:
vol.destroy()
group.destroy()
finally:
LOG.error("Error occurred when creating group "
@ -392,6 +396,10 @@ class API(base.Base):
except Exception:
with excutils.save_and_reraise_exception():
try:
volumes = objects.VolumeList.get_all_by_generic_group(
context, group.id)
for vol in volumes:
vol.destroy()
group.destroy()
finally:
LOG.error("Error occurred when creating "