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: ceph#11279
Signed-off-by: Kefu Chai <[email protected]>
  • Loading branch information
tchaikov committed Apr 24, 2015
1 parent 66e90d0 commit bc7d8c9
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
Original file line number Diff line number Diff line change
Expand Up @@ -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
#
Expand Down
3 changes: 2 additions & 1 deletion src/ceph.in
Original file line number Diff line number Diff line change
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 @@ -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:
Expand Down

0 comments on commit bc7d8c9

Please sign in to comment.