From 86b2c8dd604904472baf3bf808b297297454da98 Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Wed, 23 Oct 2019 11:25:12 -0500 Subject: [PATCH] ceph-daemon: drop exec It's not identical to enter. enter seems more intuitive to me, but that may be because I'm not a longtime docker user. Signed-off-by: Sage Weil --- qa/standalone/test_ceph_daemon.sh | 22 +++++++++++----------- src/ceph-daemon | 27 --------------------------- 2 files changed, 11 insertions(+), 38 deletions(-) diff --git a/qa/standalone/test_ceph_daemon.sh b/qa/standalone/test_ceph_daemon.sh index 1eb4611258d..db624424e80 100755 --- a/qa/standalone/test_ceph_daemon.sh +++ b/qa/standalone/test_ceph_daemon.sh @@ -64,16 +64,16 @@ for u in ceph.target \ done systemctl | grep system-ceph | grep -q .slice # naming is escaped and annoying +# check ceph -s works (via shell w/ passed config/keyring) +$SUDO $CEPH_DAEMON shell --fsid $FSID --config $CONFIG --keyring $KEYRING -- \ + ceph -s | grep $FSID + ## ls $SUDO $CEPH_DAEMON ls | jq '.[]' | jq 'select(.name == "mon.a").fsid' \ | grep $FSID $SUDO $CEPH_DAEMON ls | jq '.[]' | jq 'select(.name == "mgr.x").fsid' \ | grep $FSID -## exec (and ceph -s works) -$SUDO $CEPH_DAEMON exec --fsid $FSID -n mon.a -- \ - ceph -k /var/lib/ceph/mon/ceph-a/keyring -n mon. -s | grep $FSID - ## deploy # add mon.b $SUDO $CEPH_DAEMON --image $IMAGE deploy --name mon.b \ @@ -87,9 +87,8 @@ for u in ceph-$FSID@mon.b; do done # add mgr.y -$SUDO $CEPH_DAEMON exec --fsid $FSID -n mon.a -- \ - ceph -k /var/lib/ceph/mon/ceph-a/keyring -n mon. \ - auth get-or-create mgr.y \ +$SUDO $CEPH_DAEMON shell --fsid $FSID --config $CONFIG --keyring $KEYRING -- \ + ceph auth get-or-create mgr.y \ mon 'allow profile mgr' \ osd 'allow *' \ mds 'allow *' > $TMPDIR/keyring.mgr.y @@ -102,13 +101,14 @@ for u in ceph-$FSID@mgr.y; do systemctl is-active $u done for f in `seq 1 30`; do - if $SUDO $CEPH_DAEMON exec --fsid $FSID -n mon.a -- \ - ceph -k /var/lib/ceph/mon/ceph-a/keyring -n mon. -s -f json-pretty \ + if $SUDO $CEPH_DAEMON shell --fsid $FSID \ + --config $CONFIG --keyring $KEYRING -- \ + ceph -s -f json-pretty \ | jq '.mgrmap.num_standbys' | grep -q 1 ; then break; fi sleep 1 done -$SUDO $CEPH_DAEMON exec --fsid $FSID -n mon.a -- \ - ceph -k /var/lib/ceph/mon/ceph-a/keyring -n mon. -s -f json-pretty \ +$SUDO $CEPH_DAEMON shell --fsid $FSID --config $CONFIG --keyring $KEYRING -- \ + ceph -s -f json-pretty \ | jq '.mgrmap.num_standbys' | grep -q 1 ## run diff --git a/src/ceph-daemon b/src/ceph-daemon index b3af0fffad9..51f607cb1d3 100755 --- a/src/ceph-daemon +++ b/src/ceph-daemon @@ -1109,14 +1109,6 @@ def command_enter(): ################################## -def command_exec(): - (daemon_type, daemon_id) = args.name.split('.') - c = get_container(args.fsid, daemon_type, daemon_id, - privileged=args.privileged) - return subprocess.call(c.exec_cmd(args.command)) - -################################## - def command_ceph_volume(): make_log_dir(args.fsid) @@ -1463,25 +1455,6 @@ parser_enter.add_argument( default=['bash'], help='command') -parser_exec = subparsers.add_parser( - 'exec', help='run command inside a running daemon container') -parser_exec.set_defaults(func=command_exec) -parser_exec.add_argument( - '--fsid', - required=True, - help='cluster FSID') -parser_exec.add_argument( - '--name', '-n', - required=True, - help='daemon name (type.id)') -parser_exec.add_argument( - '--privileged', - action='store_true', - help='use a privileged container') -parser_exec.add_argument( - 'command', nargs='+', - help='command') - parser_ceph_volume = subparsers.add_parser( 'ceph-volume', help='run ceph-volume inside a container') parser_ceph_volume.set_defaults(func=command_ceph_volume) -- 2.39.5