Fix fallback and boolean check in argspec (#27994)

Fixes #27978

*  Add missing assignment for param key in fallback handling
*  Add check for frozenset type
*  Unit testcase
This commit is contained in:
Ganesh Nalawade 2017-08-11 00:40:18 +05:30 committed by Matt Davis
parent fee42a01d9
commit 3b0e9ded91
2 changed files with 70 additions and 6 deletions

View file

@ -115,9 +115,9 @@ NoneType = type(None)
# this matters, make sure to check for strings before checking for sequencetype
try:
from collections.abc import KeysView
SEQUENCETYPE = (Sequence, KeysView)
SEQUENCETYPE = (Sequence, frozenset, KeysView)
except:
SEQUENCETYPE = Sequence
SEQUENCETYPE = (Sequence, frozenset)
try:
import json
@ -2044,7 +2044,7 @@ class AnsibleModule(object):
else:
fallback_args = item
try:
param = fallback_strategy(*fallback_args, **fallback_kwargs)
param[k] = fallback_strategy(*fallback_args, **fallback_kwargs)
except AnsibleFallbackNotFound:
continue