[Ovirt-devel] [PATCH] block manual setup runs when dropped to shell

Joey Boggs jboggs at redhat.com
Tue Aug 30 19:20:46 UTC 2011


rhbz#733589

Signed-off-by: Joey Boggs <jboggs at redhat.com>
---
 scripts/ovirt-config-setup.py |    7 +++++--
 scripts/ovirtfunctions.py     |    9 +++++++++
 2 files changed, 14 insertions(+), 2 deletions(-)

diff --git a/scripts/ovirt-config-setup.py b/scripts/ovirt-config-setup.py
index 09c21ec..00df6fa 100755
--- a/scripts/ovirt-config-setup.py
+++ b/scripts/ovirt-config-setup.py
@@ -1661,8 +1661,11 @@ if __name__ == "__main__":
         print "Unable to run setup in rescue mode"
         sys.exit(1)
     elif is_booted_from_local_disk() or "--force" in sys.argv:
-        screen = NodeConfigScreen()
-        screen.start()
+        if manual_setup and "--force" not in sys.argv:
+            print "Unable to run setup manually, Run \"exit\" to return to setup"
+        else:
+            screen = NodeConfigScreen()
+            screen.start()
     else:
         print "Setup must be run after installation and reboot"
         sys.exit(1)
diff --git a/scripts/ovirtfunctions.py b/scripts/ovirtfunctions.py
index 1bacb3f..09facaf 100644
--- a/scripts/ovirtfunctions.py
+++ b/scripts/ovirtfunctions.py
@@ -191,6 +191,15 @@ def is_rescue_mode():
             return True
         return False
 
+def manual_setup():
+    manual_cmd = "ps -ed|grep ovirt-admin"
+    manual = subprocess.Popen(manual_cmd, shell=True, stdout=PIPE, stderr=STDOUT)
+    manual_output = manual.stdout.read().strip()
+    if len(manual_output):
+        return True
+    else:
+        return False
+
 # was firstboot menu already shown?
 # state is stored in persistent config partition
 def is_firstboot():
-- 
1.7.6




More information about the ovirt-devel mailing list