diff options
author | Jenkins <jenkins@review.openstack.org> | 2013-03-03 20:06:37 +0000 |
---|---|---|
committer | Gerrit Code Review <review@openstack.org> | 2013-03-03 20:06:37 +0000 |
commit | 5d8e6130e4c1f5abf85dc87456b3844c4e6ccf0f (patch) | |
tree | 91d10429cff317d6abdba35d95028fded5809ab5 /nova/compute | |
parent | 587e03962f99300c089a1fe99aef567931a4c8ea (diff) | |
parent | 58889a08fcce7407366f8aae0c703b4fa0480725 (diff) | |
download | nova-5d8e6130e4c1f5abf85dc87456b3844c4e6ccf0f.tar.gz nova-5d8e6130e4c1f5abf85dc87456b3844c4e6ccf0f.tar.xz nova-5d8e6130e4c1f5abf85dc87456b3844c4e6ccf0f.zip |
Merge "Make ComputeManager _running_deleted_instances query by uuid"
Diffstat (limited to 'nova/compute')
-rwxr-xr-x | nova/compute/manager.py | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/nova/compute/manager.py b/nova/compute/manager.py index 9979187f9..346d957d2 100755 --- a/nova/compute/manager.py +++ b/nova/compute/manager.py @@ -3739,22 +3739,20 @@ class ComputeManager(manager.SchedulerDependentManager): def _running_deleted_instances(self, context): """Returns a list of instances nova thinks is deleted, - but the hypervisor thinks is still running. This method - should be pushed down to the virt layer for efficiency. + but the hypervisor thinks is still running. """ + timeout = CONF.running_deleted_instance_timeout + def deleted_instance(instance): - timeout = CONF.running_deleted_instance_timeout - present = instance['name'] in present_name_labels - erroneously_running = instance['deleted'] and present + erroneously_running = instance['deleted'] old_enough = (not instance['deleted_at'] or timeutils.is_older_than(instance['deleted_at'], timeout)) if erroneously_running and old_enough: return True return False - present_name_labels = set(self.driver.list_instances()) - instances = self.conductor_api.instance_get_all_by_host(context, - self.host) + + instances = self._get_instances_on_driver(context) return [i for i in instances if deleted_instance(i)] @contextlib.contextmanager |