From a3368869f52947b530b3028405cb56e5860d8527 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Thu, 21 Nov 2024 23:35:32 +0000 Subject: [PATCH] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- .../module_utils/network/ios/config/ospfv2/ospfv2.py | 11 +++++++---- tests/unit/modules/network/ios/test_ios_ospfv2.py | 7 +++---- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/plugins/module_utils/network/ios/config/ospfv2/ospfv2.py b/plugins/module_utils/network/ios/config/ospfv2/ospfv2.py index 4ae54c254..dde6f2707 100644 --- a/plugins/module_utils/network/ios/config/ospfv2/ospfv2.py +++ b/plugins/module_utils/network/ios/config/ospfv2/ospfv2.py @@ -121,11 +121,14 @@ def generate_commands(self): if self.want: for entry in self.want.get("processes", []): entry = self._handle_deprecated(entry) - # remove set_interface from passive_intf if it already exists + # remove set_interface from passive_intf if it already exists passive_intf = entry.get("passive_interfaces", {}).get("interface", {}) - if passive_intf and any(h["process_id"] == entry["process_id"] and - h.get("passive_interfaces", {}).get("interface", {}).get("name") == passive_intf.get("name") - for h in self.have.get("processes", [])): + if passive_intf and any( + h["process_id"] == entry["process_id"] + and h.get("passive_interfaces", {}).get("interface", {}).get("name") + == passive_intf.get("name") + for h in self.have.get("processes", []) + ): passive_intf.pop("set_interface", None) wantd.update({(entry["process_id"], entry.get("vrf")): entry}) diff --git a/tests/unit/modules/network/ios/test_ios_ospfv2.py b/tests/unit/modules/network/ios/test_ios_ospfv2.py index dad047724..cc83545d4 100644 --- a/tests/unit/modules/network/ios/test_ios_ospfv2.py +++ b/tests/unit/modules/network/ios/test_ios_ospfv2.py @@ -1216,13 +1216,13 @@ def test_ios_ospfv2_set_interface_idempotent(self): network 10.140.2.0 0.0.0.255 area 0 network 10.140.5.0 0.0.0.255 area 0 """, - ) + ) set_module_args( dict( config=dict( processes=[ dict( - process_id="1", + process_id="1", router_id="1.1.1.1", network=[ dict( @@ -1242,7 +1242,7 @@ def test_ios_ospfv2_set_interface_idempotent(self): name=["GigabitEthernet1"], ), ), - vrf=None, + vrf=None, ), ], ), @@ -1251,4 +1251,3 @@ def test_ios_ospfv2_set_interface_idempotent(self): ) self.execute_module(changed=False, commands=[]) -