Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed Dec 15, 2023
1 parent fbd0e75 commit 0330bcc
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
8 changes: 6 additions & 2 deletions plugins/module_utils/network/ios/config/acls/acls.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,8 +121,12 @@ def rearrange_cmds(aces):
acl_type = wentry["acl_type"] if wentry.get("acl_type") else hentry.get("acl_type")
# If ACLs type is different between existing and wanted ACL, we need first remove it
if acl_type != hentry.get("acl_type", acl_type):
self.commands.append("no " + self.acl_name_cmd(wname, afi, hentry.get("acl_type", "")))
hentry.pop("aces", {}) # We remove ACEs because we have previously add a command to suppress completely the ACL
self.commands.append(
"no " + self.acl_name_cmd(wname, afi, hentry.get("acl_type", ""))
)
hentry.pop(
"aces", {}
) # We remove ACEs because we have previously add a command to suppress completely the ACL

begin = len(self.commands) # to determine the index for acl command
self._compare_aces(
Expand Down
4 changes: 2 additions & 2 deletions tests/unit/modules/network/ios/test_ios_acls.py
Original file line number Diff line number Diff line change
Expand Up @@ -633,7 +633,7 @@ def test_ios_acls_replaced_idempotent(self):
Extended IP access list test-idem
Extended IP access list test_pre
IPv6 access list R1_TRAFFIC
"""
""",
)
set_module_args(
dict(
Expand Down Expand Up @@ -737,7 +737,7 @@ def test_ios_acls_replaced_idempotent(self):
},
},
],
}
},
],
},
{
Expand Down

0 comments on commit 0330bcc

Please sign in to comment.