Commit 77b60a1a by Alphadelta14

Support any Mapping for with_dict lookup.

This resolves 39393482 breaking `with_dict: hostvars`.
parent c419cacb
......@@ -17,6 +17,8 @@
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
import collections
from ansible.errors import AnsibleError
from ansible.plugins.lookup import LookupBase
......@@ -24,7 +26,8 @@ class LookupModule(LookupBase):
def run(self, terms, varibles=None, **kwargs):
if not isinstance(terms, dict):
# Expect any type of Mapping, notably hostvars
if not isinstance(terms, collections.Mapping):
raise AnsibleError("with_dict expects a dict")
return self._flatten_hash_to_list(terms)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment