commit 50fd545ee8d40f70c9b2b680360c4a2e1b9e95b7
Author: Rodolfo Alonso Hernandez <email address hidden>
Date: Mon May 31 11:41:04 2021 +0000
Remove leading zeroes from an IP address
In python3.9, ipaddress.IPv4Interface does not support defining an
IP address with leading zeroes. E.g.:
>>> ipaddress.IPv4Interface('00.0.0.0/0')
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/lib/python3.9/ipaddress.py", line 1390, in __init__ IPv4Address.__init__(self, addr)
File "/usr/lib/python3.9/ipaddress.py", line 1307, in __init__
self._ip = self._ip_int_from_string(addr_str)
File "/usr/lib/python3.9/ipaddress.py", line 1199, in
_ip_int_from_string
raise AddressValueError("%s in %r" % (exc, ip_str)) from None
ipaddress.AddressValueError: Leading zeros are not permitted in '00' in
'00.0.0.0'
Change-Id: I29137b22c158e979e81be9e41464948aa99f5498
Closes-Bug: #1930222
(cherry picked from commit b141aed51296fd6564ccce18f907dc1913a4bc5b)
Reviewed: https:/ /review. opendev. org/c/openstack /neutron/ +/794617 /opendev. org/openstack/ neutron/ commit/ 50fd545ee8d40f7 0c9b2b680360c4a 2e1b9e95b7
Committed: https:/
Submitter: "Zuul (22348)"
Branch: stable/wallaby
commit 50fd545ee8d40f7 0c9b2b680360c4a 2e1b9e95b7
Author: Rodolfo Alonso Hernandez <email address hidden>
Date: Mon May 31 11:41:04 2021 +0000
Remove leading zeroes from an IP address
In python3.9, ipaddress. IPv4Interface does not support defining an
IP address with leading zeroes. E.g.:
>>> ipaddress. IPv4Interface( '00.0.0. 0/0') python3. 9/ipaddress. py", line 1390, in __init__
IPv4Address. __init_ _(self, addr) python3. 9/ipaddress. py", line 1307, in __init__ int_from_ string( addr_str) python3. 9/ipaddress. py", line 1199, in int_from_ string or("%s in %r" % (exc, ip_str)) from None AddressValueErr or: Leading zeros are not permitted in '00' in
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/lib/
File "/usr/lib/
self._ip = self._ip_
File "/usr/lib/
_ip_
raise AddressValueErr
ipaddress.
'00.0.0.0'
Change-Id: I29137b22c158e9 79e81be9e414649 48aa99f5498 564ccce18f907dc 1913a4bc5b)
Closes-Bug: #1930222
(cherry picked from commit b141aed51296fd6