[node-patches] Change in ovirt-node[master]: storage: Just warn about missing import

fabiand at fedoraproject.org fabiand at fedoraproject.org
Thu Jan 3 16:39:15 UTC 2013


Fabian Deutsch has uploaded a new change for review.

Change subject: storage: Just warn about missing import
......................................................................

storage: Just warn about missing import

Change-Id: I1bd1c08162ff9132a3a87dcd20402631b23064f1
Signed-off-by: Fabian Deutsch <fabiand at fedoraproject.org>
---
M scripts/tui/src/ovirt/node/utils/storage.py
1 file changed, 7 insertions(+), 4 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-node refs/changes/33/10633/1

diff --git a/scripts/tui/src/ovirt/node/utils/storage.py b/scripts/tui/src/ovirt/node/utils/storage.py
index 037e51d..cf1b3a8 100644
--- a/scripts/tui/src/ovirt/node/utils/storage.py
+++ b/scripts/tui/src/ovirt/node/utils/storage.py
@@ -26,10 +26,13 @@
     """A class to deal with some external iSCSI related functionality
     """
     def initiator_name(self, initiator_name=None):
-        import ovirtnode.iscsi as oiscsi
-        if initiator_name:
-            oiscsi.set_iscsi_initiator(initiator_name)
-        return oiscsi.get_current_iscsi_initiator_name()
+        try:
+            import ovirtnode.iscsi as oiscsi
+            if initiator_name:
+                oiscsi.set_iscsi_initiator(initiator_name)
+            return oiscsi.get_current_iscsi_initiator_name()
+        except ImportError as e:
+            self.logger.warning("Failed on import: %s" % e)
 
 
 class NFSv4(base.Base):


--
To view, visit http://gerrit.ovirt.org/10633
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I1bd1c08162ff9132a3a87dcd20402631b23064f1
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-node
Gerrit-Branch: master
Gerrit-Owner: Fabian Deutsch <fabiand at fedoraproject.org>



More information about the node-patches mailing list