ansible-collections / ansible.utils

A collection of ansible utilities for the content creator.
GNU General Public License v3.0
75 stars 78 forks source link

breaking changes in netaddr #331

Closed weehal closed 8 months ago

weehal commented 9 months ago
SUMMARY

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

ISSUE TYPE
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 commented 9 months ago

Workaround: downgrade netaddr

python3 -m pip install 'netaddr<1.0' 
HappyFX commented 9 months ago

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 commented 8 months ago

Proposed a PR that should resolve this issue