Skip to content

Commit

Permalink
Trap iscsiadm error
Browse files Browse the repository at this point in the history
If the iscsitarget was previously deleted and the user tries
to delete the iscsi target again, then you get a nasty traceback
in the logfiles.

According to the iscsiadm man page, iscsiadm returns an error 21,
ISCSI_ERR_NO_OBJS_FOUND if there is no records/targets/sessions/portals
found to execute the operation on.

LP: #1011166

Change-Id: I3087c1a114fe91bd7361d92688d4f926bc3f8951
Signed-off-by: Chuck Short <chuck.short@canonical.com>
  • Loading branch information
Chuck Short committed Aug 24, 2012
1 parent af687ff commit 9135f83
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion nova/virt/libvirt/volume.py
Original file line number Diff line number Diff line change
Expand Up @@ -203,4 +203,4 @@ def disconnect_volume(self, connection_info, mount_device):
self._run_iscsiadm(iscsi_properties, ("--logout",),
check_exit_code=[0, 255])
self._run_iscsiadm(iscsi_properties, ('--op', 'delete'),
check_exit_code=[0, 255])
check_exit_code=[0, 21, 255])

0 comments on commit 9135f83

Please sign in to comment.