Skip to content

Commit e9decdf

Browse files
authored
Merge branch 'main' into epld-upgrade
2 parents a7a592b + 5f59da7 commit e9decdf

File tree

7 files changed

+107
-13
lines changed

7 files changed

+107
-13
lines changed

CHANGELOG.rst

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,20 @@ Cisco Nxos Collection Release Notes
44

55
.. contents:: Topics
66

7+
v9.2.1
8+
======
9+
10+
Bugfixes
11+
--------
12+
13+
- acls - Fix lookup of range port conversion from int to string to allow strings (https://github.com/ansible-collections/cisco.nxos/pull/888).
14+
- facts - Fixes issue where the LLDP neighbor information returns an error when empty.
15+
16+
Documentation Changes
17+
---------------------
18+
19+
- Includes a new support related section in the README.
20+
721
v9.2.0
822
======
923

README.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,16 @@ The Cisco NX-OS connection plugins combined with Cisco NX-OS resource modules al
99
This collection has been tested against Cisco N9K-C9300v chassis running NX-OS 9.3.6.
1010
The modules with full support for Cisco MDS are tested against NX-OS 8.4(1) on MDS Switches.
1111

12+
## Support
13+
14+
As a Red Hat Ansible [Certified Content](https://catalog.redhat.com/software/search?target_platforms=Red%20Hat%20Ansible%20Automation%20Platform), this collection is entitled to [support](https://access.redhat.com/support/) through [Ansible Automation Platform](https://www.redhat.com/en/technologies/management/ansible) (AAP).
15+
16+
If a support case cannot be opened with Red Hat and the collection has been obtained either from [Galaxy](https://galaxy.ansible.com/ui/) or [GitHub](https://github.com/ansible-collections/cisco.nxos), there is community support available at no charge.
17+
18+
You can join us on [#network:ansible.com](https://matrix.to/#/#network:ansible.com) room or the [Ansible Forum Network Working Group](https://forum.ansible.com/g/network-wg).
19+
20+
For more information you can check the communication section below.
21+
1222
## Communication
1323

1424
* Join the Ansible forum:

changelogs/changelog.yaml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1221,3 +1221,17 @@ releases:
12211221
- fix_local_as.yaml
12221222
- fix_pylint.yaml
12231223
release_date: "2024-08-19"
1224+
9.2.1:
1225+
changes:
1226+
bugfixes:
1227+
- acls - Fix lookup of range port conversion from int to string to allow strings
1228+
(https://github.com/ansible-collections/cisco.nxos/pull/888).
1229+
- facts - Fixes issue where the LLDP neighbor information returns an error when
1230+
empty.
1231+
doc_changes:
1232+
- Includes a new support related section in the README.
1233+
fragments:
1234+
- bugfix_vrf_range_resolution.yml
1235+
- lldp_facts.yaml
1236+
- readme.yaml
1237+
release_date: "2024-08-29"

galaxy.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,4 @@ readme: README.md
1010
repository: https://github.com/ansible-collections/cisco.nxos
1111
issues: https://github.com/ansible-collections/cisco.nxos/issues
1212
tags: [cisco, nxos, networking, nxapi, netconf]
13-
version: 9.2.0
13+
version: 9.2.1

plugins/module_utils/network/nxos/config/acls/acls.py

Lines changed: 23 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -242,17 +242,29 @@ def convert_values(self, want):
242242
int(val)
243243
]
244244
else:
245-
st = int(ace[x]["port_protocol"]["range"]["start"])
246-
end = int(ace[x]["port_protocol"]["range"]["end"])
247-
248-
if st in port_protocol.keys():
249-
ace[x]["port_protocol"]["range"]["start"] = (
250-
port_protocol[st]
251-
)
252-
if end in port_protocol.keys():
253-
ace[x]["port_protocol"]["range"]["end"] = (
254-
port_protocol[end]
255-
)
245+
st = ace[x]["port_protocol"]["range"]["start"]
246+
end = ace[x]["port_protocol"]["range"]["end"]
247+
248+
if st.isdigit():
249+
if int(st) in port_protocol.keys():
250+
ace[x]["port_protocol"]["range"]["start"] = (
251+
port_protocol[int(st)]
252+
)
253+
else:
254+
if st in port_protocol.keys():
255+
ace[x]["port_protocol"]["range"]["start"] = (
256+
port_protocol[st]
257+
)
258+
if end.isdigit():
259+
if int(end) in port_protocol.keys():
260+
ace[x]["port_protocol"]["range"]["end"] = (
261+
port_protocol[int(end)]
262+
)
263+
else:
264+
if end in port_protocol.keys():
265+
ace[x]["port_protocol"]["range"]["end"] = (
266+
port_protocol[end]
267+
)
256268
return want
257269

258270
def set_state(self, want, have):

plugins/module_utils/network/nxos/facts/legacy/base.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -342,7 +342,12 @@ def populate_structured_ipv6_interfaces(self, data):
342342

343343
def populate_structured_neighbors_lldp(self, data):
344344
objects = dict()
345-
data = data["TABLE_nbor"]["ROW_nbor"]
345+
try:
346+
data = data["TABLE_nbor"]["ROW_nbor"]
347+
except KeyError:
348+
return (
349+
objects # No neighbors found as the TABLE_nbor key is missing and return empty dict
350+
)
346351

347352
if isinstance(data, dict):
348353
data = [data]

tests/unit/modules/network/nxos/test_nxos_acls.py

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -990,3 +990,42 @@ def test_nxos_acls_ranges(self):
990990
]
991991
result = self.execute_module(changed=False)
992992
self.assertEqual(result["gathered"], gathered)
993+
994+
def test_nxos_acls_protocol_conversion(self):
995+
set_module_args(
996+
dict(
997+
config=[
998+
dict(
999+
afi="ipv4",
1000+
acls=[
1001+
dict(
1002+
name="SIPS_Automation_Test_ACL_Create",
1003+
aces=[
1004+
dict(
1005+
sequence=17,
1006+
grant="permit",
1007+
protocol="tcp",
1008+
source=dict(any=True),
1009+
destination=dict(
1010+
prefix="10.247.12.0/24",
1011+
port_protocol=dict(
1012+
range=dict(
1013+
start="ftp-data",
1014+
end=23,
1015+
),
1016+
),
1017+
),
1018+
),
1019+
],
1020+
),
1021+
],
1022+
),
1023+
],
1024+
state="merged",
1025+
),
1026+
)
1027+
commands = [
1028+
"ip access-list SIPS_Automation_Test_ACL_Create",
1029+
"17 permit tcp any 10.247.12.0/24 range ftp-data telnet",
1030+
]
1031+
self.execute_module(changed=True, commands=commands)

0 commit comments

Comments
 (0)