[node-patches] Change in ovirt-node[ovirt-3.5]: installer: Harden wwid detection

fabiand at redhat.com fabiand at redhat.com
Mon Jan 5 11:41:32 UTC 2015


Fabian Deutsch has uploaded a new change for review.

Change subject: installer: Harden wwid detection
......................................................................

installer: Harden wwid detection

Change-Id: I19113f5953da774496f9dc4492b855b6f5938d33
Bug-Url: https://bugzilla.redhat.com/show_bug.cgi?id=1176058
Signed-off-by: Fabian Deutsch <fabiand at fedoraproject.org>
---
M src/ovirtnode/install.py
1 file changed, 8 insertions(+), 5 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-node refs/changes/76/36576/1

diff --git a/src/ovirtnode/install.py b/src/ovirtnode/install.py
index 5fea812..1afd94f 100755
--- a/src/ovirtnode/install.py
+++ b/src/ovirtnode/install.py
@@ -572,17 +572,20 @@
             I choose 2 because it seems to be less invasive.
             https://bugzilla.redhat.com/show_bug.cgi?id=1152948
             """
-            wwidcmd = "multipath -ll | egrep -o '^.*dm-[0-9]' | cut -d' ' -f1"
-            logger.debug("We are on el7, checking for multipath: %s" % wwidcmd)
+            wwidcmd = "multipath -ll %s | egrep -o '^.*dm-[0-9]' | cut -d' ' -f1" % self.disk
+            logger.debug("Checking device for multipath: %s" % wwidcmd)
             wwidproc = _functions.subprocess_closefds(wwidcmd, shell=True,
                                                       stdout=subprocess.PIPE,
                                                       stderr=subprocess.STDOUT)
             wwidout, wwiderr = wwidproc.communicate()
             logger.debug("multipath returned: %s -- %s" % (wwidout, wwiderr))
             wwid = wwidout.strip()
-            logger.debug("Using multipath wwid: %s" % wwid)
-            self.bootparams += " mpath.wwid=%s" % wwid
-            logger.debug("Cmdline with mpath: %s" % self.bootparams)
+            if wwid:
+                logger.debug("Using multipath wwid: %s" % wwid)
+                self.bootparams += " mpath.wwid=%s" % wwid
+                logger.debug("Cmdline with mpath: %s" % self.bootparams)
+            else:
+                logger.debug("Got NO multipath wwid, not using any")
 
         if " " in self.disk:
             # workaround for grub setup failing with spaces in dev.name:


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

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



More information about the node-patches mailing list