-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix telemetry.sh passing in null as log level value #14303
Conversation
if [ ! -z $LOG_LEVEL ]; then | ||
TELEMETRY_ARGS+=" -v=$LOG_LEVEL" | ||
else | ||
if [ -z $LOG_LEVEL ] || [ $LOG_LEVEL == "null" ]; then |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you expect only numbers, check for numbers as allowlist. ref: https://stackoverflow.com/a/2210386/2514803 #Closed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
#### 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
Cherry-pick PR to 202205: #14410 |
#### 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
#### 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
Cherry-pick PR to 202211: #14763 |
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
Which release branch to backport (provide reason below if selected)
Description for the changelog
Ensure to add label/tag for the feature raised. example - PR#2174 under sonic-utilities repo. where, Generic Config and Update feature has been labelled as GCU.
Link to config_db schema for YANG module changes
A picture of a cute animal (not mandatory but encouraged)