diff options
author | Nilashish Chakraborty <nilashishchakraborty8@gmail.com> | 2024-06-25 14:54:01 +0530 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-06-25 14:54:01 +0530 |
commit | b872b6f21d14ff10c221d84217eb568318e9ad8b (patch) | |
tree | 0aacdea877a7e2b209735cd0f7c0b9d62a9446f7 /plugins/modules/vyos_vlan.py | |
parent | 37baff3d4d547911bec1387218edfd477ca79062 (diff) | |
download | vyos.vyos-b872b6f21d14ff10c221d84217eb568318e9ad8b.tar.gz vyos.vyos-b872b6f21d14ff10c221d84217eb568318e9ad8b.zip |
`vyos.vyos` is no longer deprecated! 🎉 (#348)
* Remove deprecation notice for vyos.vyos
Signed-off-by: NilashishC <nilashishchakraborty8@gmail.com>
* Add changelog
Signed-off-by: NilashishC <nilashishchakraborty8@gmail.com>
* fix review comments
Signed-off-by: NilashishC <nilashishchakraborty8@gmail.com>
* chore: auto fixes from pre-commit.com hooks
---------
Signed-off-by: NilashishC <nilashishchakraborty8@gmail.com>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Diffstat (limited to 'plugins/modules/vyos_vlan.py')
-rw-r--r-- | plugins/modules/vyos_vlan.py | 18 |
1 files changed, 10 insertions, 8 deletions
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"]), ) |