summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatt Odden <mrodden@us.ibm.com>2012-09-28 21:33:42 +0000
committerMatt Odden <mrodden@us.ibm.com>2012-10-03 19:20:11 +0000
commitef61126ddcd2c1ef9fdb9a496d0b46290dedd8ca (patch)
treee9aa9f2c46d3c4e580858ea4b8bdff33f3eeedd5
parent1d4506c16aec9674be6a3685ba585a8bbd9c1559 (diff)
downloadnova-ef61126ddcd2c1ef9fdb9a496d0b46290dedd8ca.tar.gz
nova-ef61126ddcd2c1ef9fdb9a496d0b46290dedd8ca.tar.xz
nova-ef61126ddcd2c1ef9fdb9a496d0b46290dedd8ca.zip
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
-rw-r--r--nova/virt/powervm/exception.py2
-rw-r--r--nova/virt/powervm/operator.py2
2 files changed, 2 insertions, 2 deletions
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)