diff options
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/module_utils/network/vyos/argspec/ospfv2/ospfv2.py | 4 | ||||
-rw-r--r-- | plugins/module_utils/network/vyos/argspec/ospfv3/ospfv3.py | 4 | ||||
-rw-r--r-- | plugins/module_utils/network/vyos/facts/l3_interfaces/l3_interfaces.py | 13 | ||||
-rw-r--r-- | plugins/modules/vyos_command.py | 2 | ||||
-rw-r--r-- | plugins/modules/vyos_interface.py | 3 | ||||
-rw-r--r-- | plugins/modules/vyos_l3_interface.py | 3 | ||||
-rw-r--r-- | plugins/modules/vyos_linkagg.py | 3 | ||||
-rw-r--r-- | plugins/modules/vyos_lldp_interface.py | 3 | ||||
-rw-r--r-- | plugins/modules/vyos_static_route.py | 3 |
9 files changed, 28 insertions, 10 deletions
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: diff --git a/plugins/modules/vyos_command.py b/plugins/modules/vyos_command.py index 58e98c9..2871683 100644 --- a/plugins/modules/vyos_command.py +++ b/plugins/modules/vyos_command.py @@ -209,7 +209,7 @@ def main(): module.fail_json(msg=msg, failed_conditions=failed_conditions) result.update( - {"stdout": responses, "stdout_lines": list(to_lines(responses)),} + {"stdout": responses, "stdout_lines": list(to_lines(responses))} ) module.exit_json(**result) diff --git a/plugins/modules/vyos_interface.py b/plugins/modules/vyos_interface.py index 11a1d49..fe4fce3 100644 --- a/plugins/modules/vyos_interface.py +++ b/plugins/modules/vyos_interface.py @@ -19,6 +19,9 @@ # along with Ansible. If not, see <http://www.gnu.org/licenses/>. # +from __future__ import absolute_import, division, print_function + +__metaclass__ = type DOCUMENTATION = """ module: vyos_interface diff --git a/plugins/modules/vyos_l3_interface.py b/plugins/modules/vyos_l3_interface.py index 3e43f7c..2feb824 100644 --- a/plugins/modules/vyos_l3_interface.py +++ b/plugins/modules/vyos_l3_interface.py @@ -19,6 +19,9 @@ # along with Ansible. If not, see <http://www.gnu.org/licenses/>. # +from __future__ import absolute_import, division, print_function + +__metaclass__ = type DOCUMENTATION = """ module: vyos_l3_interface diff --git a/plugins/modules/vyos_linkagg.py b/plugins/modules/vyos_linkagg.py index 0d939b2..a68197b 100644 --- a/plugins/modules/vyos_linkagg.py +++ b/plugins/modules/vyos_linkagg.py @@ -19,6 +19,9 @@ # along with Ansible. If not, see <http://www.gnu.org/licenses/>. # +from __future__ import absolute_import, division, print_function + +__metaclass__ = type DOCUMENTATION = """ module: vyos_linkagg diff --git a/plugins/modules/vyos_lldp_interface.py b/plugins/modules/vyos_lldp_interface.py index 80d4dbf..90e123d 100644 --- a/plugins/modules/vyos_lldp_interface.py +++ b/plugins/modules/vyos_lldp_interface.py @@ -19,6 +19,9 @@ # along with Ansible. If not, see <http://www.gnu.org/licenses/>. # +from __future__ import absolute_import, division, print_function + +__metaclass__ = type DOCUMENTATION = """ module: vyos_lldp_interface diff --git a/plugins/modules/vyos_static_route.py b/plugins/modules/vyos_static_route.py index 7859467..4724d5f 100644 --- a/plugins/modules/vyos_static_route.py +++ b/plugins/modules/vyos_static_route.py @@ -19,6 +19,9 @@ # along with Ansible. If not, see <http://www.gnu.org/licenses/>. # +from __future__ import absolute_import, division, print_function + +__metaclass__ = type DOCUMENTATION = """ module: vyos_static_route |