24696610 iscsi volume deleted before zone
authorSean Wilcox <sean.wilcox@oracle.com>
Mon, 03 Oct 2016 16:58:29 -0600
changeset 7026 5d39d81ed166
parent 7021 0841deb27d32
child 7027 208c99e0d339
24696610 iscsi volume deleted before zone 24742987 orphaned zones can never be deleted by nova
components/openstack/nova/files/solariszones/driver.py
--- a/components/openstack/nova/files/solariszones/driver.py	Mon Oct 03 14:13:38 2016 -0700
+++ b/components/openstack/nova/files/solariszones/driver.py	Mon Oct 03 16:58:29 2016 -0600
@@ -2245,13 +2245,14 @@
                 zone.halt()
         except Exception as ex:
             reason = zonemgr_strerror(ex)
-            if isinstance(ex, rad.client.ObjectError):
-                code = ex.get_payload().code
-                if code == zonemgr.ErrorCode.COMMAND_ERROR:
-                    LOG.warning(_("Ignoring command error returned while "
-                                  "trying to power off instance '%s' via "
-                                  "zonemgr(3RAD): %s" % (name, reason)))
-                    return
+            # A shutdown state could still be reached if the error was
+            # informational and ignorable.
+            if self._get_state(zone) == power_state.SHUTDOWN:
+                LOG.warning(_("Ignoring command error returned while "
+                              "trying to power off instance '%s' via "
+                              "zonemgr(3RAD): %s" % (name, reason)))
+                return
+
             LOG.error(_("Unable to power off instance '%s' via zonemgr(3RAD): "
                         "%s") % (name, reason))
             raise exception.InstancePowerOffFailure(reason=reason)