I added a check for tgt already exists here:
https://review.openstack.org/#/c/138173/
But, that was wrong, the err value is never going to be
set because of the exception. This should have inspected
the exception object and checked against it.
So this patch makes it do what it was supposed to do.
Change-Id: I8c184bf1684c8592a36f749cdcb5493f6b65e52b
LOG.warning(_LW("Failed to create iscsi target for volume "
"id:%(vol_id)s: %(e)s")
% {'vol_id': vol_id, 'e': e})
- if "target already exists" in err:
+ if "target already exists" in e.stderr:
LOG.warning(_LW('Create iscsi target failed for '
'target already exists'))
# NOTE(jdg): We've run into some cases where the cmd being