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

pull/10870/merge
James Cammarata 10 years ago
parent 6a44056d76
commit 8cf4452d48

@ -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

@ -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):

Loading…
Cancel
Save