From: Matt Riedemann Date: Thu, 7 May 2015 20:39:33 +0000 (-0700) Subject: Log command failure details before raising ISCSITargetDetachFailed X-Git-Url: https://review.fuel-infra.org/gitweb?a=commitdiff_plain;h=b9f3967c1d048674e5ea53e8a9f539030ff043ef;p=openstack-build%2Fcinder-build.git Log command failure details before raising ISCSITargetDetachFailed 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 --- diff --git a/cinder/volume/targets/lio.py b/cinder/volume/targets/lio.py index 21f9b635e..beb61b29f 100644 --- a/cinder/volume/targets/lio.py +++ b/cinder/volume/targets/lio.py @@ -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