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

Ignore mypy error from load_file #1297

Merged
merged 1 commit into from
Aug 17, 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: 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 @@
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 @@
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

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

View check run for this annotation

Codecov / codecov/patch

src/ansible_runner/config/_base.py#L189

Added line #L189 was not covered by tests
else:
self.passwords = self.passwords or self.loader.load_file('env/passwords', Mapping)
except ConfigurationError:
Expand Down Expand Up @@ -262,14 +262,14 @@
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
Loading