Fix telemetry.sh passing in null as log level value (#14303)
#### Why I did it Bug in script that was passing in null as log level value if missing from config_db #### How I did it Added more robust conditional statement #### How to verify it 1) Remove log_level from config db 2) config reload -y 3) telemetry should not crash
This commit is contained in:
parent
4429bdd091
commit
881b925d19
@ -63,7 +63,7 @@ if [ -z $CLIENT_AUTH ] || [ $CLIENT_AUTH == "false" ]; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
LOG_LEVEL=$(echo $GNMI | jq -r '.log_level')
|
LOG_LEVEL=$(echo $GNMI | jq -r '.log_level')
|
||||||
if [ ! -z $LOG_LEVEL ]; then
|
if [[ $LOG_LEVEL =~ ^[0-9]+$ ]]; then
|
||||||
TELEMETRY_ARGS+=" -v=$LOG_LEVEL"
|
TELEMETRY_ARGS+=" -v=$LOG_LEVEL"
|
||||||
else
|
else
|
||||||
TELEMETRY_ARGS+=" -v=2"
|
TELEMETRY_ARGS+=" -v=2"
|
||||||
|
Loading…
Reference in New Issue
Block a user