fix: netaddr is_private method deprecation (#338)

* fix: netaddr is_private method deprecation

* Update ipaddr.yaml

* Fix integretion test

* Update ipaddr.yaml

* Update main.yaml

* changelog: add changelog fragment about netaddr deprecation

* netaddr minimum version

---------

Co-authored-by: Ashwini Mhatre <amhatre@redhat.com>
pull/340/head^2
rizlas 2024-03-13 17:14:50 +01:00 committed by GitHub
parent 754bf36055
commit c176c23392
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 9 additions and 4 deletions

View File

@ -0,0 +1,6 @@
---
minor_changes:
- Use netaddr is_global() function instead of the deprecated is_private() function.
(https://netaddr.readthedocs.io/en/latest/changes.html#release-1-0-0)
- Remove reserved IPv6 from integration test expected results.
- Set netaddr minimum version required to 0.10.1

View File

@ -289,7 +289,7 @@ def _previous_usable_query(v, vtype):
def _private_query(v, value): def _private_query(v, value):
if v.is_private(): if not v.ip.is_global():
return value return value
@ -298,7 +298,7 @@ def _public_query(v, value):
if all( if all(
[ [
v_ip.is_unicast(), v_ip.is_unicast(),
not v_ip.is_private(), v_ip.is_global(),
not v_ip.is_loopback(), not v_ip.is_loopback(),
not v_ip.is_netmask(), not v_ip.is_netmask(),
not v_ip.is_hostmask(), not v_ip.is_hostmask(),

View File

@ -2,4 +2,4 @@ jsonschema
textfsm textfsm
ttp ttp
xmltodict xmltodict
netaddr==0.10.1 netaddr>=0.10.1

View File

@ -26,7 +26,6 @@ ipaddr_result2:
ipaddr_result3: ipaddr_result3:
- 192.24.2.1 - 192.24.2.1
- 2001:db8:32c:faad::/64
ipaddr_result4: ipaddr_result4:
- 192.168.32.0/24 - 192.168.32.0/24