Only reverify backing lun when create backing lun

In TgtAdm, we alway do twice _verify_backing_lun whether backing lun
exists or not.
If backing lun exists, it doesn't need to call _verify_backing_lun
function again.
It only needs reverify whether backing lun exists or not when recreate
backing lun.

Change-Id: Ic11d778362540df307056a1adcba932e571b7d20
Closes-Bug: #1262958
This commit is contained in:
ling-yun 2013-12-20 10:55:18 +08:00
parent 2c76803a63
commit fe03c20ea3
1 changed files with 4 additions and 4 deletions

View File

@ -238,10 +238,10 @@ class TgtAdm(TargetAdmin):
os.unlink(volume_path)
raise exception.ISCSITargetCreateFailed(volume_id=vol_id)
# Finally check once more and if no go, fail and punt
if not self._verify_backing_lun(iqn, tid):
os.unlink(volume_path)
raise exception.ISCSITargetCreateFailed(volume_id=vol_id)
# Finally check once more and if no go, fail and punt
if not self._verify_backing_lun(iqn, tid):
os.unlink(volume_path)
raise exception.ISCSITargetCreateFailed(volume_id=vol_id)
if old_persist_file is not None and os.path.exists(old_persist_file):
os.unlink(old_persist_file)