]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
ceph.in: do not panic at control+d in interactive mode 18374/head
authorKefu Chai <kchai@redhat.com>
Wed, 18 Oct 2017 09:41:45 +0000 (17:41 +0800)
committerKefu Chai <kchai@redhat.com>
Wed, 18 Oct 2017 09:41:47 +0000 (17:41 +0800)
Signed-off-by: Kefu Chai <kchai@redhat.com>
src/ceph.in

index daec2993764504c0070fc58a98400962e95e0594..79bec56261dc05beb01557fc8aca1b310ed66f8a 100755 (executable)
@@ -539,7 +539,11 @@ def new_style_command(parsed_args, cmdargs, target, sigdict, inbuf, verbose):
                 import readline  # noqa
 
             while True:
-                interactive_input = read_input()
+                try:
+                    interactive_input = read_input()
+                except EOFError:
+                    # leave user an uncluttered prompt
+                    return 0, '\n', ''
                 if interactive_input is None:
                     return 0, '', ''
                 cmdargs = parse_cmdargs(shlex.split(interactive_input))[2]