diff --git a/lib/ansible/module_utils/network_common.py b/lib/ansible/module_utils/network_common.py index d7523cf7a13..31a5d69f4ab 100644 --- a/lib/ansible/module_utils/network_common.py +++ b/lib/ansible/module_utils/network_common.py @@ -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):