diff options
| author | Ed Leafe <ed@leafe.com> | 2011-05-25 15:45:53 +0000 |
|---|---|---|
| committer | Tarmac <> | 2011-05-25 15:45:53 +0000 |
| commit | e82ef1255631b2b2d4b209eb112b320f24f6d3f2 (patch) | |
| tree | b11168ae6f91d8c31c9fa15359f8a40dfc27c4f7 | |
| parent | 6f3f188e4ca9136f293ecf4b9813a7615c7a5929 (diff) | |
| parent | 7387af3ab5a310f7c427f0257e531871f62f398d (diff) | |
| download | nova-e82ef1255631b2b2d4b209eb112b320f24f6d3f2.tar.gz nova-e82ef1255631b2b2d4b209eb112b320f24f6d3f2.tar.xz nova-e82ef1255631b2b2d4b209eb112b320f24f6d3f2.zip | |
The code for getting an opaque reference to an instance assumed that there was a reference to an instance obj available when raising an exception. I changed this from raising an InstanceNotFound exception to a NotFound, as this is more appropriate for the failure, and doesn't require an instance ID.
| -rw-r--r-- | nova/virt/xenapi/vmops.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/nova/virt/xenapi/vmops.py b/nova/virt/xenapi/vmops.py index 45b04351d..aaf5585b1 100644 --- a/nova/virt/xenapi/vmops.py +++ b/nova/virt/xenapi/vmops.py @@ -253,7 +253,8 @@ class VMOps(object): instance_name = instance_or_vm.name vm_ref = VMHelper.lookup(self._session, instance_name) if vm_ref is None: - raise exception.InstanceNotFound(instance_id=instance_obj.id) + raise exception.NotFound(_("No opaque_ref could be determined " + "for '%s'.") % instance_or_vm) return vm_ref def _acquire_bootlock(self, vm): |
