Merge "Remove unnecessary call to info_cache.delete"

This commit is contained in:
Jenkins 2015-10-08 03:54:49 +00:00 committed by Gerrit Code Review
commit 0396f98eaf
2 changed files with 0 additions and 12 deletions

View File

@ -1801,14 +1801,6 @@ class API(base.Base):
else: else:
LOG.warning(_LW("instance's host %s is down, deleting from " LOG.warning(_LW("instance's host %s is down, deleting from "
"database"), instance.host, instance=instance) "database"), instance.host, instance=instance)
if instance.info_cache is not None:
instance.info_cache.delete()
else:
# NOTE(yoshimatsu): Avoid AttributeError if instance.info_cache
# is None. When the root cause that instance.info_cache becomes
# None is fixed, the log level should be reconsidered.
LOG.warning(_LW("Info cache for instance could not be found. "
"Ignore."), instance=instance)
compute_utils.notify_about_instance_usage( compute_utils.notify_about_instance_usage(
self.notifier, context, instance, "%s.start" % delete_type) self.notifier, context, instance, "%s.start" % delete_type)

View File

@ -740,7 +740,6 @@ class _ComputeAPIUnitTestMixIn(object):
test.TestingException("Unexpected error")) test.TestingException("Unexpected error"))
def _test_downed_host_part(self, inst, updates, delete_time, delete_type): def _test_downed_host_part(self, inst, updates, delete_time, delete_type):
inst.info_cache.delete()
compute_utils.notify_about_instance_usage( compute_utils.notify_about_instance_usage(
self.compute_api.notifier, self.context, inst, self.compute_api.notifier, self.context, inst,
'%s.start' % delete_type) '%s.start' % delete_type)
@ -792,7 +791,6 @@ class _ComputeAPIUnitTestMixIn(object):
self.mox.StubOutWithMock(compute_utils, 'reserve_quota_delta') self.mox.StubOutWithMock(compute_utils, 'reserve_quota_delta')
self.mox.StubOutWithMock(self.compute_api, '_record_action_start') self.mox.StubOutWithMock(self.compute_api, '_record_action_start')
self.mox.StubOutWithMock(db, 'instance_update_and_get_original') self.mox.StubOutWithMock(db, 'instance_update_and_get_original')
self.mox.StubOutWithMock(inst.info_cache, 'delete')
self.mox.StubOutWithMock(self.compute_api.network_api, self.mox.StubOutWithMock(self.compute_api.network_api,
'deallocate_for_instance') 'deallocate_for_instance')
self.mox.StubOutWithMock(db, 'instance_system_metadata_get') self.mox.StubOutWithMock(db, 'instance_system_metadata_get')
@ -1029,7 +1027,6 @@ class _ComputeAPIUnitTestMixIn(object):
self.mox.StubOutWithMock(inst, 'destroy') self.mox.StubOutWithMock(inst, 'destroy')
self.mox.StubOutWithMock(self.context, 'elevated') self.mox.StubOutWithMock(self.context, 'elevated')
self.mox.StubOutWithMock(inst.info_cache, 'delete')
self.mox.StubOutWithMock(self.compute_api.network_api, self.mox.StubOutWithMock(self.compute_api.network_api,
'deallocate_for_instance') 'deallocate_for_instance')
self.mox.StubOutWithMock(db, 'instance_system_metadata_get') self.mox.StubOutWithMock(db, 'instance_system_metadata_get')
@ -1039,7 +1036,6 @@ class _ComputeAPIUnitTestMixIn(object):
'terminate_connection') 'terminate_connection')
self.mox.StubOutWithMock(objects.BlockDeviceMapping, 'destroy') self.mox.StubOutWithMock(objects.BlockDeviceMapping, 'destroy')
inst.info_cache.delete()
compute_utils.notify_about_instance_usage( compute_utils.notify_about_instance_usage(
self.compute_api.notifier, self.context, self.compute_api.notifier, self.context,
inst, 'delete.start') inst, 'delete.start')