[node-patches] Change in ovirt-node[master]: update is_auto_install to use /proc/cmdline

jboggs at redhat.com jboggs at redhat.com
Wed Nov 28 01:41:56 UTC 2012


Joey Boggs has uploaded a new change for review.

Change subject: update is_auto_install to use /proc/cmdline
......................................................................

update is_auto_install to use /proc/cmdline

rhbz#872115

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


  git pull ssh://gerrit.ovirt.org:29418/ovirt-node refs/changes/25/9525/1

diff --git a/scripts/ovirtnode/ovirtfunctions.py b/scripts/ovirtnode/ovirtfunctions.py
index a7035b6..f592a4f 100644
--- a/scripts/ovirtnode/ovirtfunctions.py
+++ b/scripts/ovirtnode/ovirtfunctions.py
@@ -230,10 +230,13 @@
 # for storage - OVIRT_INIT, local disk to use
 #       if ovirt_vol is not specified, default volume sizes are set
 def is_auto_install():
-    if OVIRT_VARS.has_key("OVIRT_BOOTIF") and OVIRT_VARS.has_key("OVIRT_INIT"):
-        return True
-    else:
-        return False
+    with open("/proc/cmdline") as cmdline:
+        for line in cmdline.readlines():
+            if "BOOTIF" in line:
+                if "storage_init" in line or "ovirt_init" in line:
+                    return True
+            else:
+                return False
 
 # return 0 if this is an upgrade
 # return 1 otherwise
@@ -924,7 +927,7 @@
     hookdir="/etc/ovirt-config-boot.d"
     for hook in os.listdir(hookdir):
         if not is_auto_install():
-            system_closefds(os.path.join(hookdir,hook))
+            system_closefds(os.path.join(hookdir,hook) + " &> /dev/null")
     for f in ["/etc/ssh/ssh_host%s_key" % t for t in ["", "_dsa", "_rsa"]]:
         ovirt_store_config(f)
         ovirt_store_config("%s.pub" % f)


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

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