Skip to content

Commit

Permalink
Merge branch 'main' into epld-upgrade
Browse files Browse the repository at this point in the history
  • Loading branch information
peio42 authored Sep 6, 2024
2 parents 5ca2175 + 5f59da7 commit 4484c6c
Show file tree
Hide file tree
Showing 7 changed files with 107 additions and 13 deletions.
14 changes: 14 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,20 @@ Cisco Nxos Collection Release Notes

.. contents:: Topics

v9.2.1
======

Bugfixes
--------

- acls - Fix lookup of range port conversion from int to string to allow strings (https://github.com/ansible-collections/cisco.nxos/pull/888).
- facts - Fixes issue where the LLDP neighbor information returns an error when empty.

Documentation Changes
---------------------

- Includes a new support related section in the README.

v9.2.0
======

Expand Down
10 changes: 10 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,16 @@ The Cisco NX-OS connection plugins combined with Cisco NX-OS resource modules al
This collection has been tested against Cisco N9K-C9300v chassis running NX-OS 9.3.6.
The modules with full support for Cisco MDS are tested against NX-OS 8.4(1) on MDS Switches.

## Support

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).

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.

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).

For more information you can check the communication section below.

## Communication

* Join the Ansible forum:
Expand Down
14 changes: 14 additions & 0 deletions changelogs/changelog.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1221,3 +1221,17 @@ releases:
- fix_local_as.yaml
- fix_pylint.yaml
release_date: "2024-08-19"
9.2.1:
changes:
bugfixes:
- acls - Fix lookup of range port conversion from int to string to allow strings
(https://github.com/ansible-collections/cisco.nxos/pull/888).
- facts - Fixes issue where the LLDP neighbor information returns an error when
empty.
doc_changes:
- Includes a new support related section in the README.
fragments:
- bugfix_vrf_range_resolution.yml
- lldp_facts.yaml
- readme.yaml
release_date: "2024-08-29"
2 changes: 1 addition & 1 deletion galaxy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ readme: README.md
repository: https://github.com/ansible-collections/cisco.nxos
issues: https://github.com/ansible-collections/cisco.nxos/issues
tags: [cisco, nxos, networking, nxapi, netconf]
version: 9.2.0
version: 9.2.1
34 changes: 23 additions & 11 deletions plugins/module_utils/network/nxos/config/acls/acls.py
Original file line number Diff line number Diff line change
Expand Up @@ -242,17 +242,29 @@ def convert_values(self, want):
int(val)
]
else:
st = int(ace[x]["port_protocol"]["range"]["start"])
end = int(ace[x]["port_protocol"]["range"]["end"])

if st in port_protocol.keys():
ace[x]["port_protocol"]["range"]["start"] = (
port_protocol[st]
)
if end in port_protocol.keys():
ace[x]["port_protocol"]["range"]["end"] = (
port_protocol[end]
)
st = ace[x]["port_protocol"]["range"]["start"]
end = ace[x]["port_protocol"]["range"]["end"]

if st.isdigit():
if int(st) in port_protocol.keys():
ace[x]["port_protocol"]["range"]["start"] = (
port_protocol[int(st)]
)
else:
if st in port_protocol.keys():
ace[x]["port_protocol"]["range"]["start"] = (
port_protocol[st]
)
if end.isdigit():
if int(end) in port_protocol.keys():
ace[x]["port_protocol"]["range"]["end"] = (
port_protocol[int(end)]
)
else:
if end in port_protocol.keys():
ace[x]["port_protocol"]["range"]["end"] = (
port_protocol[end]
)
return want

def set_state(self, want, have):
Expand Down
7 changes: 6 additions & 1 deletion plugins/module_utils/network/nxos/facts/legacy/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -342,7 +342,12 @@ def populate_structured_ipv6_interfaces(self, data):

def populate_structured_neighbors_lldp(self, data):
objects = dict()
data = data["TABLE_nbor"]["ROW_nbor"]
try:
data = data["TABLE_nbor"]["ROW_nbor"]
except KeyError:
return (
objects # No neighbors found as the TABLE_nbor key is missing and return empty dict
)

if isinstance(data, dict):
data = [data]
Expand Down
39 changes: 39 additions & 0 deletions tests/unit/modules/network/nxos/test_nxos_acls.py
Original file line number Diff line number Diff line change
Expand Up @@ -990,3 +990,42 @@ def test_nxos_acls_ranges(self):
]
result = self.execute_module(changed=False)
self.assertEqual(result["gathered"], gathered)

def test_nxos_acls_protocol_conversion(self):
set_module_args(
dict(
config=[
dict(
afi="ipv4",
acls=[
dict(
name="SIPS_Automation_Test_ACL_Create",
aces=[
dict(
sequence=17,
grant="permit",
protocol="tcp",
source=dict(any=True),
destination=dict(
prefix="10.247.12.0/24",
port_protocol=dict(
range=dict(
start="ftp-data",
end=23,
),
),
),
),
],
),
],
),
],
state="merged",
),
)
commands = [
"ip access-list SIPS_Automation_Test_ACL_Create",
"17 permit tcp any 10.247.12.0/24 range ftp-data telnet",
]
self.execute_module(changed=True, commands=commands)

0 comments on commit 4484c6c

Please sign in to comment.