diff options
author | Brian Lamar <brian.lamar@rackspace.com> | 2011-08-24 18:00:03 -0400 |
---|---|---|
committer | Brian Lamar <brian.lamar@rackspace.com> | 2011-08-24 18:00:03 -0400 |
commit | 575f72693fa20c7c4157c8ce9702751cd54f1a82 (patch) | |
tree | e0c66407e084dc343d0cd2f413ba1fd39069e672 /nova/compute/manager.py | |
parent | 80adf41ded7fc09aa1b59e567b917f7fc1e865f6 (diff) | |
download | nova-575f72693fa20c7c4157c8ce9702751cd54f1a82.tar.gz |
Fixed silly ordering issue which was causing tons of test failures.
Diffstat (limited to 'nova/compute/manager.py')
-rw-r--r-- | nova/compute/manager.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/nova/compute/manager.py b/nova/compute/manager.py index 924799dc44..c29eef07fd 100644 --- a/nova/compute/manager.py +++ b/nova/compute/manager.py @@ -490,15 +490,15 @@ class ComputeManager(manager.SchedulerDependentManager): def terminate_instance(self, context, instance_id): """Terminate an instance on this host.""" self._shutdown_instance(context, instance_id, 'Terminating') - self.db.instance_destroy(context, instance_id) - + instance = self.db.instance_get(context.elevated(), instance_id) self._instance_update(context, instance_id, vm_state=vm_states.DELETED, task_state=None, terminated_at=utils.utcnow()) - instance = self.db.instance_get(context.elevated(), instance_id) + self.db.instance_destroy(context, instance_id) + usage_info = utils.usage_from_instance(instance) notifier.notify('compute.%s' % self.host, 'compute.instance.delete', |