Remove verbose logging

This commit is contained in:
2025-10-15 17:33:29 +01:00
parent b71ca508ea
commit 14b74e8ecd
6 changed files with 22 additions and 66 deletions

View File

@@ -10,11 +10,8 @@
MYDIR="$(dirname "$(realpath "$0")")"
# Logging helpers
VERBOSE=${VERBOSE:-0}
log_info() {
if [ "${VERBOSE}" -eq 1 ]; then
echo "INFO: $*"
fi
echo "INFO: $*"
}
log_warn() {
echo "WARN: $*" >&2
@@ -219,12 +216,21 @@ rsc_get_host_id() {
# Get all matching host IDs (portable, no mapfile)
host_ids=$(cat /tmp/rbkresponse.$$ | jq -r '.data.physicalHosts.nodes[] | .id')
host_count=$(echo "$host_ids" | grep -c .)
if [[ $host_count -ne 1 ]]; then
log_error "Multiple hosts found for '$1':"
cat /tmp/rbkresponse.$$ | jq -r '.data.physicalHosts.nodes[] | "\(.name) \(.id)"'
if [[ $host_count -eq 0 ]]; then
log_error "Host '$RBK_HOST' not found by exact match (this script requires an exact host name)."
log_error "Please re-run with the exact host name as stored in RSC."
exit_with_error
fi
# Set the first match (or empty if none)
if [[ $host_count -gt 1 ]]; then
log_error "Multiple hosts found for '$RBK_HOST':"
cat /tmp/rbkresponse.$$ | jq -r '.data.physicalHosts.nodes[] | "\(.name) \(.id)"'
log_error "Please re-run with the exact host name to disambiguate."
exit_with_error
fi
# Exactly one match: set the first match
targetHostId=$(echo "$host_ids" | head -n 1)
#cat /tmp/rbkresponse.$$ | jq -r