Default flag change in netaddr breaks (at least) unit tests
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
neutron |
In Progress
|
High
|
Dr. Jens Harbott |
Bug Description
netaddr 1.0.0 changed the default parsing mode from INET_ATON to INET_PTON[1]. This was initially added to netaddr.IPAddress and then later was applied to netaddr.IPNetwork in 1.1.0 [2]
While we attempted to bump netaddr to 1.0.1, we noticed this change broke some of the unit tests in neutron.
https:/
(example)
```
neutron.
-------
Captured traceback:
~~~~~~~~~~~~~~~~~~~
Traceback (most recent call last):
File "/home/
self._value = self._module.
File "/home/
raise error
netaddr.
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/
value, prefixlen = parse_ip_
File "/home/
ip = IPAddress(val1, module.version, flags=INET_PTON)
File "/home/
raise AddrFormatError(
netaddr.
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/
return f(self, *args, **kwargs)
File "/home/
return f(self, *args, **kwargs)
File "/home/
snat_idx = ri._get_
File "/home/
net = netaddr.
File "/home/
raise AddrFormatError
netaddr.
```
An "easy" fix is adding flags=INET_ATON to all places. (note that INET_ATON was added in netaddr 0.10.0) but I'd like to ask someone from the neutron team to look into this and check whether we really have to use INET_ATON or fix unit test side to apply the more strict rule.
[1] https:/
[2] https:/
Patch: https:/ /review. opendev. org/c/openstack /neutron/ +/909317