]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
ceph: Fix `tell` for cephadm
authorSebastian Wagner <sebastian.wagner@suse.com>
Fri, 17 Jul 2020 10:50:07 +0000 (12:50 +0200)
committerSebastian Wagner <sebastian.wagner@suse.com>
Thu, 23 Jul 2020 13:20:10 +0000 (15:20 +0200)
The tell target might contain dots now. Like
`mds.myfs.myhost.rnusmq` is now a valid
target.

Fixes: https://tracker.ceph.com/issues/46560
Signed-off-by: Sebastian Wagner <sebastian.wagner@suse.com>
(cherry picked from commit d5b8e3d61cd42d23857d7066660e03aecc89d9ce)

src/ceph.in

index 13929a4cca8d1610527495711b3db56ec24ca224..44a32bcd60646a0b74ae466d329017313a27be20 100755 (executable)
@@ -1041,7 +1041,7 @@ def main():
     if parsed_args.help:
         target = None
         if len(childargs) >= 2 and childargs[0] == 'tell':
-            target = childargs[1].split('.')
+            target = childargs[1].split('.', 1)
             if not validate_target(target):
                 print('target {0} doesn\'t exist; please pass correct target to tell command (e.g., mon.a, osd.1, mds.a, mgr)'.format(childargs[1]), file=sys.stderr)
                 return 1
@@ -1057,7 +1057,7 @@ def main():
 
     # implement "tell service.id help"
     if len(childargs) >= 3 and childargs[0] == 'tell' and childargs[2] == 'help':
-        target = childargs[1].split('.')
+        target = childargs[1].split('.', 1)
         if validate_target(target):
             hdr('Tell %s commands' % target[0])
             return do_extended_help(parser, childargs, target, None)