Merge "Get BDMs when we need to in _handle_cell_delete"

This commit is contained in:
Jenkins 2017-06-07 22:43:14 +00:00 committed by Gerrit Code Review
commit c7afbb95e6
1 changed files with 2 additions and 2 deletions

View File

@ -225,8 +225,6 @@ class ComputeCellsAPI(compute_api.API):
delete_type = method_name == 'soft_delete' and 'soft' or 'hard'
self.cells_rpcapi.instance_delete_everywhere(context,
instance, delete_type)
bdms = objects.BlockDeviceMappingList.get_by_instance_uuid(
context, instance.uuid)
# NOTE(danms): If we try to delete an instance with no cell,
# there isn't anything to salvage, so we can hard-delete here.
try:
@ -260,6 +258,8 @@ class ComputeCellsAPI(compute_api.API):
# Instance has been deleted out from under us
return
bdms = objects.BlockDeviceMappingList.get_by_instance_uuid(
context, instance.uuid)
try:
super(ComputeCellsAPI, self)._local_delete(context, instance,
bdms, method_name,