diff options
author | pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> | 2023-02-08 08:16:23 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-02-08 08:16:23 -0500 |
commit | 5dc5a62c8479222b9fd3c09cd482177f863fa837 (patch) | |
tree | 15d8d6240043fb4d276c5921765753167a0d2dbb | |
parent | dac4b610c8a0dd67fad408649d855b8384017ddd (diff) | |
download | vyos-ansible-collection-5dc5a62c8479222b9fd3c09cd482177f863fa837.tar.gz vyos-ansible-collection-5dc5a62c8479222b9fd3c09cd482177f863fa837.zip |
[pre-commit.ci] pre-commit autoupdate (#291)
* [pre-commit.ci] pre-commit autoupdate
updates:
- [github.com/psf/black: 22.12.0 → 23.1.0](https://github.com/psf/black/compare/22.12.0...23.1.0)
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
---------
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
34 files changed, 8 insertions, 47 deletions
diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index b635fa6..9737666 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -30,6 +30,6 @@ repos: args: ["--filter-files"] - repo: https://github.com/psf/black - rev: 22.12.0 + rev: 23.1.0 hooks: - id: black diff --git a/plugins/doc_fragments/vyos.py b/plugins/doc_fragments/vyos.py index c6abc21..698d0f5 100644 --- a/plugins/doc_fragments/vyos.py +++ b/plugins/doc_fragments/vyos.py @@ -8,7 +8,6 @@ __metaclass__ = type class ModuleDocFragment(object): - # Standard files documentation fragment DOCUMENTATION = r"""options: {} notes: diff --git a/plugins/module_utils/network/vyos/config/bgp_global/bgp_global.py b/plugins/module_utils/network/vyos/config/bgp_global/bgp_global.py index 96c640f..55eca49 100644 --- a/plugins/module_utils/network/vyos/config/bgp_global/bgp_global.py +++ b/plugins/module_utils/network/vyos/config/bgp_global/bgp_global.py @@ -136,7 +136,6 @@ class Bgp_global(ResourceModule): self.commands = command_set def _compare_neighbor(self, want, have): - parsers = [ "neighbor.advertisement_interval", "neighbor.allowas_in", diff --git a/plugins/module_utils/network/vyos/config/ntp_global/ntp_global.py b/plugins/module_utils/network/vyos/config/ntp_global/ntp_global.py index cd677d4..3ce6ec2 100644 --- a/plugins/module_utils/network/vyos/config/ntp_global/ntp_global.py +++ b/plugins/module_utils/network/vyos/config/ntp_global/ntp_global.py @@ -105,7 +105,6 @@ class Ntp_global(ResourceModule): # Getting the list of the server names from haved # to avoid the duplication of overridding/replacing the servers if self.state in ["overridden", "replaced"]: - commandlist = self._commandlist(haved) servernames = self._servernames(haved) diff --git a/plugins/module_utils/network/vyos/config/ospfv2/ospfv2.py b/plugins/module_utils/network/vyos/config/ospfv2/ospfv2.py index 9287fbc..dedc241 100644 --- a/plugins/module_utils/network/vyos/config/ospfv2/ospfv2.py +++ b/plugins/module_utils/network/vyos/config/ospfv2/ospfv2.py @@ -218,7 +218,7 @@ class Ospfv2(ConfigBase): w = deepcopy(remove_empties(want)) leaf = ("default_metric", "log_adjacency_changes") if w: - for (key, val) in iteritems(w): + for key, val in iteritems(w): if opr and key in leaf and not _is_w_same(w, have, key): commands.append(self._form_attr_cmd(attr=key, val=_bool_to_str(val), opr=opr)) elif not opr and key in leaf and not _in_target(have, key): @@ -287,7 +287,7 @@ class Ospfv2(ConfigBase): ), } leaf = leaf_dict[attr] - for (item, value) in iteritems(want[attr]): + for item, value in iteritems(want[attr]): if opr and item in leaf and not _is_w_same(want[attr], h, item): if item == "enabled": item = "enable" @@ -383,7 +383,7 @@ class Ospfv2(ConfigBase): commands.append(cmd + attr.replace("_", "-")) elif w: for w_item in w: - for (key, val) in iteritems(w_item): + for key, val in iteritems(w_item): if not cmd: cmd = self._compute_command(opr=opr) h_item = self.search_obj_in_have(h, w_item, name[attr]) @@ -491,7 +491,7 @@ class Ospfv2(ConfigBase): commands.append(self._compute_command(attr=attr, opr=opr)) elif w: for w_item in w: - for (key, val) in iteritems(w_item): + for key, val in iteritems(w_item): if not cmd: cmd = self._compute_command(opr=opr) h_item = self.search_obj_in_have(h, w_item, name[attr]) @@ -588,7 +588,7 @@ class Ospfv2(ConfigBase): leaf = leaf_dict[attr] if h and key in h.keys(): h_attrib = h.get(key) or {} - for (item, val) in iteritems(w[key]): + for item, val in iteritems(w[key]): if opr and item in leaf and not _is_w_same(w[key], h_attrib, item): if item in ("administrative", "always") and val: commands.append( @@ -611,7 +611,6 @@ class Ospfv2(ConfigBase): + str(val) ) elif not opr and item in leaf and not _in_target(h_attrib, item): - commands.append(cmd + attr + " " + item) return commands @@ -650,7 +649,7 @@ class Ospfv2(ConfigBase): self._form_attr_cmd(key="area", attr=w_area["area_id"], opr=opr) ) else: - for (key, val) in iteritems(w_area): + for key, val in iteritems(w_area): if opr and key in l_set and not _is_w_same(w_area, h_area, key): if key == "area_id": commands.append( @@ -723,7 +722,7 @@ class Ospfv2(ConfigBase): if w_area: if h_type and key in h_type.keys(): h_area = h_type.get(key) or {} - for (item, val) in iteritems(w_type[key]): + for item, val in iteritems(w_type[key]): if ( opr and item in a_type[key] diff --git a/plugins/module_utils/network/vyos/facts/interfaces/interfaces.py b/plugins/module_utils/network/vyos/facts/interfaces/interfaces.py index c9479db..9fd00c1 100644 --- a/plugins/module_utils/network/vyos/facts/interfaces/interfaces.py +++ b/plugins/module_utils/network/vyos/facts/interfaces/interfaces.py @@ -43,7 +43,6 @@ class InterfacesFacts(object): self.generated_spec = utils.generate_dict(facts_argument_spec) def get_device_data(self, connection): - data = connection.get_config(flags=["| grep interfaces"]) return data diff --git a/plugins/module_utils/network/vyos/facts/legacy/base.py b/plugins/module_utils/network/vyos/facts/legacy/base.py index 719df3f..59666e1 100644 --- a/plugins/module_utils/network/vyos/facts/legacy/base.py +++ b/plugins/module_utils/network/vyos/facts/legacy/base.py @@ -22,7 +22,6 @@ from ansible_collections.vyos.vyos.plugins.module_utils.network.vyos.vyos import class LegacyFactsBase(object): - COMMANDS = frozenset() def __init__(self, module): @@ -36,7 +35,6 @@ class LegacyFactsBase(object): class Default(LegacyFactsBase): - COMMANDS = [ "show version", ] @@ -72,7 +70,6 @@ class Default(LegacyFactsBase): class Config(LegacyFactsBase): - COMMANDS = [ "show configuration commands", "show system commit", @@ -107,7 +104,6 @@ class Config(LegacyFactsBase): class Neighbors(LegacyFactsBase): - COMMANDS = [ "show lldp neighbors", "show lldp neighbors detail", diff --git a/plugins/module_utils/network/vyos/facts/ospfv2/ospfv2.py b/plugins/module_utils/network/vyos/facts/ospfv2/ospfv2.py index 4dcd546..a5c4636 100644 --- a/plugins/module_utils/network/vyos/facts/ospfv2/ospfv2.py +++ b/plugins/module_utils/network/vyos/facts/ospfv2/ospfv2.py @@ -33,7 +33,6 @@ class Ospfv2Facts(object): subspec="config", options="options", ): - self._module = module self.argument_spec = Ospfv2Args.argument_spec spec = deepcopy(self.argument_spec) diff --git a/plugins/modules/vyos_vlan.py b/plugins/modules/vyos_vlan.py index de20d87..f3e3dc8 100644 --- a/plugins/modules/vyos_vlan.py +++ b/plugins/modules/vyos_vlan.py @@ -299,7 +299,6 @@ def map_config_to_obj(module): def check_declarative_intent_params(want, module, result): - have = None obj_interface = list() is_delay = False diff --git a/plugins/terminal/vyos.py b/plugins/terminal/vyos.py index b9e84d7..d5d57e7 100644 --- a/plugins/terminal/vyos.py +++ b/plugins/terminal/vyos.py @@ -28,7 +28,6 @@ from ansible_collections.ansible.netcommon.plugins.plugin_utils.terminal_base im class TerminalModule(TerminalBase): - terminal_stdout_re = [ re.compile(rb"[\r\n]?[\w+\-\.:\/\[\]]+(?:\([^\)]+\)){,3}(?:>|#) ?$"), re.compile(rb"\@[\w\-\.]+:\S+?[>#\$] ?$"), diff --git a/tests/unit/compat/mock.py b/tests/unit/compat/mock.py index 4bef4c2..2c62c9e 100644 --- a/tests/unit/compat/mock.py +++ b/tests/unit/compat/mock.py @@ -102,7 +102,6 @@ if sys.version_info >= (3,) and sys.version_info < (3, 4, 4): global file_spec if file_spec is None: - file_spec = list(set(dir(_io.TextIOWrapper)).union(set(dir(_io.BytesIO)))) if mock is None: diff --git a/tests/unit/modules/network/vyos/test_vyos_banner.py b/tests/unit/modules/network/vyos/test_vyos_banner.py index 08d4424..1d6738c 100644 --- a/tests/unit/modules/network/vyos/test_vyos_banner.py +++ b/tests/unit/modules/network/vyos/test_vyos_banner.py @@ -26,7 +26,6 @@ from .vyos_module import TestVyosModule class TestVyosBannerModule(TestVyosModule): - module = vyos_banner def setUp(self): diff --git a/tests/unit/modules/network/vyos/test_vyos_bgp_address_family.py b/tests/unit/modules/network/vyos/test_vyos_bgp_address_family.py index a9f0ef1..0bbf74a 100644 --- a/tests/unit/modules/network/vyos/test_vyos_bgp_address_family.py +++ b/tests/unit/modules/network/vyos/test_vyos_bgp_address_family.py @@ -28,7 +28,6 @@ from .vyos_module import TestVyosModule, load_fixture class TestVyosBgpafModule(TestVyosModule): - module = vyos_bgp_address_family def setUp(self): diff --git a/tests/unit/modules/network/vyos/test_vyos_bgp_global.py b/tests/unit/modules/network/vyos/test_vyos_bgp_global.py index 23f2e6a..d0167de 100644 --- a/tests/unit/modules/network/vyos/test_vyos_bgp_global.py +++ b/tests/unit/modules/network/vyos/test_vyos_bgp_global.py @@ -28,7 +28,6 @@ from .vyos_module import TestVyosModule, load_fixture class TestVyosBgpglobalModule(TestVyosModule): - module = vyos_bgp_global def setUp(self): @@ -432,7 +431,6 @@ class TestVyosBgpglobalModule(TestVyosModule): ) def test_vyos_bgp_global_parsed(self): - commands = [ "set protocols bgp 65536 neighbor 10.0.0.4 disable-connected-check", "set protocols bgp 65536 neighbor 10.0.0.4 timers holdtime 30", diff --git a/tests/unit/modules/network/vyos/test_vyos_command.py b/tests/unit/modules/network/vyos/test_vyos_command.py index e03ea7d..5479bbb 100644 --- a/tests/unit/modules/network/vyos/test_vyos_command.py +++ b/tests/unit/modules/network/vyos/test_vyos_command.py @@ -28,7 +28,6 @@ from .vyos_module import TestVyosModule, load_fixture class TestVyosCommandModule(TestVyosModule): - module = vyos_command def setUp(self): diff --git a/tests/unit/modules/network/vyos/test_vyos_config.py b/tests/unit/modules/network/vyos/test_vyos_config.py index def567a..ca949c6 100644 --- a/tests/unit/modules/network/vyos/test_vyos_config.py +++ b/tests/unit/modules/network/vyos/test_vyos_config.py @@ -30,7 +30,6 @@ from .vyos_module import TestVyosModule, load_fixture class TestVyosConfigModule(TestVyosModule): - module = vyos_config def setUp(self): diff --git a/tests/unit/modules/network/vyos/test_vyos_firewall_global.py b/tests/unit/modules/network/vyos/test_vyos_firewall_global.py index 367da22..8164768 100644 --- a/tests/unit/modules/network/vyos/test_vyos_firewall_global.py +++ b/tests/unit/modules/network/vyos/test_vyos_firewall_global.py @@ -28,7 +28,6 @@ from .vyos_module import TestVyosModule, load_fixture class TestVyosFirewallRulesModule(TestVyosModule): - module = vyos_firewall_global def setUp(self): diff --git a/tests/unit/modules/network/vyos/test_vyos_firewall_interfaces.py b/tests/unit/modules/network/vyos/test_vyos_firewall_interfaces.py index fe64659..acb9894 100644 --- a/tests/unit/modules/network/vyos/test_vyos_firewall_interfaces.py +++ b/tests/unit/modules/network/vyos/test_vyos_firewall_interfaces.py @@ -28,7 +28,6 @@ from .vyos_module import TestVyosModule, load_fixture class TestVyosFirewallInterfacesModule(TestVyosModule): - module = vyos_firewall_interfaces def setUp(self): diff --git a/tests/unit/modules/network/vyos/test_vyos_firewall_rules.py b/tests/unit/modules/network/vyos/test_vyos_firewall_rules.py index 623ab1e..7952b47 100644 --- a/tests/unit/modules/network/vyos/test_vyos_firewall_rules.py +++ b/tests/unit/modules/network/vyos/test_vyos_firewall_rules.py @@ -28,7 +28,6 @@ from .vyos_module import TestVyosModule, load_fixture class TestVyosFirewallRulesModule(TestVyosModule): - module = vyos_firewall_rules def setUp(self): diff --git a/tests/unit/modules/network/vyos/test_vyos_hostname.py b/tests/unit/modules/network/vyos/test_vyos_hostname.py index 13d4e32..3df9a17 100644 --- a/tests/unit/modules/network/vyos/test_vyos_hostname.py +++ b/tests/unit/modules/network/vyos/test_vyos_hostname.py @@ -28,7 +28,6 @@ from .vyos_module import TestVyosModule, load_fixture class TestVyosHostnameModule(TestVyosModule): - module = vyos_hostname def setUp(self): diff --git a/tests/unit/modules/network/vyos/test_vyos_interfaces.py b/tests/unit/modules/network/vyos/test_vyos_interfaces.py index 1595040..ea6dbf5 100644 --- a/tests/unit/modules/network/vyos/test_vyos_interfaces.py +++ b/tests/unit/modules/network/vyos/test_vyos_interfaces.py @@ -28,7 +28,6 @@ from .vyos_module import TestVyosModule, load_fixture class TestVyosFirewallInterfacesModule(TestVyosModule): - module = vyos_interfaces def setUp(self): diff --git a/tests/unit/modules/network/vyos/test_vyos_logging_global.py b/tests/unit/modules/network/vyos/test_vyos_logging_global.py index 12da571..f1ab00d 100644 --- a/tests/unit/modules/network/vyos/test_vyos_logging_global.py +++ b/tests/unit/modules/network/vyos/test_vyos_logging_global.py @@ -17,7 +17,6 @@ from .vyos_module import TestVyosModule class TestVyosLoggingGlobalModule(TestVyosModule): - module = vyos_logging_global def setUp(self): diff --git a/tests/unit/modules/network/vyos/test_vyos_ntp_global.py b/tests/unit/modules/network/vyos/test_vyos_ntp_global.py index 0a6119b..5da1056 100644 --- a/tests/unit/modules/network/vyos/test_vyos_ntp_global.py +++ b/tests/unit/modules/network/vyos/test_vyos_ntp_global.py @@ -28,7 +28,6 @@ from .vyos_module import TestVyosModule, load_fixture class TestVyosNTPModule(TestVyosModule): - module = vyos_ntp_global def setUp(self): @@ -274,7 +273,6 @@ class TestVyosNTPModule(TestVyosModule): ) def test_ntp_parsed(self): - commands = ( "set system ntp allow-clients address 10.7.7.0/24", "set system ntp allow-clients address 10.6.7.0/24", diff --git a/tests/unit/modules/network/vyos/test_vyos_ospf_interfaces.py b/tests/unit/modules/network/vyos/test_vyos_ospf_interfaces.py index e8c3241..74eaf7c 100644 --- a/tests/unit/modules/network/vyos/test_vyos_ospf_interfaces.py +++ b/tests/unit/modules/network/vyos/test_vyos_ospf_interfaces.py @@ -28,7 +28,6 @@ from .vyos_module import TestVyosModule, load_fixture class TestVyosOspfInterfacesModule(TestVyosModule): - module = vyos_ospf_interfaces def setUp(self): diff --git a/tests/unit/modules/network/vyos/test_vyos_ospfv2.py b/tests/unit/modules/network/vyos/test_vyos_ospfv2.py index e036f68..84b882d 100644 --- a/tests/unit/modules/network/vyos/test_vyos_ospfv2.py +++ b/tests/unit/modules/network/vyos/test_vyos_ospfv2.py @@ -28,7 +28,6 @@ from .vyos_module import TestVyosModule, load_fixture class TestVyosOspfv2Module(TestVyosModule): - module = vyos_ospfv2 def setUp(self): diff --git a/tests/unit/modules/network/vyos/test_vyos_ospfv3.py b/tests/unit/modules/network/vyos/test_vyos_ospfv3.py index d04b7f7..2231c0b 100644 --- a/tests/unit/modules/network/vyos/test_vyos_ospfv3.py +++ b/tests/unit/modules/network/vyos/test_vyos_ospfv3.py @@ -28,7 +28,6 @@ from .vyos_module import TestVyosModule, load_fixture class TestVyosOspfv3Module(TestVyosModule): - module = vyos_ospfv3 def setUp(self): diff --git a/tests/unit/modules/network/vyos/test_vyos_ping.py b/tests/unit/modules/network/vyos/test_vyos_ping.py index ea8d259..612e50c 100644 --- a/tests/unit/modules/network/vyos/test_vyos_ping.py +++ b/tests/unit/modules/network/vyos/test_vyos_ping.py @@ -28,7 +28,6 @@ from .vyos_module import TestVyosModule, load_fixture class TestVyosPingModule(TestVyosModule): - module = vyos_ping def setUp(self): diff --git a/tests/unit/modules/network/vyos/test_vyos_prefix_lists.py b/tests/unit/modules/network/vyos/test_vyos_prefix_lists.py index e8d044d..dafba2a 100644 --- a/tests/unit/modules/network/vyos/test_vyos_prefix_lists.py +++ b/tests/unit/modules/network/vyos/test_vyos_prefix_lists.py @@ -30,7 +30,6 @@ from .vyos_module import TestVyosModule class TestVyosPrefixListsModule(TestVyosModule): - # Testing strategy # ------------------ # (a) The unit tests cover `merged` and `replaced` for every attribute. diff --git a/tests/unit/modules/network/vyos/test_vyos_route_maps.py b/tests/unit/modules/network/vyos/test_vyos_route_maps.py index 6b50ad5..9d3c71a 100644 --- a/tests/unit/modules/network/vyos/test_vyos_route_maps.py +++ b/tests/unit/modules/network/vyos/test_vyos_route_maps.py @@ -28,7 +28,6 @@ from .vyos_module import TestVyosModule, load_fixture class TestVyosRouteMapsModule(TestVyosModule): - module = vyos_route_maps def setUp(self): @@ -460,7 +459,6 @@ class TestVyosRouteMapsModule(TestVyosModule): ) def test_yos_route_maps_parsed(self): - parsed_str = ( "set policy route-map test3 rule 1 action 'permit'" "\nset policy route-map test3 rule 1 match interface 'eth2'\nset policy route-map test3 rule 1 match ipv6 nexthop" diff --git a/tests/unit/modules/network/vyos/test_vyos_snmp_server.py b/tests/unit/modules/network/vyos/test_vyos_snmp_server.py index 60a0746..73e29f6 100644 --- a/tests/unit/modules/network/vyos/test_vyos_snmp_server.py +++ b/tests/unit/modules/network/vyos/test_vyos_snmp_server.py @@ -28,7 +28,6 @@ from .vyos_module import TestVyosModule, load_fixture class TestVyosSnmpServerModule(TestVyosModule): - module = vyos_snmp_server def setUp(self): diff --git a/tests/unit/modules/network/vyos/test_vyos_static_routes.py b/tests/unit/modules/network/vyos/test_vyos_static_routes.py index df25992..3479009 100644 --- a/tests/unit/modules/network/vyos/test_vyos_static_routes.py +++ b/tests/unit/modules/network/vyos/test_vyos_static_routes.py @@ -28,7 +28,6 @@ from .vyos_module import TestVyosModule, load_fixture class TestVyosStaticRoutesModule(TestVyosModule): - module = vyos_static_routes def setUp(self): diff --git a/tests/unit/modules/network/vyos/test_vyos_system.py b/tests/unit/modules/network/vyos/test_vyos_system.py index 3665720..03ef3df 100644 --- a/tests/unit/modules/network/vyos/test_vyos_system.py +++ b/tests/unit/modules/network/vyos/test_vyos_system.py @@ -28,7 +28,6 @@ from .vyos_module import TestVyosModule, load_fixture class TestVyosSystemModule(TestVyosModule): - module = vyos_system def setUp(self): diff --git a/tests/unit/modules/network/vyos/test_vyos_user.py b/tests/unit/modules/network/vyos/test_vyos_user.py index 5a1f69f..57639d1 100644 --- a/tests/unit/modules/network/vyos/test_vyos_user.py +++ b/tests/unit/modules/network/vyos/test_vyos_user.py @@ -28,7 +28,6 @@ from .vyos_module import TestVyosModule, load_fixture class TestVyosUserModule(TestVyosModule): - module = vyos_user def setUp(self): diff --git a/tests/unit/modules/network/vyos/vyos_module.py b/tests/unit/modules/network/vyos/vyos_module.py index 98a422d..b1bdc2e 100644 --- a/tests/unit/modules/network/vyos/vyos_module.py +++ b/tests/unit/modules/network/vyos/vyos_module.py @@ -61,7 +61,6 @@ class TestVyosModule(ModuleTestCase): defaults=False, filename=None, ): - if filename is None: self.load_fixtures(commands) else: |