From 36da7e462a6d93751b471cc0207dfe94bb1f9d7d Mon Sep 17 00:00:00 2001 From: Sam Doran Date: Thu, 11 Jul 2019 10:19:18 -0400 Subject: [PATCH] Better fix for invalid data in 'options' field (#58353) --- test/sanity/validate-modules/main.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/sanity/validate-modules/main.py b/test/sanity/validate-modules/main.py index 7942a6bf353..72b4d5c9324 100755 --- a/test/sanity/validate-modules/main.py +++ b/test/sanity/validate-modules/main.py @@ -1178,13 +1178,13 @@ class ModuleValidator(Validator): deprecated_args_from_argspec.add(arg) deprecated_args_from_argspec.update(data.get('aliases', [])) if arg == 'provider' and self.object_path.startswith('lib/ansible/modules/network/'): - if data.get('options') and not isinstance(data.get('options'), Mapping): + if data.get('options') is not None and not isinstance(data.get('options'), Mapping): self.reporter.error( path=self.object_path, code=331, msg="Argument 'options' in argument_spec['provider'] must be a dictionary/hash when used", ) - else: + elif data.get('options'): # Record provider options from network modules, for later comparison for provider_arg, provider_data in data.get('options', {}).items(): provider_args.add(provider_arg)