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 /plugins/module_utils | |
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>
Diffstat (limited to 'plugins/module_utils')
6 files changed, 7 insertions, 16 deletions
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) |