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

breaking changes in netaddr #331

Closed
weehal opened this issue Feb 12, 2024 · 3 comments · Fixed by #338
Closed

breaking changes in netaddr #331

weehal opened this issue Feb 12, 2024 · 3 comments · Fixed by #338
Assignees

Comments

@weehal
Copy link

weehal commented Feb 12, 2024

SUMMARY

New release of Netaddr was released 2 days ago 1.0.0 with a breaking changes:

  • Remove the IPAddress.is_private method.
ISSUE TYPE
  • Bug Report
COMPONENT NAME

ansible.utils

ANSIBLE VERSION
ansible [core 2.16.3]
  config file = None
  configured module search path = ['/home/warf/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /usr/local/lib/python3.10/dist-packages/ansible
  ansible collection location = /home/warf/.ansible/collections:/usr/share/ansible/collections
  executable location = /usr/local/bin/ansible
  python version = 3.10.12 (main, Nov 20 2023, 15:14:05) [GCC 11.4.0] (/usr/bin/python3)
  jinja version = 3.1.3
  libyaml = True
COLLECTION VERSION
# /usr/local/lib/python3.10/dist-packages/ansible_collections
Collection    Version
------------- -------
ansible.utils 2.12.0
CONFIGURATION

OS / ENVIRONMENT
$ python3 -m pip freeze | grep netaddr
netaddr==1.0.0
STEPS TO REPRODUCE
pip3 install netaddr
EXPECTED RESULTS

PASS

ACTUAL RESULTS
An exception occurred during task execution. To see the full traceback, use -vvv. The error was: AttributeError: 'IPNetwork' object has no attribute 'is_private'
@weehal
Copy link
Author

weehal commented Feb 12, 2024

Workaround: downgrade netaddr

python3 -m pip install 'netaddr<1.0' 

@HappyFX
Copy link

HappyFX commented Feb 12, 2024

Also with bump version more problems

"hostvars[inventory_hostname]['ansible_' + interface]['ipv4']['address'] | ansible.utils.ipaddr('private')"
The conditional check 'hostvars[inventory_hostname]['ansible_' + interface]['ipv4']['address'] | ansible.utils.ipaddr('private')' failed. The error was: 'IPNetwork' object has no attribute 'is_private'

@rizlas
Copy link
Contributor

rizlas commented Mar 1, 2024

Proposed a PR that should resolve this issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants