diff options
author | Narayan Desai <desai@mcs.anl.gov> | 2006-06-07 02:11:39 +0000 |
---|---|---|
committer | Narayan Desai <desai@mcs.anl.gov> | 2006-06-07 02:11:39 +0000 |
commit | c9a504f286f1888040641810a33148ccbe5ccf6f (patch) | |
tree | a263f064e7ad4967acb4aa19e84daa0b3ae50807 /src/sbin | |
parent | b36e11a35e722cddeccfd1c4cd92a9d6dc623d7e (diff) | |
download | bcfg2-c9a504f286f1888040641810a33148ccbe5ccf6f.tar.gz bcfg2-c9a504f286f1888040641810a33148ccbe5ccf6f.tar.bz2 bcfg2-c9a504f286f1888040641810a33148ccbe5ccf6f.zip |
make bcfg2-info respect EOF (from Jos Backus)
git-svn-id: https://svn.mcs.anl.gov/repos/bcfg/trunk/bcfg2@1870 ce84e21b-d406-0410-9b95-82705330c041
Diffstat (limited to 'src/sbin')
-rwxr-xr-x | src/sbin/bcfg2-info | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/src/sbin/bcfg2-info b/src/sbin/bcfg2-info index cac465490..5703d2a5e 100755 --- a/src/sbin/bcfg2-info +++ b/src/sbin/bcfg2-info @@ -20,6 +20,9 @@ def getInput(): return raw_input('> ').split(" ") except KeyboardInterrupt: return [''] + except EOFError: + return [None] + def doShowentries(cmd, core): '''show abstract configuration entries for a given host''' if len(cmd) not in [2, 3]: @@ -175,8 +178,10 @@ if __name__ == '__main__': for i in range(25): bcore.fam.Service() time.sleep(0.5) - ucmd = getInput() while True: + ucmd = getInput() + if ucmd[0] == None: + ucmd[0] = 'quit' if ucmd[0] == 'debug': break else: @@ -188,5 +193,4 @@ if __name__ == '__main__': except: logger.error("command failure", exc_info=1) else: - print "Unknown command %s" % ucmd[0] - ucmd = getInput() + print "Unknown command: %s" % ucmd[0] |