Skip to content

Commit

Permalink
ceph.in: parse quote correctly in interactive mode
Browse files Browse the repository at this point in the history
Fixes: #11279
Signed-off-by: Kefu Chai <kchai@redhat.com>
(cherry picked from commit bc7d8c9)
  • Loading branch information
tchaikov committed May 27, 2015
1 parent 63832d4 commit eb26388
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
7 changes: 7 additions & 0 deletions qa/workunits/cephtool/test.sh
Expand Up @@ -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
#
Expand Down
3 changes: 2 additions & 1 deletion src/ceph.in
Expand Up @@ -62,6 +62,7 @@ import argparse
import errno
import json
import rados
import shlex
import signal
import socket
import string
Expand Down Expand Up @@ -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:
Expand Down

0 comments on commit eb26388

Please sign in to comment.