Skip to content

Commit

Permalink
Fix settings and password dict update
Browse files Browse the repository at this point in the history
The update method on dict returns None, so we can not use the return value to set the variable as this will just delete the dictionary
  • Loading branch information
berndbohmeier committed Oct 30, 2021
1 parent 7fe85e7 commit 3386cba
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions ansible_runner/config/_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ def _prepare_env(self, runner_mode='pexpect'):
self.runner_mode = runner_mode
try:
if self.settings and isinstance(self.settings, dict):
self.settings = self.settings.update(self.loader.load_file('env/settings', Mapping))
self.settings.update(self.loader.load_file('env/settings', Mapping))
else:
self.settings = self.loader.load_file('env/settings', Mapping)
except ConfigurationError:
Expand All @@ -157,7 +157,7 @@ def _prepare_env(self, runner_mode='pexpect'):
if self.runner_mode == 'pexpect':
try:
if self.passwords and isinstance(self.passwords, dict):
self.passwords = self.passwords.update(self.loader.load_file('env/passwords', Mapping))
self.passwords.update(self.loader.load_file('env/passwords', Mapping))
else:
self.passwords = self.passwords or self.loader.load_file('env/passwords', Mapping)
self.expect_passwords = {
Expand Down

0 comments on commit 3386cba

Please sign in to comment.