mirror of
https://github.com/cisagov/manage.get.gov.git
synced 2025-07-21 10:16:13 +02:00
fixed create_host bug not properly submitting ip version for v6; refactored update_host as well
This commit is contained in:
parent
167cb9d995
commit
eedd5d7dbf
1 changed files with 13 additions and 5 deletions
|
@ -261,7 +261,13 @@ class Domain(TimeStampedModel, DomainHelper):
|
||||||
doesn't add the created host to the domain
|
doesn't add the created host to the domain
|
||||||
returns ErrorCode (int)"""
|
returns ErrorCode (int)"""
|
||||||
if addrs is not None and addrs != []:
|
if addrs is not None and addrs != []:
|
||||||
addresses = [epp.Ip(addr=addr) for addr in addrs]
|
addresses = [
|
||||||
|
epp.Ip(
|
||||||
|
addr=addr,
|
||||||
|
ip="v6" if self.is_ipv6(addr) else None
|
||||||
|
)
|
||||||
|
for addr in addrs
|
||||||
|
]
|
||||||
request = commands.CreateHost(name=host, addrs=addresses)
|
request = commands.CreateHost(name=host, addrs=addresses)
|
||||||
else:
|
else:
|
||||||
request = commands.CreateHost(name=host)
|
request = commands.CreateHost(name=host)
|
||||||
|
@ -1541,10 +1547,12 @@ class Domain(TimeStampedModel, DomainHelper):
|
||||||
return []
|
return []
|
||||||
|
|
||||||
for ip_addr in ip_list:
|
for ip_addr in ip_list:
|
||||||
if self.is_ipv6(ip_addr):
|
edited_ip_list.append(
|
||||||
edited_ip_list.append(epp.Ip(addr=ip_addr, ip="v6"))
|
epp.Ip(
|
||||||
else: # default ip addr is v4
|
addr=ip_addr,
|
||||||
edited_ip_list.append(epp.Ip(addr=ip_addr))
|
ip="v6" if self.is_ipv6(ip_addr) else None
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
return edited_ip_list
|
return edited_ip_list
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue