Merge "is_valid_ip_address: Catch non-string values early"
This commit is contained in:
commit
25d923925a
|
@ -292,6 +292,9 @@ def is_valid_ip_address(ip_address, ip_version):
|
||||||
raise exception.ManilaException(
|
raise exception.ManilaException(
|
||||||
_("Provided improper IP version '%s'.") % ip_version)
|
_("Provided improper IP version '%s'.") % ip_version)
|
||||||
|
|
||||||
|
if not isinstance(ip_address, str):
|
||||||
|
return False
|
||||||
|
|
||||||
if 4 in ip_version:
|
if 4 in ip_version:
|
||||||
if netutils.is_valid_ipv4(ip_address):
|
if netutils.is_valid_ipv4(ip_address):
|
||||||
return True
|
return True
|
||||||
|
|
Loading…
Reference in New Issue