Commit 51b13ce9 authored by Manuel Franceschini's avatar Manuel Franceschini

Support IPv6 for instances

Signed-off-by: default avatarManuel Franceschini <livewire@google.com>
Reviewed-by: default avatarIustin Pop <iustin@google.com>
parent 7c4c22f5
......@@ -7003,9 +7003,8 @@ class LUCreateInstance(LogicalUnit):
errors.ECODE_INVAL)
nic_ip = self.hostname1.ip
else:
if not netutils.IP4Address.IsValid(ip):
raise errors.OpPrereqError("Given IP address '%s' doesn't look"
" like a valid IP" % ip,
if not netutils.IPAddress.IsValid(ip):
raise errors.OpPrereqError("Invalid IP address '%s'" % ip,
errors.ECODE_INVAL)
nic_ip = ip
......@@ -8678,7 +8677,7 @@ class LUSetInstanceParams(LogicalUnit):
if nic_ip.lower() == constants.VALUE_NONE:
nic_dict['ip'] = None
else:
if not netutils.IP4Address.IsValid(nic_ip):
if not netutils.IPAddress.IsValid(nic_ip):
raise errors.OpPrereqError("Invalid IP address '%s'" % nic_ip,
errors.ECODE_INVAL)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment