[node-patches] Change in ovirt-node[master]: Disable the TUI in rescue mode

fabiand at fedoraproject.org fabiand at fedoraproject.org
Fri Aug 16 09:27:36 UTC 2013


Fabian Deutsch has posted comments on this change.

Change subject: Disable the TUI in rescue mode
......................................................................


Patch Set 2:

(2 comments)

....................................................
File src/ovirt/node/app.py
Line 296:         self.ui.header = "\n %s\n" % str(self.product)
Line 297:         self.ui.footer = "Press esc to quit."
Line 298: 
Line 299:         try:
Line 300:             if "rescue" in open("/proc/cmdline").read().split():
I'd suggest moving this functionality into e.g. system.is_rescue_mode() - this has the benefit of allowing to reuse this functionality.
Line 301:                 import sys
Line 302:                 print "The TUI cannot be used in rescue mode. Please "\
Line 303:                       "reboot without rescue to configure/install."
Line 304:                 sys.exit(0)


Line 299:         try:
Line 300:             if "rescue" in open("/proc/cmdline").read().split():
Line 301:                 import sys
Line 302:                 print "The TUI cannot be used in rescue mode. Please "\
Line 303:                       "reboot without rescue to configure/install."
I'd use the logger here. E.g. with logger.error() this has the benefit that the message is shown on the screen and written to the logfile - this has the benefit that it's obvious when looking at a logfile that it was generated in rescue mode.

I'd also pull this functionality further up. Like at the beginning of this function - but that's just something minor.
Line 304:                 sys.exit(0)
Line 305:             self.ui.run()
Line 306:         except Exception as e:
Line 307:             if self.args.debug:


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

Gerrit-MessageType: comment
Gerrit-Change-Id: Ie1f9d6fbd944cd9c86b7ae85e031477d7184f868
Gerrit-PatchSet: 2
Gerrit-Project: ovirt-node
Gerrit-Branch: master
Gerrit-Owner: Ryan Barry <rbarry at redhat.com>
Gerrit-Reviewer: Fabian Deutsch <fabiand at fedoraproject.org>
Gerrit-Reviewer: Michael Burns <mburns at redhat.com>
Gerrit-Reviewer: oVirt Jenkins CI Server
Gerrit-HasComments: Yes



More information about the node-patches mailing list