Skip to content

Commit

Permalink
Ignore mypy error from load_file (#1297)
Browse files Browse the repository at this point in the history
  • Loading branch information
Shrews authored Aug 17, 2023
1 parent aac7fe1 commit 54ec2dd
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/ansible_runner/config/_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ def prepare_env(self, runner_mode: str = 'pexpect') -> None:
self.runner_mode = runner_mode
try:
if self.settings and isinstance(self.settings, dict):
self.settings.update(self.loader.load_file('env/settings', Mapping))
self.settings.update(self.loader.load_file('env/settings', Mapping)) # type: ignore
else:
self.settings = self.loader.load_file('env/settings', Mapping)
except ConfigurationError:
Expand All @@ -186,7 +186,7 @@ def prepare_env(self, runner_mode: str = 'pexpect') -> None:
if self.runner_mode == 'pexpect':
try:
if self.passwords and isinstance(self.passwords, dict):
self.passwords.update(self.loader.load_file('env/passwords', Mapping))
self.passwords.update(self.loader.load_file('env/passwords', Mapping)) # type: ignore
else:
self.passwords = self.passwords or self.loader.load_file('env/passwords', Mapping)
except ConfigurationError:
Expand Down Expand Up @@ -262,14 +262,14 @@ def prepare_env(self, runner_mode: str = 'pexpect') -> None:
try:
envvars = self.loader.load_file('env/envvars', Mapping)
if envvars:
self.env.update(envvars)
self.env.update(envvars) # type: ignore
except ConfigurationError:
debug("Not loading environment vars")
# Still need to pass default environment to pexpect

try:
if self.ssh_key_data is None:
self.ssh_key_data = self.loader.load_file('env/ssh_key', str)
self.ssh_key_data = self.loader.load_file('env/ssh_key', str) # type: ignore
except ConfigurationError:
debug("Not loading ssh key")
self.ssh_key_data = None
Expand Down

0 comments on commit 54ec2dd

Please sign in to comment.