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(sct_config): str_or_list_or_eval to better return empty values #9537

Merged
merged 1 commit into from
Dec 11, 2024

Conversation

fruch
Copy link
Contributor

@fruch fruch commented Dec 11, 2024

in case we got empty envirment variable for on of the config option using str_or_list_or_eval, we end up with [''] which maps to True (python truthiness)

in turn it did break azure cleanup logic when SCT_AZURE_REGION_NAME= was passed empty, and the cleanup didn't found any resources groups to clean.

Testing

  • [ ]

PR pre-checks (self review)

  • I added the relevant backport labels
  • I didn't leave commented-out/debugging code

Reminders

  • Add New configuration option and document them (in sdcm/sct_config.py)
  • Add unit tests to cover my changes (under unit-test/ folder)
  • Update the Readme/doc folder relevant to this change (if needed)

in case we got empty envirment variable for on of the config option
using `str_or_list_or_eval`, we end up with `['']` which maps to
True (python truthiness)

in turn it did break azure cleanup logic when `SCT_AZURE_REGION_NAME=`
was passed empty, and the cleanup didn't found any resources groups
to clean.
@fruch fruch requested review from dimakr and a team December 11, 2024 13:48
@fruch fruch added backport/2024.2 Need backport to 2024.2 backport/6.2 labels Dec 11, 2024
Copy link
Contributor

@dimakr dimakr left a comment

Choose a reason for hiding this comment

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

LGTM

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