summaryrefslogtreecommitdiffstats
path: root/nova
diff options
context:
space:
mode:
authorJenkins <jenkins@review.openstack.org>2012-07-26 19:21:21 +0000
committerGerrit Code Review <review@openstack.org>2012-07-26 19:21:21 +0000
commitc0eef1ccc796ecdb6ef036daafaafe1214d05c88 (patch)
treeefbfbe94b1c5c7a771904f96c9990c9ef1f84a5f /nova
parentfd5d3489f93effee45b3e629b8fb1908ca2d8709 (diff)
parent27826a84cc603772dd4fb9fc7360b27e0f52b322 (diff)
downloadnova-c0eef1ccc796ecdb6ef036daafaafe1214d05c88.tar.gz
nova-c0eef1ccc796ecdb6ef036daafaafe1214d05c88.tar.xz
nova-c0eef1ccc796ecdb6ef036daafaafe1214d05c88.zip
Merge "Allow power_off when instance doesn't exist"
Diffstat (limited to 'nova')
-rw-r--r--nova/virt/xenapi/vmops.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/nova/virt/xenapi/vmops.py b/nova/virt/xenapi/vmops.py
index 5dcc53b94..61bb16306 100644
--- a/nova/virt/xenapi/vmops.py
+++ b/nova/virt/xenapi/vmops.py
@@ -1089,8 +1089,12 @@ class VMOps(object):
def power_off(self, instance):
"""Power off the specified instance."""
- vm_ref = self._get_vm_opaque_ref(instance)
- vm_utils.shutdown_vm(self._session, instance, vm_ref, hard=True)
+ try:
+ vm_ref = self._get_vm_opaque_ref(instance)
+ vm_utils.shutdown_vm(self._session, instance, vm_ref, hard=True)
+ except exception.NotFound:
+ LOG.warning(_("VM is not present, skipping power off..."),
+ instance=instance)
def power_on(self, instance):
"""Power on the specified instance."""