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 <kiefer.chang@suse.com>
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