From: Sage Weil Date: Wed, 23 Oct 2019 16:14:49 +0000 (-0500) Subject: ceph-daemon: allow optional command for 'enter' X-Git-Tag: v15.1.0~1179^2~4 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=c475186856fc17dbadf3e6f8056c246c7d4a73f0;p=ceph.git ceph-daemon: allow optional command for 'enter' Default to interactive shell; otherwise run a specific command, just like the 'shell' command. Signed-off-by: Sage Weil --- diff --git a/src/ceph-daemon b/src/ceph-daemon index ae2b853c911..a5b67882e9e 100755 --- a/src/ceph-daemon +++ b/src/ceph-daemon @@ -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')