Merge "tgt: Remove existence check before delete"

This commit is contained in:
Jenkins 2017-01-16 13:40:28 +00:00 committed by Gerrit Code Review
commit d45444dc42

View File

@ -239,8 +239,8 @@ class TgtAdm(iscsi.ISCSITarget):
os.unlink(volume_path) os.unlink(volume_path)
raise exception.ISCSITargetCreateFailed(volume_id=vol_id) raise exception.ISCSITargetCreateFailed(volume_id=vol_id)
if old_persist_file is not None and os.path.exists(old_persist_file): if old_persist_file is not None:
os.unlink(old_persist_file) fileutils.delete_if_exists(old_persist_file)
return tid return tid