From 8cf4452d48e583cfd59f96e67cfd34a1c35226e7 Mon Sep 17 00:00:00 2001 From: James Cammarata Date: Sat, 2 May 2015 22:17:02 -0500 Subject: [PATCH] Fix module arg parsing when 'args' are present but not a dict (v2) --- v2/ansible/parsing/mod_args.py | 6 +++++- v2/ansible/plugins/cache/__init__.py | 1 + 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/v2/ansible/parsing/mod_args.py b/v2/ansible/parsing/mod_args.py index f46b525c66..ed527f1b08 100644 --- a/v2/ansible/parsing/mod_args.py +++ b/v2/ansible/parsing/mod_args.py @@ -135,7 +135,11 @@ class ModuleArgsParser: # this can occasionally happen, simplify 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 # which were normalized above diff --git a/v2/ansible/plugins/cache/__init__.py b/v2/ansible/plugins/cache/__init__.py index 4aa8fda8bb..8ffe554cc6 100644 --- a/v2/ansible/plugins/cache/__init__.py +++ b/v2/ansible/plugins/cache/__init__.py @@ -27,6 +27,7 @@ class FactCache(MutableMapping): def __init__(self, *args, **kwargs): self._plugin = cache_loader.get(C.CACHE_PLUGIN) if self._plugin is None: + # FIXME: this should be an exception return def __getitem__(self, key):