From 776ec08ad5559afe5bf1116a3c3d75e096d59252 Mon Sep 17 00:00:00 2001 From: Nathaniel Case Date: Fri, 10 May 2019 03:43:37 -0400 Subject: [PATCH] Ensure 'authorize' is always bool, regardless of source (#56271) --- lib/ansible/module_utils/network/common/utils.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/ansible/module_utils/network/common/utils.py b/lib/ansible/module_utils/network/common/utils.py index 03f978e3053..6e0a18d1331 100644 --- a/lib/ansible/module_utils/network/common/utils.py +++ b/lib/ansible/module_utils/network/common/utils.py @@ -40,6 +40,7 @@ from ansible.module_utils._text import to_text from ansible.module_utils.common._collections_compat import Mapping from ansible.module_utils.six import iteritems, string_types from ansible.module_utils.basic import AnsibleFallbackNotFound +from ansible.module_utils.parsing.convert_bool import boolean # Backwards compatibility for 3rd party modules from ansible.module_utils.common.network import ( @@ -418,6 +419,9 @@ def load_provider(spec, args): provider[key] = value['default'] else: provider[key] = None + if 'authorize' in provider: + # Coerce authorize to provider if a string has somehow snuck in. + provider['authorize'] = boolean(provider['authorize']) args['provider'] = provider return provider