From 19cc9ec6926e8b9028527c56fb1f4c7f883a08a1 Mon Sep 17 00:00:00 2001 From: Dan Smith Date: Tue, 30 Oct 2012 16:47:43 -0700 Subject: Remove redundant code from PowerVM driver This patch removes the dead instance cleanup from the init_host() method in the PowerVM driver. Not only do I think that it's redundant with the rest of init_host() in compute_manager(), it's also examining the instance task_state, which I think is a layering violation. Tangentially related to bp/no-db-compute Change-Id: Ie7eb4c07caa162f32021ccdbed51db950d30e2c7 --- nova/virt/powervm/driver.py | 15 +-------------- 1 file changed, 1 insertion(+), 14 deletions(-) diff --git a/nova/virt/powervm/driver.py b/nova/virt/powervm/driver.py index 5fc73b4a9..cd91a7299 100644 --- a/nova/virt/powervm/driver.py +++ b/nova/virt/powervm/driver.py @@ -70,20 +70,7 @@ class PowerVMDriver(driver.ComputeDriver): def init_host(self, host): """Initialize anything that is necessary for the driver to function, including catching up with currently running VM's on the given host.""" - context = nova_context.get_admin_context() - instances = db.instance_get_all_by_host(context, host) - powervm_instances = self.list_instances() - # Looks for db instances that don't exist on the host side - # and cleanup the inconsistencies. - for db_instance in instances: - task_state = db_instance['task_state'] - if db_instance['name'] in powervm_instances: - continue - if task_state in [task_states.DELETING, task_states.SPAWNING]: - db.instance_update(context, db_instance['uuid'], - {'vm_state': vm_states.DELETED, - 'task_state': None}) - db.instance_destroy(context, db_instance['uuid']) + pass def get_info(self, instance): """Get the current status of an instance.""" -- cgit