Add inline type hint ignores.

pull/76332/head
Matt Clay 2 years ago
parent 2a2b7dc42a
commit 27923aad7e

@ -121,7 +121,7 @@ class InventoryModule(BaseFileInventoryPlugin):
def _parse_group(self, group, group_data):
if isinstance(group_data, (MutableMapping, NoneType)):
if isinstance(group_data, (MutableMapping, NoneType)): # type: ignore[misc]
try:
group = self.inventory.add_group(group)
@ -136,17 +136,17 @@ class InventoryModule(BaseFileInventoryPlugin):
if isinstance(group_data[section], string_types):
group_data[section] = {group_data[section]: None}
if not isinstance(group_data[section], (MutableMapping, NoneType)):
if not isinstance(group_data[section], (MutableMapping, NoneType)): # type: ignore[misc]
raise AnsibleParserError('Invalid "%s" entry for "%s" group, requires a dictionary, found "%s" instead.' %
(section, group, type(group_data[section])))
for key in group_data:
if not isinstance(group_data[key], (MutableMapping, NoneType)):
if not isinstance(group_data[key], (MutableMapping, NoneType)): # type: ignore[misc]
self.display.warning('Skipping key (%s) in group (%s) as it is not a mapping, it is a %s' % (key, group, type(group_data[key])))
continue
if isinstance(group_data[key], NoneType):
if isinstance(group_data[key], NoneType): # type: ignore[misc]
self.display.vvv('Skipping empty key (%s) in group (%s)' % (key, group))
elif key == 'vars':
for var in group_data[key]:

@ -28,7 +28,7 @@ from types import ModuleType
try:
from importlib import import_module
except ImportError:
def import_module(name):
def import_module(name): # type: ignore[misc]
__import__(name)
return sys.modules[name]

Loading…
Cancel
Save