From 61314778e0a605c50b4fc1d918193771492c52fb Mon Sep 17 00:00:00 2001 From: Paul Belanger Date: Mon, 8 Jun 2020 16:03:27 -0400 Subject: Fixes needed for sanity (#40) Fixes needed for sanity Reviewed-by: https://github.com/apps/ansible-zuul --- plugins/module_utils/network/vyos/argspec/ospfv2/ospfv2.py | 4 ++++ plugins/module_utils/network/vyos/argspec/ospfv3/ospfv3.py | 4 ++++ .../network/vyos/facts/l3_interfaces/l3_interfaces.py | 13 ++++--------- 3 files changed, 12 insertions(+), 9 deletions(-) (limited to 'plugins/module_utils') diff --git a/plugins/module_utils/network/vyos/argspec/ospfv2/ospfv2.py b/plugins/module_utils/network/vyos/argspec/ospfv2/ospfv2.py index 275aaf3..b4cdadf 100644 --- a/plugins/module_utils/network/vyos/argspec/ospfv2/ospfv2.py +++ b/plugins/module_utils/network/vyos/argspec/ospfv2/ospfv2.py @@ -4,6 +4,10 @@ # GNU General Public License v3.0+ # (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) +from __future__ import absolute_import, division, print_function + +__metaclass__ = type + ############################################# # WARNING # ############################################# diff --git a/plugins/module_utils/network/vyos/argspec/ospfv3/ospfv3.py b/plugins/module_utils/network/vyos/argspec/ospfv3/ospfv3.py index 66aaa8c..25f979c 100644 --- a/plugins/module_utils/network/vyos/argspec/ospfv3/ospfv3.py +++ b/plugins/module_utils/network/vyos/argspec/ospfv3/ospfv3.py @@ -4,6 +4,10 @@ # GNU General Public License v3.0+ # (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) +from __future__ import absolute_import, division, print_function + +__metaclass__ = type + ############################################# # WARNING # ############################################# diff --git a/plugins/module_utils/network/vyos/facts/l3_interfaces/l3_interfaces.py b/plugins/module_utils/network/vyos/facts/l3_interfaces/l3_interfaces.py index 3b99d34..eac8467 100644 --- a/plugins/module_utils/network/vyos/facts/l3_interfaces/l3_interfaces.py +++ b/plugins/module_utils/network/vyos/facts/l3_interfaces/l3_interfaces.py @@ -10,12 +10,7 @@ for a given resource, parsed, and the facts tree is populated based on the configuration. """ -from __future__ import ( - absolute_import, - division, - print_function, - unicode_literals, -) +from __future__ import absolute_import, division, print_function __metaclass__ = type @@ -26,8 +21,8 @@ from ansible_collections.ansible.netcommon.plugins.module_utils.network.common i utils, ) from ansible.module_utils.six import iteritems -from ansible_collections.ansible.netcommon.plugins.module_utils.compat import ( - ipaddress, +from ansible_collections.vyos.vyos.plugins.module_utils.network.vyos.utils.utils import ( + get_ip_address_version, ) from ansible_collections.vyos.vyos.plugins.module_utils.network.vyos.argspec.l3_interfaces.l3_interfaces import ( L3_interfacesArgs, @@ -135,7 +130,7 @@ class L3_interfacesFacts(object): elif item == "dhcpv6": config["ipv6"].append({"address": item}) else: - ip_version = ipaddress.ip_address(item.split("/")[0]).version + ip_version = get_ip_address_version(item.split("/")[0]) if ip_version == 4: config["ipv4"].append({"address": item}) else: -- cgit v1.2.3