diff --git a/docker/pypi/wmagent/bin/manage-common.sh b/docker/pypi/wmagent/bin/manage-common.sh index 64fe3720c..2413a1725 100644 --- a/docker/pypi/wmagent/bin/manage-common.sh +++ b/docker/pypi/wmagent/bin/manage-common.sh @@ -225,10 +225,7 @@ _couch_db_isclean(){ echo "$FUNCNAME: Checking if local CouchDB is empty (curl to wmagent_summary db name)" agent_summary=$(curl -s -u "$COUCH_USER:$COUCH_PASS" http://$COUCH_HOST:$COUCH_PORT/wmagent_summary) - if ! type jq > /dev/null ; then - echo "$FUNCNAME: jq is not installed, we cannot check if CouchDB is empty. Skipping this step." - return $(true) - fi + type jq > /dev/null || { echo "$FUNCNAME: jq is not installed, we cannot check if CouchDB is empty. Skipping this step."; return $(true); } agent_summary_notclean=$(jq "select(.doc_count > 1 or .doc_del_count > 0)" <<< $agent_summary) if [ -n "${agent_summary_notclean}" ]; then diff --git a/docker/pypi/wmagent/init.sh b/docker/pypi/wmagent/init.sh index 46e78bde0..3ea9cd018 100755 --- a/docker/pypi/wmagent/init.sh +++ b/docker/pypi/wmagent/init.sh @@ -315,6 +315,7 @@ check_databases() { esac # Checking CouchDB: + couchdbCred=false [[ -n $COUCH_HOST ]] && [[ -n $COUCH_PORT ]] && [[ -n $COUCH_USER ]] && [[ -n $COUCH_PASS ]] && couchdbCred=true $couchdbCred || { echo "$FUNCNAME: ERROR: No local CouchDB credentials provided at $WMA_SECRETS_FILE" ; return $(false); }