]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
ceph-daemon: drop exec
authorSage Weil <sage@redhat.com>
Wed, 23 Oct 2019 16:25:12 +0000 (11:25 -0500)
committerSage Weil <sage@redhat.com>
Wed, 23 Oct 2019 20:08:55 +0000 (15:08 -0500)
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 <sage@redhat.com>
qa/standalone/test_ceph_daemon.sh
src/ceph-daemon

index 1eb4611258d46459577fdf7e213332ec1733ae72..db624424e8067aa300e0532a577f19ef93c4bbdc 100755 (executable)
@@ -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
index b3af0fffad9f81f39670059b8f4e00bb69d2501a..51f607cb1d359bf41961009fefa03e6ab438fb3a 100755 (executable)
@@ -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)