From ef61126ddcd2c1ef9fdb9a496d0b46290dedd8ca Mon Sep 17 00:00:00 2001 From: Matt Odden Date: Fri, 28 Sep 2012 21:33:42 +0000 Subject: powervm: exception handling improvements PowerVMLPARInstanceNotFound should extend InstanceNotFound so nova can handle it as an InstanceNotFound when LPARs are missing Small bug fix so cleanup failing due to LPARs not existing does not cause the delete to fail out, since we had nothing to cleanup fixes bug #1061173 Change-Id: I3b26a477e55b4627f401dbb25c66d5e84ab1fa3f --- nova/virt/powervm/exception.py | 2 +- nova/virt/powervm/operator.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'nova') diff --git a/nova/virt/powervm/exception.py b/nova/virt/powervm/exception.py index 1ced07cfe..be476109c 100644 --- a/nova/virt/powervm/exception.py +++ b/nova/virt/powervm/exception.py @@ -25,7 +25,7 @@ class PowerVMFileTransferFailed(exception.NovaException): message = _("File '%(file_path)' transfer to PowerVM manager failed") -class PowerVMLPARInstanceNotFound(exception.NovaException): +class PowerVMLPARInstanceNotFound(exception.InstanceNotFound): message = _("LPAR instance '%(instance_name)s' could not be found") diff --git a/nova/virt/powervm/operator.py b/nova/virt/powervm/operator.py index 8b411c055..16da1d16c 100644 --- a/nova/virt/powervm/operator.py +++ b/nova/virt/powervm/operator.py @@ -281,8 +281,8 @@ class PowerVMOperator(object): "PowerVM system.") % instance_name) def _cleanup(self, instance_name): + lpar_id = self._get_instance(instance_name)['lpar_id'] try: - lpar_id = self._get_instance(instance_name)['lpar_id'] vhost = self._operator.get_vhost_by_instance_id(lpar_id) disk_name = self._operator.get_disk_name_by_vhost(vhost) -- cgit