Skip to content

Commit

Permalink
Ensure 'authorize' is always bool, regardless of source (ansible#56271)
Browse files Browse the repository at this point in the history
  • Loading branch information
Qalthos authored and NilashishC committed May 10, 2019
1 parent 8c56c11 commit 776ec08
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions lib/ansible/module_utils/network/common/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
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 (
Expand Down Expand Up @@ -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

Expand Down

0 comments on commit 776ec08

Please sign in to comment.