From: Kefu Chai Date: Thu, 23 Apr 2015 16:50:37 +0000 (+0800) Subject: ceph.in: parse quote correctly in interactive mode X-Git-Tag: v9.0.2~194^2~2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=bc7d8c99d2e16a141a8b575281ba12c67628dac3;p=ceph.git ceph.in: parse quote correctly in interactive mode Fixes: #11279 Signed-off-by: Kefu Chai --- diff --git a/qa/workunits/cephtool/test.sh b/qa/workunits/cephtool/test.sh index fab48b53ce7d2..594c80cccc6de 100755 --- a/qa/workunits/cephtool/test.sh +++ b/qa/workunits/cephtool/test.sh @@ -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 # diff --git a/src/ceph.in b/src/ceph.in index 40a6fdcda30c6..a56046c360d81 100755 --- a/src/ceph.in +++ b/src/ceph.in @@ -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: