[node-patches] Change in ovirt-node[master]: add reboot option to ovirt_boot_setup

mburns at redhat.com mburns at redhat.com
Wed Sep 5 18:27:09 UTC 2012


Michael Burns has uploaded a new change for review.

Change subject: add reboot option to ovirt_boot_setup
......................................................................

add reboot option to ovirt_boot_setup

This will allow in place upgrades to trigger reboots automatically.

Change-Id: I50f2aa3afc61819602d3cf61f9d54890b27ad15e
Signed-off-by: Mike Burns <mburns at redhat.com>
---
M scripts/ovirtnode/install.py
1 file changed, 9 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-node refs/changes/77/7777/1

diff --git a/scripts/ovirtnode/install.py b/scripts/ovirtnode/install.py
index f9ab970..f67b5d5 100755
--- a/scripts/ovirtnode/install.py
+++ b/scripts/ovirtnode/install.py
@@ -240,7 +240,7 @@
             logger.info("Grub2 Install Completed")
             return True
 
-    def ovirt_boot_setup(self):
+    def ovirt_boot_setup(self, reboot="N"):
         self.generate_paths()
         logger.info("Installing the image.")
 
@@ -484,6 +484,14 @@
             _iscsi.iscsi_auto()
             logger.info("Installation of %s Completed" % \
                                                       _functions.PRODUCT_SHORT)
+            if reboot is not None and reboot="Y":
+                f = open('/var/spool/cron/root', 'w')
+                f.write('* * * * * sleep 10 && /sbin/reboot')
+                f.close()
+                #ensure crond is started
+                subprocess_closefds("crond", shell=True, 
+                                    stdout=subprocess.PIPE,
+                                    stderr=subprocess.STDOUT)
             return True
         else:
             return False


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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I50f2aa3afc61819602d3cf61f9d54890b27ad15e
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-node
Gerrit-Branch: master
Gerrit-Owner: Michael Burns <mburns at redhat.com>



More information about the node-patches mailing list