is_valid_cidr raises TypeError if address is invalid

Bug #1584599 reported by Abhishek Kekane
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
oslo.utils
Fix Released
Low
Abhishek Kekane

Bug Description

is_valid_cidr() will raise TypeError if invalid input is passed.

E.g.
is_valid_cidr(10)
will raise following error

Traceback (most recent call last):
  File "b.py", line 30, in <module>
    is_valid_cidr(10)
  File "b.py", line 15, in is_valid_cidr
    netaddr.IPNetwork(address)
  File "/Library/Python/2.7/site-packages/netaddr/ip/__init__.py", line 923, in __init__
    implicit_prefix, flags)
  File "/Library/Python/2.7/site-packages/netaddr/ip/__init__.py", line 818, in parse_ip_network
    raise TypeError('unexpected type %s for addr arg' % type(addr))
TypeError: unexpected type <type 'int'> for addr arg

Changed in oslo.utils:
assignee: nobody → Abhishek Kekane (abhishek-kekane)
Changed in oslo.utils:
importance: Undecided → Low
Revision history for this message
ChangBo Guo(gcb) (glongwave) wrote :
Changed in oslo.utils:
status: New → Fix Released
Revision history for this message
Davanum Srinivas (DIMS) (dims-v) wrote : Fix included in openstack/oslo.utils 3.12.0

This issue was fixed in the openstack/oslo.utils 3.12.0 release.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.