Skip to content

Commit

Permalink
BugFix ansible-collections#453 modifying the config acls.py for sourc…
Browse files Browse the repository at this point in the history
…e/destination so that port-group is not direct opton of src/dest instead added port-group to argument of port_protocol
  • Loading branch information
ntl-afzaalarif committed Nov 17, 2023
1 parent 81f66b3 commit 872a669
Showing 1 changed file with 4 additions and 2 deletions.
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

0 comments on commit 872a669

Please sign in to comment.