adds common function to_list to network_common

used to coerce a value into a list
This commit is contained in:
Peter Sprygada 2017-01-25 22:48:15 -05:00
parent 31d6b6ef67
commit 82dbe9853c

View file

@ -27,6 +27,14 @@
#
from ansible.module_utils.six import iteritems
def to_list(val):
if isinstance(val, (list, tuple, set)):
return list(val)
elif val is not None:
return [val]
else:
return list()
class ComplexDict:
def __init__(self, attrs):