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

fix: netaddr is_private method deprecation #338

Merged
merged 7 commits into from
Mar 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
6 changes: 6 additions & 0 deletions changelogs/fragments/netaddr_is_private_deprecation.yaml
Original file line number Diff line number Diff line change
@@ -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
4 changes: 2 additions & 2 deletions plugins/plugin_utils/base/ipaddr_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,7 @@ def _previous_usable_query(v, vtype):


def _private_query(v, value):
if v.is_private():
if not v.ip.is_global():
return value


Expand All @@ -298,7 +298,7 @@ def _public_query(v, value):
if all(
[
v_ip.is_unicast(),
not v_ip.is_private(),
v_ip.is_global(),
not v_ip.is_loopback(),
not v_ip.is_netmask(),
not v_ip.is_hostmask(),
Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ jsonschema
textfsm
ttp
xmltodict
netaddr==0.10.1
netaddr>=0.10.1
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ ipaddr_result2:

ipaddr_result3:
- 192.24.2.1
- 2001:db8:32c:faad::/64

ipaddr_result4:
- 192.168.32.0/24
Expand Down
Loading