]> review.fuel-infra Code Review - openstack-build/cinder-build.git/commitdiff
Log command failure details before raising ISCSITargetDetachFailed
authorMatt Riedemann <mriedem@us.ibm.com>
Thu, 7 May 2015 20:39:33 +0000 (13:39 -0700)
committerMatt Riedemann <mriedem@us.ibm.com>
Thu, 7 May 2015 20:39:33 +0000 (13:39 -0700)
In the case that there is some useful information in the
ProcessExecutionError (like stderr) when trying to terminate the
connection in the lio target, also log the error.

Related-Bug: #1450658

Change-Id: Id28968735eca27c4c4e5892e14d06aece02b06f5

cinder/volume/targets/lio.py

index 21f9b635e98b5df82078ace5e52796cbf0b8b126..beb61b29fa460dffe1aa05291046b05e45257088 100644 (file)
@@ -189,9 +189,10 @@ class LioAdm(iscsi.ISCSITarget):
                           volume_iqn,
                           connector['initiator'],
                           run_as_root=True)
-        except putils.ProcessExecutionError:
-            LOG.error(_LE("Failed to delete initiator iqn %s to target.") %
-                      connector['initiator'])
+        except putils.ProcessExecutionError as e:
+            LOG.error(_LE("Failed to delete initiator iqn %(initiator)s to "
+                          "target. Error: %(error)s"),
+                      {'initiator': connector['initiator'], 'error': e})
             raise exception.ISCSITargetDetachFailed(volume_id=volume['id'])
 
         # We make changes persistent