mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-07-28 23:51:23 -07:00
allow for any non string iterable in listify
This commit is contained in:
parent
0d606b5705
commit
f576d29b6b
1 changed files with 2 additions and 2 deletions
|
@ -19,7 +19,7 @@
|
||||||
from __future__ import (absolute_import, division, print_function)
|
from __future__ import (absolute_import, division, print_function)
|
||||||
__metaclass__ = type
|
__metaclass__ = type
|
||||||
|
|
||||||
|
from collections import Iterable
|
||||||
from ansible.template import Templar
|
from ansible.template import Templar
|
||||||
from ansible.template.safe_eval import safe_eval
|
from ansible.template.safe_eval import safe_eval
|
||||||
|
|
||||||
|
@ -38,7 +38,7 @@ def listify_lookup_plugin_terms(terms, variables, loader):
|
||||||
#TODO: check if this is needed as template should also return correct type already
|
#TODO: check if this is needed as template should also return correct type already
|
||||||
terms = safe_eval(terms)
|
terms = safe_eval(terms)
|
||||||
|
|
||||||
if isinstance(terms, basestring) or not isinstance(terms, list) and not isinstance(terms, set):
|
if isinstance(terms, basestring) or not isinstance(terms, Iterable):
|
||||||
terms = [ terms ]
|
terms = [ terms ]
|
||||||
|
|
||||||
return terms
|
return terms
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue