From: Kiefer Chang Date: Thu, 18 Jun 2020 07:42:50 +0000 (+0800) Subject: stop.sh: do not block script when there is no running cluster X-Git-Tag: wip-pdonnell-testing-20200918.022351~957^2 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=9884b9313db506a35b4e49d46c754965d90476ed;p=ceph-ci.git stop.sh: do not block script when there is no running cluster A query for current fsid is called inside `do_killcephadm`. This blocks the script when there is no running cluster. The fix avoids entering the function if cephadm command fails or returns no daemons. The change also hides the following output for non-cephadm environments: ``` Unable to locate any of ['podman', 'docker'] ``` Fixes: https://tracker.ceph.com/issues/46067 Signed-off-by: Kiefer Chang --- diff --git a/src/stop.sh b/src/stop.sh index 7af7908a5ab..4afc7bcdbe3 100755 --- a/src/stop.sh +++ b/src/stop.sh @@ -156,7 +156,8 @@ if [ $stop_all -eq 1 ]; then fi fi - if [ "$($CEPHADM_DIR_PATH/cephadm ls)" != "[]" ]; then + daemons="$($CEPHADM_DIR_PATH/cephadm ls 2> /dev/null)" + if [ $? -eq 0 -a "$daemons" != "[]" ]; then do_killcephadm fi