From b872b6f21d14ff10c221d84217eb568318e9ad8b Mon Sep 17 00:00:00 2001 From: Nilashish Chakraborty Date: Tue, 25 Jun 2024 14:54:01 +0530 Subject: `vyos.vyos` is no longer deprecated! 🎉 (#348) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Remove deprecation notice for vyos.vyos Signed-off-by: NilashishC * Add changelog Signed-off-by: NilashishC * fix review comments Signed-off-by: NilashishC * chore: auto fixes from pre-commit.com hooks --------- Signed-off-by: NilashishC Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> --- plugins/modules/vyos_vlan.py | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) (limited to 'plugins/modules/vyos_vlan.py') diff --git a/plugins/modules/vyos_vlan.py b/plugins/modules/vyos_vlan.py index f3e3dc88..49cc1258 100644 --- a/plugins/modules/vyos_vlan.py +++ b/plugins/modules/vyos_vlan.py @@ -6,6 +6,7 @@ from __future__ import absolute_import, division, print_function + __metaclass__ = type @@ -122,8 +123,8 @@ EXAMPLES = """ vyos.vyos.vyos_vlan: vlan_id: 100 interfaces: - - eth1 - - eth2 + - eth1 + - eth2 - name: Configure virtual interface address vyos.vyos.vyos_vlan: @@ -136,14 +137,14 @@ EXAMPLES = """ vlan_id: 100 interfaces: eth0 associated_interfaces: - - eth0 + - eth0 - name: vlan intent check vyos.vyos.vyos_vlan: vlan_id: 100 associated_interfaces: - - eth3 - - eth4 + - eth3 + - eth4 - name: Delete vlan vyos.vyos.vyos_vlan: @@ -164,6 +165,7 @@ commands: """ import re import time + from copy import deepcopy from ansible.module_utils._text import to_text @@ -224,7 +226,7 @@ def map_obj_to_commands(updates, module): if not obj_in_want: for i in h["interfaces"]: commands.append( - "delete interfaces ethernet {0} vif {1}".format(i, h["vlan_id"]) + "delete interfaces ethernet {0} vif {1}".format(i, h["vlan_id"]), ) return commands @@ -260,7 +262,7 @@ def map_params_to_obj(module): "state": module.params["state"], "interfaces": module.params["interfaces"], "associated_interfaces": module.params["associated_interfaces"], - } + }, ) return obj @@ -325,7 +327,7 @@ def check_declarative_intent_params(want, module, result): for i in w["associated_interfaces"]: if (set(obj_interface) - set(w["associated_interfaces"])) != set([]): module.fail_json( - msg="Interface {0} not configured on vlan {1}".format(i, w["vlan_id"]) + msg="Interface {0} not configured on vlan {1}".format(i, w["vlan_id"]), ) -- cgit v1.2.3