[node-patches] Change in ovirt-node[master]: Update reboot task to run async from installer and install m...

fabiand at fedoraproject.org fabiand at fedoraproject.org
Tue May 28 14:19:02 UTC 2013


Fabian Deutsch has posted comments on this change.

Change subject: Update reboot task to run async from installer and install module
......................................................................


Patch Set 3: I would prefer that you didn't submit this

(3 inline comments)

I'd suggest to introduce a new method e.g. async_reboot(delay) to handle delayed reboots.

....................................................
File src/ovirt/node/installer/progress_page.py
Line 69:         pass
Line 70: 
Line 71:     def on_merge(self, effective_changes):
Line 72:         if "action.reboot" in effective_changes:
Line 73:             utils.system.reboot(3)
see the other page
Line 74: 
Line 75: 
Line 76: class InstallerThread(threading.Thread):
Line 77:     ui_thread = None


....................................................
File src/ovirt/node/setup/status_page.py
Line 142:             self.application.quit()
Line 143: 
Line 144:         elif "action.restart" in changes:
Line 145:             self.logger.info("Restarting")
Line 146:             self.dry_or(lambda: system.reboot(3))
You should use system.async_reboot(), the default value can also be set there
Line 147: 
Line 148:         elif "action.poweroff" in changes:
Line 149:             self.logger.info("Shutting down")
Line 150:             self.dry_or(lambda: system.poweroff())


....................................................
File src/ovirt/node/utils/system.py
Line 40:     try:
Line 41:         import daemon
Line 42:         reboot_task.rebootDaemon(delay)
Line 43:     except:
Line 44:         reboot_task.reboot(delay)
As said in my last comment,

I'd suggest to have another function e.g. reboot_async(delay) for a delayed reboot.
reboot() should be a very simplistic wrapper around reboot ...
Line 45: 
Line 46: def poweroff():
Line 47:     """Poweroff the system
Line 48:     """


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

Gerrit-MessageType: comment
Gerrit-Change-Id: Ic1b4e048ff56b8c9ebd49a82b3d5546c7c326df8
Gerrit-PatchSet: 3
Gerrit-Project: ovirt-node
Gerrit-Branch: master
Gerrit-Owner: Joey Boggs <jboggs at redhat.com>
Gerrit-Reviewer: Fabian Deutsch <fabiand at fedoraproject.org>
Gerrit-Reviewer: Joey Boggs <jboggs at redhat.com>



More information about the node-patches mailing list