Skip to content

Commit

Permalink
Different exit code in new versions of iscsiadm
Browse files Browse the repository at this point in the history
Fixes bug #932356
For "iscsiadm: No records found"
if version <= 2.0-871 iscsiadm returns 255
newer versions return 21

Change-Id: Ib4319ed11b20a339b439c70574d0d45acc8814fa
  • Loading branch information
derekhiggins committed Feb 15, 2012
1 parent 99c2e02 commit 99b9691
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion nova/virt/libvirt/volume.py
Expand Up @@ -114,7 +114,8 @@ def connect_volume(self, connection_info, mount_device):
try:
self._run_iscsiadm(iscsi_properties, ())
except exception.ProcessExecutionError as exc:
if exc.exit_code == 255:
# iscsiadm returns 21 for "No records found" after version 2.0-871
if exc.exit_code in [21, 255]:
self._run_iscsiadm(iscsi_properties, ('--op', 'new'))
else:
raise
Expand Down

0 comments on commit 99b9691

Please sign in to comment.