Skip to content

Disable extra vars via environment variable#76

Merged
evgeni merged 2 commits intotheforeman:masterfrom
ehelms:env-allow-extra-vars
May 7, 2025
Merged

Disable extra vars via environment variable#76
evgeni merged 2 commits intotheforeman:masterfrom
ehelms:env-allow-extra-vars

Conversation

@ehelms
Copy link
Member

@ehelms ehelms commented May 7, 2025

No description provided.

Whether to allow --extra-vars parameter to be automatically added
"""
return True
return os.environ.get('OBSAH_ALLOW_EXTRA_VARS', True)
Copy link
Member

Choose a reason for hiding this comment

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

data from the environment is represented as strings, and "0" is True-thy in Python (and Ruby).

You'd need to do something like

if value := os.environ.get('OBSAH_ALLOW') is not None:
    return value.lower() in ['true', '1']
return True

Signed-off-by: Eric D. Helms <ericdhelms@gmail.com>
@ehelms ehelms force-pushed the env-allow-extra-vars branch from f69b87a to 1200950 Compare May 7, 2025 10:53
@evgeni evgeni merged commit 2d4cd99 into theforeman:master May 7, 2025
6 checks passed
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.

2 participants