Yeela Kaplan has uploaded a new change for review.
Change subject: iscsi: Move iscsi constatnts to the appropriate module
......................................................................
iscsi: Move iscsi constatnts to the appropriate module
Change-Id: I75e383cfc26cbe0c6fcb124b6639f7664ad31e91
Signed-off-by: Yeela Kaplan <ykaplan(a)redhat.com>
---
M lib/vdsm/constants.py.in
M vdsm/storage/iscsi.py
2 files changed, 7 insertions(+), 11 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/25/14225/1
diff --git a/lib/vdsm/constants.py.in b/lib/vdsm/constants.py.in
index e7e2f83..94f4d92 100644
--- a/lib/vdsm/constants.py.in
+++ b/lib/vdsm/constants.py.in
@@ -147,10 +147,3 @@
EXT_WGET = '@WGET_PATH@'
EXT_WRITE_NET_CONFIG = '@VDSMDIR@/write-net-config'
-
-#
-# 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..1f8c9ab 100644
--- a/vdsm/storage/iscsi.py
+++ b/vdsm/storage/iscsi.py
@@ -45,6 +45,10 @@
ISCSI_DEFAULT_PORT = 3260
SCAN_PATTERN = "/sys/class/scsi_host/host*/scan"
+STRG_ISCSI_HOST = "iscsi_host/"
+STRG_SCSI_HOST = "scsi_host/"
+STRG_ISCSI_SESSION = "iscsi_session/"
+
IscsiSession = namedtuple("IscsiSession", "id, iface, target,
credentials")
_iscsiadmTransactionLock = RLock()
@@ -428,8 +432,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, STRG_ISCSI_HOST, host)
+ scsi_host = os.path.join(hostdir, STRG_SCSI_HOST, host)
proc_name = os.path.join(scsi_host, "proc_name")
return (os.path.exists(iscsi_host) and os.path.exists(proc_name))
@@ -439,8 +443,7 @@
device = os.path.realpath(os.path.join("/sys/block", dev,
"device"))
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 = os.path.join(sessiondir, STRG_ISCSI_SESSION + session)
with open(os.path.join(iscsi_session, "targetname")) as f:
return f.readline().strip()
--
To view, visit
http://gerrit.ovirt.org/14225
To unsubscribe, visit
http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I75e383cfc26cbe0c6fcb124b6639f7664ad31e91
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Yeela Kaplan <ykaplan(a)redhat.com>