[node-patches] Change in ovirt-node[ovirt-3.5]: Correct path for non-mpath cciss devices

fabiand at redhat.com fabiand at redhat.com
Mon Jan 5 09:48:32 UTC 2015


Hello Anatoly Litovsky,

I'd like you to do a code review.  Please visit

    http://gerrit.ovirt.org/36562

to review the following change.

Change subject: Correct path for non-mpath cciss devices
......................................................................

Correct path for non-mpath cciss devices

Previously an incorrect device path was returned for non-multipathed
cciss devices.
Now the correct path is returned.

Bug-Url: https://bugzilla.redhat.com/show_bug.cgi?id=1174146
Change-Id: I362e6baa05b080e0ade6c784b436006cfb48c08b
Signed-off-by: Tolik Litovsky <tlitovsk at redhat.com>
---
M src/ovirtnode/ovirtfunctions.py
1 file changed, 3 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-node refs/changes/62/36562/1

diff --git a/src/ovirtnode/ovirtfunctions.py b/src/ovirtnode/ovirtfunctions.py
index 8ab7b12..c067a6b 100644
--- a/src/ovirtnode/ovirtfunctions.py
+++ b/src/ovirtnode/ovirtfunctions.py
@@ -1450,6 +1450,7 @@
 def translate_multipath_device(dev):
     #trim so that only sdX is stored, but support passing /dev/sdX
     logger.debug("Translating: %s" % dev)
+    multipath_dev = dev
     if dev is None:
         return False
     if "/dev/mapper" in dev:
@@ -1458,8 +1459,8 @@
         cciss_dev_cmd = "cciss_id " + dev
         cciss_dev = subprocess_closefds(cciss_dev_cmd, shell=True, stdout=PIPE, stderr=STDOUT)
         output, err = cciss_dev.communicate()
-        dev = "/dev/mapper/" + output.strip()
-    dm_dev_cmd = "multipath -ll '%s' | egrep dm-[0-9]+" % dev
+        multipath_dev = "/dev/mapper/" + output.strip()
+    dm_dev_cmd = "multipath -ll '%s' | egrep dm-[0-9]+" % multipath_dev
     dm_dev = subprocess_closefds(dm_dev_cmd, shell=True, stdout=PIPE, stderr=STDOUT)
     (dm_dev_output, dummy) = dm_dev.communicate()
     if dm_dev.returncode > 0:


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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I362e6baa05b080e0ade6c784b436006cfb48c08b
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-node
Gerrit-Branch: ovirt-3.5
Gerrit-Owner: Fabian Deutsch <fabiand at redhat.com>
Gerrit-Reviewer: Anatoly Litovsky <tlitovsk at redhat.com>
Gerrit-Reviewer: Fabian Deutsch <fabiand at redhat.com>



More information about the node-patches mailing list