Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion tests/integration_tests/integration_settings.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# This file is part of cloud-init. See LICENSE file for license information.
import os

from distutils.util import strtobool
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

🎶 hello util my old friend 🎶


##################################################################
# LAUNCH SETTINGS
##################################################################
Expand Down Expand Up @@ -109,6 +111,12 @@
# Perhaps a bit too hacky, but it works :)
current_settings = [var for var in locals() if var.isupper()]
for setting in current_settings:
globals()[setting] = os.getenv(
env_setting = os.getenv(
'CLOUD_INIT_{}'.format(setting), globals()[setting]
)
if isinstance(env_setting, str):
try:
env_setting = bool(strtobool(env_setting.strip()))
except ValueError:
pass
globals()[setting] = env_setting