[node-patches] Change in ovirt-node[master]: installer: filter out live device that uses multipath

jboggs at redhat.com jboggs at redhat.com
Fri Aug 17 01:20:44 UTC 2012


Joey Boggs has uploaded a new change for review.

Change subject: installer: filter out live device that uses multipath
......................................................................

installer: filter out live device that uses multipath

rhbz#834207

Change-Id: Ibf9606f553bf93d1de15eb19a96fc8b99ec3ffc5
Signed-off-by: Joey Boggs <jboggs at redhat.com>
---
M scripts/ovirt-config-installer.py
M scripts/ovirtnode/ovirtfunctions.py
2 files changed, 10 insertions(+), 6 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-node refs/changes/80/7280/1

diff --git a/scripts/ovirt-config-installer.py b/scripts/ovirt-config-installer.py
index 67d586f..9cad91a 100644
--- a/scripts/ovirt-config-installer.py
+++ b/scripts/ovirt-config-installer.py
@@ -131,7 +131,9 @@
         self.current_password_fail = 0
         self.failed_block_dev = 0
         self.failed_install = False
-        self.live_disk = "/dev/" + get_live_disk().rstrip('0123456789')
+        self.live_disk = get_live_disk()
+        if not "/dev/mapper" in self.live_disk:
+            self.live_disk = "/dev/" + get_live_disk().rstrip('0123456789')
         logger.info("::::live device::::\n" + self.live_disk)
     def set_console_colors(self):
         self.existing_color_array = None
diff --git a/scripts/ovirtnode/ovirtfunctions.py b/scripts/ovirtnode/ovirtfunctions.py
index 8b0b9f3..2e0d361 100644
--- a/scripts/ovirtnode/ovirtfunctions.py
+++ b/scripts/ovirtnode/ovirtfunctions.py
@@ -833,13 +833,15 @@
 def get_live_disk():
     live_disk=""
     if os.path.exists("/dev/live"):
-        live_disk = os.path.dirname(udev_info("/dev/live","path"))
-        if "block" in live_disk:
-            live_disk = os.path.basename(udev_info("/dev/live","path")).strip()
+        d = "/dev/live"
     elif os.path.exists("/dev/disk/by-label/LIVE"):
-        live_disk = os.path.dirname(udev_info("/dev/disk/by-label/LIVE","path"))
+        d = "/dev/disk/by-label/LIVE"
+        live_disk = os.path.dirname(udev_info(d,"path"))
         if "block" in live_disk:
-            live_disk = os.path.basename(udev_info("/dev/disk/by-label/LIVE","path")).strip()
+            live_disk = os.path.basename(udev_info(d,"path")).strip()
+            # if dm-XX, not enough detail to map correctly
+            if "dm-" in live_disk:
+                live_disk = findfs("LIVE")[:-2]
     else:
         ret = system_closefds("losetup /dev/loop0|grep -q '\.iso'")
         if ret != 0:


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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ibf9606f553bf93d1de15eb19a96fc8b99ec3ffc5
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-node
Gerrit-Branch: master
Gerrit-Owner: Joey Boggs <jboggs at redhat.com>



More information about the node-patches mailing list