Skip to content

Commit

Permalink
Revert "Simplify config settings initialization (#1262)" (#1265)
Browse files Browse the repository at this point in the history
This reverts commit 9c62fb3.
  • Loading branch information
Shrews authored Jul 10, 2023
1 parent 9c62fb3 commit aed3525
Showing 1 changed file with 6 additions and 2 deletions.
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 BaseExecutionMode():
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 @@ def __init__(self,
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 @@ def _prepare_env(self, runner_mode='pexpect'):
"""
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))
else:
self.settings = self.loader.load_file('env/settings', Mapping)
except ConfigurationError:
debug("Not loading settings")
self.settings = dict()
Expand Down

0 comments on commit aed3525

Please sign in to comment.