]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
ceph.in: do not allow using 'tell' with interactive mode
authorJoao Eduardo Luis <joao.luis@inktank.com>
Mon, 17 Mar 2014 14:37:09 +0000 (14:37 +0000)
committerSage Weil <sage@inktank.com>
Mon, 17 Mar 2014 15:27:40 +0000 (08:27 -0700)
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 <joao.luis@inktank.com>
(cherry picked from commit e39c213c1d230271d23b74086664c2082caecdb9)

src/ceph.in

index 1e7315a6c74856d9f2f76b144d1086e505e26789..ada451ba2f9f1de29c28b923fb924d273bc3b7ca 100755 (executable)
@@ -659,8 +659,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