Fixup persistence file not found on tgt remove
After commit:
beecd769af02ba5915be827d28a7b46d970e41b0
we're experiencing a race in the tempest gating tests.
It appears that there are certain cases where a detach
and a delete call can overlap causing a race in the
remove_iscsi_target method. The result is that when
the slower method gets around to the final removal of
the persistence file it's no longer there, so we
hit an unhandled exception.
This patch does two things:
1. It adds the volume lock to the detach_volume
method in the manager (already in place for delete).
This should mitigate the race and allow us to avoid it.
2. In the iscsi_remove_target method check if the
persist file has already been removed when we get
to the last check. The fact is that if it was somehow
removed before we got here we don't really care, we're
just going to delete it anyway.
Change-Id: Ied45e1a66c8fb79c95ada66f8c59bd2839e200ad
Closes-Bug:
1277362