Change in vdsm[master]: iscsi.py: cleanup - remove temp variable

dougsland at redhat.com dougsland at redhat.com
Thu Mar 13 00:03:34 UTC 2014


Douglas Schilling Landgraf has uploaded a new change for review.

Change subject: iscsi.py: cleanup - remove temp variable
......................................................................

iscsi.py: cleanup - remove temp variable

Don't need to assign new variable to use target.iqn

Change-Id: Ieb581010fab9f56de22c34b67b91b88f8ca3612f
Signed-off-by: Douglas Schilling Landgraf <dougsland at redhat.com>
---
M vdsm/storage/iscsi.py
1 file changed, 6 insertions(+), 8 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/10/25710/1

diff --git a/vdsm/storage/iscsi.py b/vdsm/storage/iscsi.py
index f4fdceb..2adbd01 100644
--- a/vdsm/storage/iscsi.py
+++ b/vdsm/storage/iscsi.py
@@ -143,20 +143,19 @@
 
 
 def addIscsiNode(iface, target, credentials=None):
-    targetName = target.iqn
     portalStr = "%s:%d" % (target.portal.hostname, target.portal.port)
     with _iscsiadmTransactionLock:
-        iscsiadm.node_new(iface.name, portalStr, targetName)
+        iscsiadm.node_new(iface.name, portalStr, target.iqn)
         try:
             if credentials is not None:
                 for key, value in credentials.getIscsiadmOptions():
                     key = "node.session." + key
-                    iscsiadm.node_update(iface.name, portalStr, targetName,
+                    iscsiadm.node_update(iface.name, portalStr, target.iqn,
                                          key, value, hideValue=True)
 
-            iscsiadm.node_login(iface.name, portalStr, targetName)
+            iscsiadm.node_login(iface.name, portalStr, target.iqn)
 
-            iscsiadm.node_update(iface.name, portalStr, targetName,
+            iscsiadm.node_update(iface.name, portalStr, target.iqn,
                                  "node.startup", "manual")
         except:
             removeIscsiNode(iface, target)
@@ -164,15 +163,14 @@
 
 
 def removeIscsiNode(iface, target):
-    targetName = target.iqn
     portalStr = "%s:%d" % (target.portal.hostname, target.portal.port)
     with _iscsiadmTransactionLock:
         try:
-            iscsiadm.node_disconnect(iface.name, portalStr, targetName)
+            iscsiadm.node_disconnect(iface.name, portalStr, target.iqn)
         except iscsiadm.IscsiSessionNotFound:
             pass
 
-        iscsiadm.node_delete(iface.name, portalStr, targetName)
+        iscsiadm.node_delete(iface.name, portalStr, target.iqn)
 
 
 def addIscsiPortal(iface, portal, credentials=None):


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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ieb581010fab9f56de22c34b67b91b88f8ca3612f
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Douglas Schilling Landgraf <dougsland at redhat.com>


More information about the vdsm-patches mailing list