Skip to content
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

Merged
merged 2 commits into from
Mar 20, 2023

Conversation

zbud-msft
Copy link
Contributor

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

Which release branch to backport (provide reason below if selected)

  • 201811
  • 201911
  • 202006
  • 202012
  • 202106
  • 202111
  • 202205
  • 202211

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)

if [ ! -z $LOG_LEVEL ]; then
TELEMETRY_ARGS+=" -v=$LOG_LEVEL"
else
if [ -z $LOG_LEVEL ] || [ $LOG_LEVEL == "null" ]; then
Copy link
Collaborator

@qiluo-msft qiluo-msft Mar 17, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

$LOG_LEVEL

If you expect only numbers, check for numbers as allowlist. ref: https://stackoverflow.com/a/2210386/2514803 #Closed

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

@qiluo-msft qiluo-msft merged commit 881b925 into sonic-net:master Mar 20, 2023
mssonicbld pushed a commit to mssonicbld/sonic-buildimage that referenced this pull request Mar 24, 2023
#### 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
@mssonicbld
Copy link
Collaborator

Cherry-pick PR to 202205: #14410

qiluo-msft pushed a commit that referenced this pull request Mar 30, 2023
#### 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
mssonicbld pushed a commit to mssonicbld/sonic-buildimage that referenced this pull request Apr 20, 2023
#### 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
@mssonicbld
Copy link
Collaborator

Cherry-pick PR to 202211: #14763

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants