]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
ceph.in: parse quote correctly in interactive mode
authorKefu Chai <kchai@redhat.com>
Thu, 23 Apr 2015 16:50:37 +0000 (00:50 +0800)
committerKefu Chai <kchai@redhat.com>
Fri, 24 Apr 2015 07:25:30 +0000 (15:25 +0800)
Fixes: #11279
Signed-off-by: Kefu Chai <kchai@redhat.com>
qa/workunits/cephtool/test.sh
src/ceph.in

index fab48b53ce7d2f3e5d86d54f227fffd4e7b62a11..594c80cccc6ded4cfb1d18ddc1d265330d113a3b 100755 (executable)
@@ -441,6 +441,13 @@ function test_auth()
   diff authfile authfile2
   rm authfile authfile2
   ceph auth del client.xx
+  expect_false ceph auth get client.xx
+
+  # (almost) interactive mode
+  echo -e 'auth add client.xx mon allow osd "allow *"\n' | ceph
+  ceph auth get client.xx
+  ceph auth del client.xx
+
   #
   # get / set auid
   #
index 40a6fdcda30c63f160b44bc229f37132d1a501fc..a56046c360d81e00839eaaaf1a75e5257c8d01c7 100755 (executable)
@@ -62,6 +62,7 @@ import argparse
 import errno
 import json
 import rados
+import shlex
 import signal
 import socket
 import string
@@ -372,7 +373,7 @@ def new_style_command(parsed_args, cmdargs, target, sigdict, inbuf, verbose):
                 interactive_input = raw_input(prompt)
                 if interactive_input in ['q', 'quit', 'Q']:
                     return 0, '', ''
-                cmdargs = parse_cmdargs(interactive_input.split())[2]
+                cmdargs = parse_cmdargs(shlex.split(interactive_input))[2]
                 try:
                     target = find_cmd_target(cmdargs)
                 except Exception as e: