mirror of
https://github.com/ansible/ansible.git
synced 2026-02-03 20:40:24 -05:00
Fix types @ galaxy.collection.galaxy_api_proxy
This includes enforcing `strict_optional` for the `ansible.galaxy.collection.galaxy_api_proxy` module in MyPy.
This commit is contained in:
parent
be8152a2b1
commit
e05b6e7475
2 changed files with 5 additions and 2 deletions
|
|
@ -34,7 +34,7 @@ class MultiGalaxyAPIProxy:
|
|||
self._offline = offline # Prevent all GalaxyAPI calls
|
||||
|
||||
@property
|
||||
def is_offline_mode_requested(self):
|
||||
def is_offline_mode_requested(self) -> bool:
|
||||
return self._offline
|
||||
|
||||
def _assert_that_offline_mode_is_not_requested(self) -> None:
|
||||
|
|
@ -117,7 +117,7 @@ class MultiGalaxyAPIProxy:
|
|||
else self._apis
|
||||
)
|
||||
|
||||
last_err: t.Optional[Exception]
|
||||
last_err: Exception
|
||||
|
||||
for api in api_lookup_order:
|
||||
try:
|
||||
|
|
|
|||
|
|
@ -23,6 +23,9 @@ ignore_missing_imports = True
|
|||
[mypy-ansible_test.*]
|
||||
ignore_missing_imports = True
|
||||
|
||||
[mypy-ansible.galaxy.collection.galaxy_api_proxy]
|
||||
strict_optional = True
|
||||
|
||||
[mypy-ansible.galaxy.collection.gpg]
|
||||
strict_optional = True
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue