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

Revert "Simplify config settings initialization" #1265

Merged
merged 1 commit into from
Jul 10, 2023
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
8 changes: 6 additions & 2 deletions src/ansible_runner/config/_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@
class BaseConfig(object):

def __init__(self,
private_data_dir=None, host_cwd=None, envvars=None, passwords=None, settings={},
private_data_dir=None, host_cwd=None, envvars=None, passwords=None, settings=None,
project_dir=None, artifact_dir=None, fact_cache_type='jsonfile', fact_cache=None,
process_isolation=False, process_isolation_executable=None,
container_image=None, container_volume_mounts=None, container_options=None, container_workdir=None, container_auth_data=None,
Expand All @@ -80,6 +80,7 @@
self.registry_auth_path = None
self.container_name = None # like other properties, not accurate until prepare is called
self.container_options = container_options
self._volume_mount_paths = []

# runner params
self.private_data_dir = private_data_dir
Expand Down Expand Up @@ -148,7 +149,10 @@
"""
self.runner_mode = runner_mode
try:
self.settings.update(self.loader.load_file('env/settings', Mapping))
if self.settings and isinstance(self.settings, dict):
self.settings.update(self.loader.load_file('env/settings', Mapping))

Check warning on line 153 in src/ansible_runner/config/_base.py

View check run for this annotation

Codecov / codecov/patch

src/ansible_runner/config/_base.py#L153

Added line #L153 was not covered by tests
else:
self.settings = self.loader.load_file('env/settings', Mapping)
except ConfigurationError:
debug("Not loading settings")
self.settings = dict()
Expand Down