[node-patches] Change in ovirt-node[master]: pxe should override detection in get_live_disk

jboggs at redhat.com jboggs at redhat.com
Tue Dec 4 15:40:41 UTC 2012


Joey Boggs has uploaded a new change for review.

Change subject: pxe should override detection in get_live_disk
......................................................................

pxe should override detection in get_live_disk

rhbz#882846

Change-Id: I180419a8c2f3dfe5935b0c2414aa51ea9f3c9bd5
Signed-off-by: Joey Boggs <jboggs at redhat.com>
---
M scripts/ovirtnode/ovirtfunctions.py
1 file changed, 16 insertions(+), 14 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-node refs/changes/09/9709/1

diff --git a/scripts/ovirtnode/ovirtfunctions.py b/scripts/ovirtnode/ovirtfunctions.py
index 3a226e9..33842a2 100644
--- a/scripts/ovirtnode/ovirtfunctions.py
+++ b/scripts/ovirtnode/ovirtfunctions.py
@@ -888,21 +888,23 @@
             # 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:
+        client = gudev.Client(['block'])
+        version = open("/etc/default/version")
+        for line in version.readlines():
+            if "PACKAGE" in line:
+                pkg, pkg_name = line.split("=")
+        for device in client.query_by_subsystem("block"):
+            if device.has_property("ID_CDROM"):
+                dev = device.get_property("DEVNAME")
+                blkid_cmd = "blkid '%s'|grep -q '%s' " % (dev, pkg_name)
+                ret = system_closefds(blkid_cmd)
+                if ret == 0:
+                    live_disk = os.path.basename(dev)
     else:
-        ret = system_closefds("losetup /dev/loop0|grep -q '\.iso'")
-        if ret != 0:
-            client = gudev.Client(['block'])
-            version = open("/etc/default/version")
-            for line in version.readlines():
-                if "PACKAGE" in line:
-                    pkg, pkg_name = line.split("=")
-            for device in client.query_by_subsystem("block"):
-                if device.has_property("ID_CDROM"):
-                    dev = device.get_property("DEVNAME")
-                    blkid_cmd = "blkid '%s'|grep -q '%s' " % (dev, pkg_name)
-                    ret = system_closefds(blkid_cmd)
-                    if ret == 0:
-                        live_disk = os.path.basename(dev)
+        live_disk=""
     return live_disk
 
 # reboot wrapper


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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I180419a8c2f3dfe5935b0c2414aa51ea9f3c9bd5
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