Use Mapping rather than dict when evaluation 'options' (#58215)

pull/58349/head
Sam Doran 5 years ago committed by Matt Martz
parent 9069a681aa
commit 18d713e6d5

@ -38,6 +38,7 @@ from fnmatch import fnmatch
from ansible import __version__ as ansible_version from ansible import __version__ as ansible_version
from ansible.executor.module_common import REPLACER_WINDOWS from ansible.executor.module_common import REPLACER_WINDOWS
from ansible.module_utils.common._collections_compat import Mapping
from ansible.plugins.loader import fragment_loader from ansible.plugins.loader import fragment_loader
from ansible.utils.plugin_docs import BLACKLIST, add_fragments, get_docstring from ansible.utils.plugin_docs import BLACKLIST, add_fragments, get_docstring
@ -1177,7 +1178,7 @@ class ModuleValidator(Validator):
deprecated_args_from_argspec.add(arg) deprecated_args_from_argspec.add(arg)
deprecated_args_from_argspec.update(data.get('aliases', [])) deprecated_args_from_argspec.update(data.get('aliases', []))
if arg == 'provider' and self.object_path.startswith('lib/ansible/modules/network/'): if arg == 'provider' and self.object_path.startswith('lib/ansible/modules/network/'):
if data.get('options') and not isinstance(data.get('options'), dict): if data.get('options') and not isinstance(data.get('options'), Mapping):
self.reporter.error( self.reporter.error(
path=self.object_path, path=self.object_path,
code=331, code=331,

Loading…
Cancel
Save