From: Joao Eduardo Luis Date: Mon, 17 Mar 2014 14:37:09 +0000 (+0000) Subject: ceph.in: do not allow using 'tell' with interactive mode X-Git-Tag: v0.78~9^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F1482%2Fhead;p=ceph.git ceph.in: do not allow using 'tell' with interactive mode This avoids a lot of hassle when dealing with to whom tell each command on interactive mode, and even more so if multiple targets are specified. As so, 'tell' commands should be used while on interactive mode instead. Backport: dumpling,emperor Signed-off-by: Joao Eduardo Luis --- diff --git a/src/ceph.in b/src/ceph.in index c1f5a84c48e..0978882d8c1 100755 --- a/src/ceph.in +++ b/src/ceph.in @@ -705,8 +705,15 @@ def main(): # Repulsive hack to handle tell: lop off 'tell' and target # and validate the rest of the command. 'target' is already # determined in our callers, so it's ok to remove it here. + is_tell = False if len(childargs) and childargs[0] == 'tell': childargs = childargs[2:] + is_tell = True + + if is_tell and not len(childargs): + print >> sys.stderr, \ + 'Cannot use \'tell\' with interactive mode' + return errno.EINVAL # fetch JSON sigs from command # each line contains one command signature (a placeholder name