[node-patches] Change in ovirt-node[master]: Try to translate candidate_dev

rbarry at redhat.com rbarry at redhat.com
Thu Oct 30 18:07:10 UTC 2014


Ryan Barry has uploaded a new change for review.

Change subject: Try to translate candidate_dev
......................................................................

Try to translate candidate_dev

Don't assume findfs is returning the right disk, it may not be

Change-Id: Ie6fd6a02f66c1032897bf2877f9248523275bab5
Bug-Url: https://bugzilla.redhat.com/show_bug.cgi?id=1158044
Signed-off-by: Ryan Barry <rbarry at redhat.com>
---
M src/ovirtnode/install.py
1 file changed, 12 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-node refs/changes/81/34681/1

diff --git a/src/ovirtnode/install.py b/src/ovirtnode/install.py
index 94caf5b..d0fb948 100755
--- a/src/ovirtnode/install.py
+++ b/src/ovirtnode/install.py
@@ -22,6 +22,7 @@
 import ovirtnode.iscsi as _iscsi
 import shutil
 import traceback
+import glob
 import os
 import stat
 import subprocess
@@ -451,6 +452,17 @@
 
         try:
             candidate_dev = self.disk = _functions.findfs(candidate)
+            new_dev = _functions.translate_multipath_device(re.sub(
+                r'(.*?)p?\d$', r'\1', candidate_dev))
+            part_number = candidate_dev[-1:]
+            translated_disk = glob.glob(new_dev + "*" + part_number)[0]
+
+            logger.info("Translated disk: %s" % new_dev)
+            logger.info("Translated partition: %s" % translated_disk)
+
+            candidate_dev = candidate_dev if candidate_dev == translated_disk \
+                else translated_disk
+
             logger.info("Candidate device: %s" % candidate_dev)
             logger.info("Candidate disk: %s" % self.disk)
             # grub2 starts at part 1


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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ie6fd6a02f66c1032897bf2877f9248523275bab5
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-node
Gerrit-Branch: master
Gerrit-Owner: Ryan Barry <rbarry at redhat.com>



More information about the node-patches mailing list