summaryrefslogtreecommitdiffstats
path: root/nova/compute
diff options
context:
space:
mode:
authorChris Behrens <cbehrens@codestud.com>2012-03-07 02:10:18 +0000
committerChris Behrens <cbehrens@codestud.com>2012-03-07 02:33:32 +0000
commitd94f22dc7a24ec8f769a4fbbffeb1b34780bbf3d (patch)
treea44ae5b6758d4b9a87bd0ee13cbff1cc7dd86a2b /nova/compute
parent52d2ba8237d72b98cae63af65fc8ec00fa50bac4 (diff)
Ignore InstanceNotFound when trying to set instance to ERROR
Fixes bug 948632 There's a race condition where an instance can be deleted from an API call... immediately before some other error occurs during build. Also: compute tests should not test raising quantum exceptions, as those could never possibly make it back to us. rpc.call only raises RemoteError... so use that instead. Change-Id: Iacfe511a37e937eaec1d6213bf73153aa4d4e9bf
Diffstat (limited to 'nova/compute')
-rw-r--r--nova/compute/manager.py10
1 files changed, 7 insertions, 3 deletions
diff --git a/nova/compute/manager.py b/nova/compute/manager.py
index 3d27d94cc..4b640b6ef 100644
--- a/nova/compute/manager.py
+++ b/nova/compute/manager.py
@@ -216,9 +216,13 @@ class ComputeManager(manager.SchedulerDependentManager):
return self.db.instance_update(context, instance_id, kwargs)
def _set_instance_error_state(self, context, instance_uuid):
- self._instance_update(context,
- instance_uuid,
- vm_state=vm_states.ERROR)
+ try:
+ self._instance_update(context,
+ instance_uuid, vm_state=vm_states.ERROR)
+ except exception.InstanceNotFound:
+ LOG.debug(_("Instance %(instance_uuid)s has been destroyed "
+ "from under us while trying to set it to ERROR") %
+ locals())
def init_host(self):
"""Initialization for a standalone compute service."""