Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug453 port group #455

Open
wants to merge 19 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 5 commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
bd60ba2
Modifying the net-group use in docs, it will now be under the port-pr…
ntl-afzaalarif Nov 17, 2023
81f66b3
BugFix #453 modifying the arguments for source/destination so that po…
ntl-afzaalarif Nov 17, 2023
872a669
BugFix #453 modifying the config acls.py for source/destination so th…
ntl-afzaalarif Nov 17, 2023
b086166
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Nov 17, 2023
0d2e446
modified the error in doc for port_protocol option in src/dest
ntl-afzaalarif Nov 20, 2023
df839aa
Merge branch 'main' into bug453_port_group
roverflow Nov 23, 2023
e08a37e
Merge branch 'main' into bug453_port_group
ashwini-mhatre Nov 24, 2023
635dfd5
Added the unit test for port_group
ntl-afzaalarif Nov 24, 2023
609f41a
Added the unit test for port_group
ntl-afzaalarif Nov 24, 2023
e6f95f8
Added the unit test for port_group and also updated documentation
ntl-afzaalarif Nov 24, 2023
2c5854a
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Nov 24, 2023
22179c1
removed erros from test_iosxr_acls
ntl-afzaalarif Nov 24, 2023
d571894
Merge branch 'bug453_port_group' of https://github.com/ntl-afzaalarif…
ntl-afzaalarif Nov 24, 2023
284f2b8
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Nov 24, 2023
f71591b
Merge branch 'main' into bug453_port_group
ntl-afzaalarif Dec 2, 2023
29fed21
Merge branch 'main' into bug453_port_group
ashwini-mhatre Dec 29, 2023
0c46662
Merge branch 'main' into bug453_port_group
ashwini-mhatre Jan 31, 2024
0c515a1
Merge branch 'main' into bug453_port_group
Ruchip16 Apr 12, 2024
789f802
Merge branch 'main' into bug453_port_group
NilashishC Sep 2, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 4 additions & 6 deletions plugins/module_utils/network/iosxr/argspec/acls/acls.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,21 +60,18 @@ def __init__(self, **kwargs):
"host",
"prefix",
"net_group",
"port_group",
],
[
"wildcard_bits",
"any",
"host",
"prefix",
"net_group",
"port_group",
],
],
"options": {
"host": {"type": "str"},
"net_group": {"type": "str"},
"port_group": {"type": "str"},
"address": {"type": "str"},
"any": {"type": "bool"},
"prefix": {"type": "str"},
Expand All @@ -85,6 +82,7 @@ def __init__(self, **kwargs):
"gt",
"lt",
"neq",
"port_group",
"range",
],
],
Expand All @@ -93,6 +91,7 @@ def __init__(self, **kwargs):
"gt": {"type": "str"},
"lt": {"type": "str"},
"neq": {"type": "str"},
"port_group": {"type": "str"},
"range": {
"options": {
"end": {"type": "str"},
Expand Down Expand Up @@ -456,21 +455,18 @@ def __init__(self, **kwargs):
"host",
"prefix",
"net_group",
"port_group",
],
[
"wildcard_bits",
"any",
"host",
"prefix",
"net_group",
"port_group",
],
],
"options": {
"host": {"type": "str"},
"net_group": {"type": "str"},
"port_group": {"type": "str"},
"address": {"type": "str"},
"any": {"type": "bool"},
"prefix": {"type": "str"},
Expand All @@ -481,6 +477,7 @@ def __init__(self, **kwargs):
"gt",
"lt",
"neq",
"port_group",
"range",
],
],
Expand All @@ -489,6 +486,7 @@ def __init__(self, **kwargs):
"gt": {"type": "str"},
"lt": {"type": "str"},
"neq": {"type": "str"},
"port_group": {"type": "str"},
"range": {
"options": {
"end": {"type": "str"},
Expand Down
6 changes: 4 additions & 2 deletions plugins/module_utils/network/iosxr/config/acls/acls.py
Original file line number Diff line number Diff line change
Expand Up @@ -374,8 +374,6 @@ def _compute_src_dest(dir_dict):
cmd += "host {0} ".format(dir_dict["host"])
elif "net_group" in dir_dict:
cmd += "net-group {0} ".format(dir_dict["net_group"])
elif "port_group" in dir_dict:
cmd += "port-group {0} ".format(dir_dict["port_group"])
elif "prefix" in dir_dict:
cmd += "{0} ".format(dir_dict["prefix"])
else:
Expand All @@ -386,11 +384,15 @@ def _compute_src_dest(dir_dict):

if "port_protocol" in dir_dict:
protocol_range = dir_dict["port_protocol"].get("range")
port_group = dir_dict["port_protocol"].get("port_group")
if protocol_range:
cmd += "range {0} {1} ".format(
protocol_range["start"],
protocol_range["end"],
)
elif port_group:
for key, value in iteritems(dir_dict["port_protocol"]):
cmd += "port-group {1} ".format(key, value)
else:
for key, value in iteritems(dir_dict["port_protocol"]):
cmd += "{0} {1} ".format(key, value)
Expand Down
Loading