]> 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>
Wed, 27 May 2015 04:20:46 +0000 (12:20 +0800)
Fixes: #11279
Signed-off-by: Kefu Chai <kchai@redhat.com>
(cherry picked from commit bc7d8c99d2e16a141a8b575281ba12c67628dac3)

qa/workunits/cephtool/test.sh
src/ceph.in

index 906c89289038763fa58e31bb43690e5d63ad0637..1af5e4b5f695166df3036647e2faab8104a8db40 100755 (executable)
@@ -433,6 +433,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 53f808733373f85d99e9caeab1556185d0442634..017efbca9359051ed58f30c7a83222063b2c7e23 100755 (executable)
@@ -62,6 +62,7 @@ import argparse
 import errno
 import json
 import rados
+import shlex
 import signal
 import socket
 import string
@@ -424,7 +425,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: