Skip to content

Commit 9ea2dfe

Browse files
[pre-commit.ci] pre-commit autoupdate (ansible-collections#612)
updates: - [github.com/pre-commit/mirrors-prettier: v4.0.0-alpha.4 → v4.0.0-alpha.7](pre-commit/mirrors-prettier@v4.0.0-alpha.4...v4.0.0-alpha.7) - [github.com/PyCQA/isort: 5.13.0 → 5.13.2](PyCQA/isort@5.13.0...5.13.2) - [github.com/psf/black: 23.11.0 → 23.12.0](psf/black@23.11.0...23.12.0) Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
1 parent 34a1051 commit 9ea2dfe

File tree

3 files changed

+48
-20
lines changed

3 files changed

+48
-20
lines changed

.pre-commit-config.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ repos:
66
- id: update-docs
77

88
- repo: https://github.com/pre-commit/pre-commit-hooks
9-
rev: v4.5.0
9+
rev: v4.6.0
1010
hooks:
1111
- id: check-merge-conflict
1212
- id: debug-statements
@@ -29,7 +29,7 @@ repos:
2929
args: ["--filter-files"]
3030

3131
- repo: https://github.com/psf/black
32-
rev: 23.12.1
32+
rev: 24.4.2
3333
hooks:
3434
- id: black
3535

plugins/plugin_utils/pop_ace.py

Lines changed: 45 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -36,29 +36,56 @@ def check_match(ace, match_criteria, match_all, name, afi):
3636
for k, v in match_criteria.items():
3737
if v:
3838
if k not in ["source", "destination", "acl_name", "afi"]:
39-
check_arr.append(True) if ace.get(k, "NA") == match_criteria.get(
40-
k,
41-
) else check_arr.append(False)
39+
(
40+
check_arr.append(True)
41+
if ace.get(k, "NA")
42+
== match_criteria.get(
43+
k,
44+
)
45+
else check_arr.append(False)
46+
)
4247
elif k == "acl_name":
43-
check_arr.append(True) if name == match_criteria.get(
44-
k,
45-
) else check_arr.append(False)
48+
(
49+
check_arr.append(True)
50+
if name
51+
== match_criteria.get(
52+
k,
53+
)
54+
else check_arr.append(False)
55+
)
4656
elif k == "afi":
47-
check_arr.append(True) if afi == match_criteria.get(
48-
k,
49-
) else check_arr.append(False)
57+
(
58+
check_arr.append(True)
59+
if afi
60+
== match_criteria.get(
61+
k,
62+
)
63+
else check_arr.append(False)
64+
)
5065
else: # for source and destination address
5166
_sub = "source" if "source" in k else "destination"
5267
_valid = []
53-
_valid.append(True) if ace.get(_sub, {}).get("address", "NA") == match_criteria.get(
54-
k,
55-
) else _valid.append(False)
56-
_valid.append(True) if ace.get(_sub, {}).get("host", "NA") == match_criteria.get(
57-
k,
58-
) else _valid.append(False)
59-
_valid.append(True) if ace.get(_sub, {}).get("any", "NA") == (
60-
match_criteria.get(k) == "any"
61-
) else _valid.append(False)
68+
(
69+
_valid.append(True)
70+
if ace.get(_sub, {}).get("address", "NA")
71+
== match_criteria.get(
72+
k,
73+
)
74+
else _valid.append(False)
75+
)
76+
(
77+
_valid.append(True)
78+
if ace.get(_sub, {}).get("host", "NA")
79+
== match_criteria.get(
80+
k,
81+
)
82+
else _valid.append(False)
83+
)
84+
(
85+
_valid.append(True)
86+
if ace.get(_sub, {}).get("any", "NA") == (match_criteria.get(k) == "any")
87+
else _valid.append(False)
88+
)
6289
check_arr.append(any(_valid))
6390

6491
if match_all: # forces all criteria to match

plugins/sub_plugins/cli_parser/content_templates_parser.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
The parser functionality used by the network resource modules is leveraged here.
66
77
"""
8+
89
from __future__ import absolute_import, division, print_function
910

1011

0 commit comments

Comments
 (0)