diff options
Diffstat (limited to 'plugins/module_utils/network')
10 files changed, 28 insertions, 19 deletions
diff --git a/plugins/module_utils/network/vyos/argspec/facts/facts.py b/plugins/module_utils/network/vyos/argspec/facts/facts.py index 46fabaa2..e52b6eb6 100644 --- a/plugins/module_utils/network/vyos/argspec/facts/facts.py +++ b/plugins/module_utils/network/vyos/argspec/facts/facts.py @@ -17,6 +17,8 @@ class FactsArgs(object): # pylint: disable=R0903 pass argument_spec = { - "gather_subset": dict(default=["!config"], type="list"), - "gather_network_resources": dict(type="list"), + "gather_subset": dict( + default=["!config"], type="list", elements="str" + ), + "gather_network_resources": dict(type="list", elements="str"), } diff --git a/plugins/module_utils/network/vyos/argspec/lag_interfaces/lag_interfaces.py b/plugins/module_utils/network/vyos/argspec/lag_interfaces/lag_interfaces.py index 6cfdabf1..cc124a91 100644 --- a/plugins/module_utils/network/vyos/argspec/lag_interfaces/lag_interfaces.py +++ b/plugins/module_utils/network/vyos/argspec/lag_interfaces/lag_interfaces.py @@ -41,7 +41,7 @@ class Lag_interfacesArgs(object): # pylint: disable=R0903 "arp_monitor": { "options": { "interval": {"type": "int"}, - "target": {"type": "list"}, + "target": {"type": "list", "elements": "str"}, }, "type": "dict", }, diff --git a/plugins/module_utils/network/vyos/argspec/lldp_global/lldp_global.py b/plugins/module_utils/network/vyos/argspec/lldp_global/lldp_global.py index 6205fd77..fa41127b 100644 --- a/plugins/module_utils/network/vyos/argspec/lldp_global/lldp_global.py +++ b/plugins/module_utils/network/vyos/argspec/lldp_global/lldp_global.py @@ -42,6 +42,7 @@ class Lldp_globalArgs(object): # pylint: disable=R0903 "legacy_protocols": { "choices": ["cdp", "edp", "fdp", "sonmp"], "type": "list", + "elements": "str", }, "snmp": {"type": "str"}, }, diff --git a/plugins/module_utils/network/vyos/argspec/ospfv2/ospfv2.py b/plugins/module_utils/network/vyos/argspec/ospfv2/ospfv2.py index b4cdadfd..b113035a 100644 --- a/plugins/module_utils/network/vyos/argspec/ospfv2/ospfv2.py +++ b/plugins/module_utils/network/vyos/argspec/ospfv2/ospfv2.py @@ -210,8 +210,11 @@ class Ospfv2Args(object): # pylint: disable=R0903 }, "type": "dict", }, - "passive_interface": {"type": "list"}, - "passive_interface_exclude": {"type": "list"}, + "passive_interface": {"type": "list", "elements": "str"}, + "passive_interface_exclude": { + "type": "list", + "elements": "str", + }, "redistribute": { "elements": "dict", "options": { @@ -231,7 +234,7 @@ class Ospfv2Args(object): # pylint: disable=R0903 }, "type": "list", }, - "route_map": {"type": "list"}, + "route_map": {"type": "list", "elements": "str"}, "timers": { "options": { "refresh": { diff --git a/plugins/module_utils/network/vyos/config/firewall_global/firewall_global.py b/plugins/module_utils/network/vyos/config/firewall_global/firewall_global.py index afc98538..f0356416 100644 --- a/plugins/module_utils/network/vyos/config/firewall_global/firewall_global.py +++ b/plugins/module_utils/network/vyos/config/firewall_global/firewall_global.py @@ -154,16 +154,16 @@ class Firewall_global(ConfigBase): commands.extend(self._state_replaced(w, h)) return commands - def _state_replaced(self, want, have): + def _state_replaced(self, w, h): """ The command generator when state is replaced :rtype: A list :returns: the commands necessary to migrate the current configuration to the desired configuration """ commands = [] - if have: - commands.extend(self._state_deleted(have, want)) - commands.extend(self._state_merged(want, have)) + if h: + commands.extend(self._state_deleted(h, w)) + commands.extend(self._state_merged(w, h)) return commands def _state_merged(self, want, have): @@ -275,7 +275,7 @@ class Firewall_global(ConfigBase): ) ) continue - elif ( + if ( key in l_set and not (h and self._in_target(h, key)) and not self._is_del(l_set, h) @@ -411,7 +411,7 @@ class Firewall_global(ConfigBase): ): commands.append(cmd + " " + want["name"]) continue - elif not ( + if not ( h and self._in_target(h, key) ) and not self._is_grp_del(h, want, key): commands.append( @@ -586,7 +586,7 @@ class Firewall_global(ConfigBase): ) ) continue - elif not ( + if not ( h and self._in_target(h, key) ) and not self._is_del(l_set, h): commands.append( diff --git a/plugins/module_utils/network/vyos/config/firewall_rules/firewall_rules.py b/plugins/module_utils/network/vyos/config/firewall_rules/firewall_rules.py index 5c377410..5e38cee5 100644 --- a/plugins/module_utils/network/vyos/config/firewall_rules/firewall_rules.py +++ b/plugins/module_utils/network/vyos/config/firewall_rules/firewall_rules.py @@ -376,7 +376,7 @@ class Firewall_rules(ConfigBase): ) ) continue - elif ( + if ( key == "disabled" and val and h diff --git a/plugins/module_utils/network/vyos/config/ospfv2/ospfv2.py b/plugins/module_utils/network/vyos/config/ospfv2/ospfv2.py index fd25c178..c0a4c785 100644 --- a/plugins/module_utils/network/vyos/config/ospfv2/ospfv2.py +++ b/plugins/module_utils/network/vyos/config/ospfv2/ospfv2.py @@ -766,7 +766,7 @@ class Ospfv2(ConfigBase): ): commands.append(cmd) continue - elif key != "area_id" and not _in_target( + if key != "area_id" and not _in_target( h_area, key ): commands.append(cmd + val + " " + key) diff --git a/plugins/module_utils/network/vyos/config/ospfv3/ospfv3.py b/plugins/module_utils/network/vyos/config/ospfv3/ospfv3.py index acda3801..09b92009 100644 --- a/plugins/module_utils/network/vyos/config/ospfv3/ospfv3.py +++ b/plugins/module_utils/network/vyos/config/ospfv3/ospfv3.py @@ -406,7 +406,7 @@ class Ospfv3(ConfigBase): ): commands.append(cmd) continue - elif key != "area_id" and not _in_target( + if key != "area_id" and not _in_target( h_area, key ): commands.append(cmd + val + " " + key) diff --git a/plugins/module_utils/network/vyos/facts/legacy/base.py b/plugins/module_utils/network/vyos/facts/legacy/base.py index f6b343e0..a4934217 100644 --- a/plugins/module_utils/network/vyos/facts/legacy/base.py +++ b/plugins/module_utils/network/vyos/facts/legacy/base.py @@ -126,7 +126,7 @@ class Neighbors(LegacyFactsBase): for line in data.split("\n"): if not line: continue - elif line[0] == " ": + if line[0] == " ": values += "\n%s" % line elif line.startswith("Interface"): if values: diff --git a/plugins/module_utils/network/vyos/vyos.py b/plugins/module_utils/network/vyos/vyos.py index 7257b85d..4ab36b9a 100644 --- a/plugins/module_utils/network/vyos/vyos.py +++ b/plugins/module_utils/network/vyos/vyos.py @@ -50,8 +50,11 @@ vyos_provider_spec = { } vyos_argument_spec = { "provider": dict( - type="dict", options=vyos_provider_spec, removed_in_version=2.14 - ), + type="dict", + options=vyos_provider_spec, + removed_at_date="2022-06-01", + removed_from_collection="vyos.vyos", + ) } |