Merge "Add error message, when run not on a tty"

This commit is contained in:
Jenkins 2016-09-29 08:07:44 +00:00 committed by Gerrit Code Review
commit 2d78ada592
1 changed files with 4 additions and 0 deletions

View File

@ -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():