Merge "Remove dead code: _safe_destroy_instance_residue"

This commit is contained in:
Jenkins 2017-02-25 13:58:27 +00:00 committed by Gerrit Code Review
commit ac8f436f3c
1 changed files with 0 additions and 24 deletions

View File

@ -1118,30 +1118,6 @@ class API(base.Base):
return objects.InstanceGroup.get_by_uuid(context, group_hint)
def _safe_destroy_instance_residue(self, instances, instances_to_build):
"""Delete residue left over from a failed instance build with
reckless abandon.
:param instances: List of Instance objects to destroy
:param instances_to_build: List of tuples, output from
_provision_instances, which is:
request_spec, build_request, instance_mapping
"""
for instance in instances:
try:
instance.destroy()
except Exception as e:
LOG.debug('Failed to destroy instance residue: %s', e,
instance=instance)
for to_destroy in instances_to_build:
for thing in to_destroy:
try:
thing.destroy()
except Exception as e:
LOG.debug(
'Failed to destroy %s during residue cleanup: %s',
thing, e)
def _create_instance(self, context, instance_type,
image_href, kernel_id, ramdisk_id,
min_count, max_count,