Browse Source

Merge "Remove unnecessary call to info_cache.delete"

tags/13.0.0.0b1
Jenkins 4 years ago
parent
commit
0396f98eaf
2 changed files with 0 additions and 12 deletions
  1. +0
    -8
      nova/compute/api.py
  2. +0
    -4
      nova/tests/unit/compute/test_compute_api.py

+ 0
- 8
nova/compute/api.py View File

@@ -1801,14 +1801,6 @@ class API(base.Base):
else:
LOG.warning(_LW("instance's host %s is down, deleting from "
"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(
self.notifier, context, instance, "%s.start" % delete_type)


+ 0
- 4
nova/tests/unit/compute/test_compute_api.py View File

@@ -740,7 +740,6 @@ class _ComputeAPIUnitTestMixIn(object):
test.TestingException("Unexpected error"))

def _test_downed_host_part(self, inst, updates, delete_time, delete_type):
inst.info_cache.delete()
compute_utils.notify_about_instance_usage(
self.compute_api.notifier, self.context, inst,
'%s.start' % delete_type)
@@ -792,7 +791,6 @@ class _ComputeAPIUnitTestMixIn(object):
self.mox.StubOutWithMock(compute_utils, 'reserve_quota_delta')
self.mox.StubOutWithMock(self.compute_api, '_record_action_start')
self.mox.StubOutWithMock(db, 'instance_update_and_get_original')
self.mox.StubOutWithMock(inst.info_cache, 'delete')
self.mox.StubOutWithMock(self.compute_api.network_api,
'deallocate_for_instance')
self.mox.StubOutWithMock(db, 'instance_system_metadata_get')
@@ -1029,7 +1027,6 @@ class _ComputeAPIUnitTestMixIn(object):

self.mox.StubOutWithMock(inst, 'destroy')
self.mox.StubOutWithMock(self.context, 'elevated')
self.mox.StubOutWithMock(inst.info_cache, 'delete')
self.mox.StubOutWithMock(self.compute_api.network_api,
'deallocate_for_instance')
self.mox.StubOutWithMock(db, 'instance_system_metadata_get')
@@ -1039,7 +1036,6 @@ class _ComputeAPIUnitTestMixIn(object):
'terminate_connection')
self.mox.StubOutWithMock(objects.BlockDeviceMapping, 'destroy')

inst.info_cache.delete()
compute_utils.notify_about_instance_usage(
self.compute_api.notifier, self.context,
inst, 'delete.start')

Loading…
Cancel
Save