Remove verbose logging
This commit is contained in:
22
rsc_ops.sh
22
rsc_ops.sh
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user