1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00

Fix module arg parsing when 'args' are present but not a dict (v2)

This commit is contained in:
James Cammarata 2015-05-02 22:17:02 -05:00
parent 6a44056d76
commit 8cf4452d48
2 changed files with 6 additions and 1 deletions

View file

@ -135,7 +135,11 @@ class ModuleArgsParser:
# this can occasionally happen, simplify # this can occasionally happen, simplify
if args and 'args' in args: if args and 'args' in args:
args = args['args'] tmp_args = args['args']
del args['args']
if isinstance(tmp_args, string_types):
tmp_args = parse_kv(tmp_args)
args.update(tmp_args)
# finally, update the args we're going to return with the ones # finally, update the args we're going to return with the ones
# which were normalized above # which were normalized above

View file

@ -27,6 +27,7 @@ class FactCache(MutableMapping):
def __init__(self, *args, **kwargs): def __init__(self, *args, **kwargs):
self._plugin = cache_loader.get(C.CACHE_PLUGIN) self._plugin = cache_loader.get(C.CACHE_PLUGIN)
if self._plugin is None: if self._plugin is None:
# FIXME: this should be an exception
return return
def __getitem__(self, key): def __getitem__(self, key):