mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-04-23 10:51:24 -07:00
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:
parent
fee42a01d9
commit
3b0e9ded91
2 changed files with 70 additions and 6 deletions
|
@ -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
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue