]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
stop.sh: call cephadm rm-cluster only if FSID is not empty
authorKefu Chai <tchaikov@gmail.com>
Fri, 21 Oct 2022 17:11:31 +0000 (01:11 +0800)
committerKefu Chai <tchaikov@gmail.com>
Fri, 21 Oct 2022 17:24:32 +0000 (01:24 +0800)
there are chances that there is no cluster running at that moment,
so we could have failure messages like

[errno 2] RADOS object not found (error connecting to the cluster)
usage: cephadm rm-cluster [-h] --fsid FSID [--force] [--keep-logs]
                          [--zap-osds]
cephadm rm-cluster: error: argument --fsid: expected one argument

in that case, better off not failing this bash function, as this
is not a fatal failure.

See-also: https://tracker.ceph.com/issues/57834
Signed-off-by: Kefu Chai <tchaikov@gmail.com>
src/stop.sh

index dce34b6513f1bdfae3e73985873dcd958dd12575..6cab228ef7b3b9ff9201876ab1f20908c127d0b7 100755 (executable)
@@ -77,8 +77,10 @@ maybe_kill() {
 }
 
 do_killcephadm() {
-    FSID=$($CEPH_BIN/ceph -c $conf_fn fsid)
-    sudo $CEPHADM rm-cluster --fsid $FSID --force
+    local FSID=$($CEPH_BIN/ceph -c $conf_fn fsid)
+    if [ -n "$FSID" ]; then
+        sudo $CEPHADM rm-cluster --fsid $FSID --force
+    fi
 }
 
 do_umountall() {