From b9f3967c1d048674e5ea53e8a9f539030ff043ef Mon Sep 17 00:00:00 2001 From: Matt Riedemann Date: Thu, 7 May 2015 13:39:33 -0700 Subject: [PATCH] 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 --- cinder/volume/targets/lio.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) 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 -- 2.45.2