Change in vdsm[master]: cleanup: inline STRG_*SCSI_* macros

danken at redhat.com danken at redhat.com
Thu Apr 25 20:04:39 UTC 2013


Dan Kenigsberg has uploaded a new change for review.

Change subject: cleanup: inline STRG_*SCSI_* macros
......................................................................

cleanup: inline STRG_*SCSI_* macros

They are used only once; their name is less clear than their content.

Change-Id: I80c54e1c398ea46badb1e57b3c446fefa9122581
Signed-off-by: Dan Kenigsberg <danken at redhat.com>
---
M lib/vdsm/constants.py.in
M vdsm/storage/iscsi.py
2 files changed, 3 insertions(+), 10 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/56/14256/1

diff --git a/lib/vdsm/constants.py.in b/lib/vdsm/constants.py.in
index c61ef0f..022affd 100644
--- a/lib/vdsm/constants.py.in
+++ b/lib/vdsm/constants.py.in
@@ -136,10 +136,3 @@
 EXT_VDSM_STORE_NET_CONFIG = '@VDSMDIR@/vdsm-store-net-config'
 
 EXT_WGET = '@WGET_PATH@'
-
-#
-# Storage constants
-#
-STRG_ISCSI_HOST = "iscsi_host/"
-STRG_SCSI_HOST = "scsi_host/"
-STRG_ISCSI_SESSION = "iscsi_session/"
diff --git a/vdsm/storage/iscsi.py b/vdsm/storage/iscsi.py
index f2ff0db..2139e78 100644
--- a/vdsm/storage/iscsi.py
+++ b/vdsm/storage/iscsi.py
@@ -428,8 +428,8 @@
     hostdir = os.path.realpath(os.path.join("/sys/block", dev,
                                             "device/../../.."))
     host = os.path.basename(hostdir)
-    iscsi_host = os.path.join(hostdir, constants.STRG_ISCSI_HOST, host)
-    scsi_host = os.path.join(hostdir, constants.STRG_SCSI_HOST, host)
+    iscsi_host = os.path.join(hostdir, "iscsi_host/", host)
+    scsi_host = os.path.join(hostdir, "scsi_host/", host)
     proc_name = os.path.join(scsi_host, "proc_name")
     return (os.path.exists(iscsi_host) and os.path.exists(proc_name))
 
@@ -440,7 +440,7 @@
     sessiondir = os.path.realpath(os.path.join(device, "../.."))
     session = os.path.basename(sessiondir)
     iscsi_session = os.path.join(sessiondir,
-                                 constants.STRG_ISCSI_SESSION + session)
+                                 "iscsi_session/" + session)
     with open(os.path.join(iscsi_session, "targetname")) as f:
         return f.readline().strip()
 


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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I80c54e1c398ea46badb1e57b3c446fefa9122581
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Dan Kenigsberg <danken at redhat.com>


More information about the vdsm-patches mailing list