From: Jenkins Date: Tue, 10 Mar 2015 15:51:48 +0000 (+0000) Subject: Merge "Improve error handling in refactored Tgt driver" X-Git-Url: https://review.fuel-infra.org/gitweb?a=commitdiff_plain;h=167c2472257ff81626954f1e2d701c7569a8520c;p=openstack-build%2Fcinder-build.git Merge "Improve error handling in refactored Tgt driver" --- 167c2472257ff81626954f1e2d701c7569a8520c diff --cc cinder/volume/targets/tgt.py index 4aca33f3c,876b86ce3..9208c5a9b --- a/cinder/volume/targets/tgt.py +++ b/cinder/volume/targets/tgt.py @@@ -301,16 -309,13 +309,16 @@@ class TgtAdm(iscsi.ISCSITarget) iqn, run_as_root=True) except putils.ProcessExecutionError as e: - if "can't find the target" in e.stderr: - LOG.warning(_LW("Failed target removal because target " - "couldn't be found for iqn: %s."), iqn) + non_fatal_errors = ("can't find the target", + "access control rule does not exist") + + if any(error in e.stderr for error in non_fatal_errors): + LOG.warning(_LW("Failed target removal because target or " + "ACL's couldn't be found for iqn: %s."), iqn) else: - LOG.error(_LE("Failed to remove iscsi target for volume " + LOG.error(_LE("Failed to remove iscsi target for Volume " "ID: %(vol_id)s: %(e)s"), - {'vol_id': vol_id, 'e': six.text_type(e)}) + {'vol_id': vol_id, 'e': e}) raise exception.ISCSITargetRemoveFailed(volume_id=vol_id) # NOTE(jdg): There's a bug in some versions of tgt that # will sometimes fail silently when using the force flag