]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
ceph-daemon: allow optional command for 'enter'
authorSage Weil <sage@redhat.com>
Wed, 23 Oct 2019 16:14:49 +0000 (11:14 -0500)
committerSage Weil <sage@redhat.com>
Wed, 23 Oct 2019 20:08:55 +0000 (15:08 -0500)
Default to interactive shell; otherwise run a specific command, just like
the 'shell' command.

Signed-off-by: Sage Weil <sage@redhat.com>
src/ceph-daemon

index ae2b853c9114cf1e21817ce9016aea0218e4410d..a5b67882e9e46f73c93840d04dac2ae5f1d51537 100755 (executable)
@@ -1105,7 +1105,7 @@ def command_shell():
 def command_enter():
     (daemon_type, daemon_id) = args.name.split('.')
     c = get_container(args.fsid, daemon_type, daemon_id)
-    subprocess.call(c.exec_cmd(['bash']))
+    subprocess.call(c.exec_cmd(args.command))
 
 ##################################
 
@@ -1458,6 +1458,10 @@ parser_enter.add_argument(
     '--name', '-n',
     required=True,
     help='daemon name (type.id)')
+parser_enter.add_argument(
+    'command', nargs='*',
+    default=['bash'],
+    help='command')
 
 parser_exec = subparsers.add_parser(
     'exec', help='run command inside a running daemon container')