]> review.fuel-infra Code Review - openstack-build/cinder-build.git/commit
Don't fail target_delete if target doesn't exist
authorJohn Griffith <john.griffith@solidfire.com>
Mon, 9 Feb 2015 21:45:40 +0000 (14:45 -0700)
committerJohn Griffith <john.griffith@solidfire.com>
Wed, 11 Feb 2015 05:06:32 +0000 (22:06 -0700)
commit19a31d33a4fa732eedc3a6c6c9a5956c70498779
tree8f85541e7bfe6e1a7b58bc633bef686323920ceb
parent940f6ca0ead392fe031dbebb9a10223e2d895c63
Don't fail target_delete if target doesn't exist

There are cases seen in the Gate where a target delete is
called and an exception is raised because the target does
not exist. In the cinder target driver code we raise this
as an ISCSITargetRemoveFailed exception, but if we're asking
to delete the target and the target doesn't exist we can
probably safely move along.

This patch adds a check for this specific case and logs a warning
and continues rather than failing.  We also add a unit test to
check this case.

Change-Id: I7021cafc9ee48bb8ad54433e4482ff1d61e865ae
Closes-Bug: #1420010
cinder/tests/targets/test_lio_driver.py
cinder/tests/targets/test_tgt_driver.py
cinder/volume/targets/tgt.py