Add error message, when run not on a tty
The library, which displays user interface, urwid, executes ioctl on stdin file descriptor, which works only on ttys. Let's report error, when we run not on a tty to make error investigation easier. Change-Id: I15e80f14f65f6467eca153dc2cd73c64751c9154 Partial-Bug: #1607402
This commit is contained in:
parent
1da4d4f45c
commit
03d32ae951
|
@ -384,6 +384,10 @@ def main(*args, **kwargs):
|
|||
setup(save_only=True,
|
||||
managed_iface=options.iface)
|
||||
else:
|
||||
if not os.isatty(sys.stdin.fileno()):
|
||||
print("Stdin is not a tty, can't run fuelmenu "
|
||||
"in interactive mode.")
|
||||
sys.exit(1)
|
||||
setup()
|
||||
|
||||
if '__main__' == __name__ or urwid.web_display.is_web_request():
|
||||
|
|
Loading…
Reference in New Issue