[master 3/3] Catch and relay more exception types from the iscsi process

dashea installerbot-noreply at redhat.com
Fri Jun 26 19:38:42 UTC 2015


From: David Shea <dshea at redhat.com>

---
 blivet/iscsi.py | 25 ++++++++++++-------------
 1 file changed, 12 insertions(+), 13 deletions(-)

diff --git a/blivet/iscsi.py b/blivet/iscsi.py
index 4fb8f5e..ccb31b5 100644
--- a/blivet/iscsi.py
+++ b/blivet/iscsi.py
@@ -103,22 +103,21 @@ def _call_discover_targets(con_write, con_recv, ipaddr, port, authinfo):
             if found_nodes is None:
                 found_nodes = []
 
-        except IOError as ex:
-            con_write.send((False, ex))
-            return
+            nodes = []
 
-        nodes = []
+            # the node object is not pickable so it can't be send with pipe
+            # TODO: change libiscsi.node to pickable object
+            for node in found_nodes:
+                nodes.append({'name': node.name,
+                             'tpgt': node.tpgt,
+                             'address': node.address,
+                             'port': node.port,
+                             'iface': node.iface})
 
-        # the node object is not pickable so it can't be send with pipe
-        # TODO: change libiscsi.node to pickable object
-        for node in found_nodes:
-            nodes.append({'name': node.name,
-                         'tpgt': node.tpgt,
-                         'address': node.address,
-                         'port': node.port,
-                         'iface': node.iface})
+            con_write.send((True, nodes))
 
-        con_write.send((True, nodes))
+        except Exception as ex: # pylint: disable=broad-except
+            con_write.send((False, ex))
 
 class iscsi(object):
     """ iSCSI utility class.


-- 
To view this commit on github, visit https://github.com/rhinstaller/blivet/commit/0779324380ee99c8bf8a0c254288a78291ae2356


More information about the anaconda-patches mailing list