Merge "[Designate] IPv6 detection check added"

This commit is contained in:
Zuul 2023-07-21 23:15:52 +00:00 committed by Gerrit Code Review
commit 89da05dc30
1 changed files with 4 additions and 3 deletions

View File

@ -15,6 +15,7 @@ import dns
import dns.exception
import dns.query
from tempest import config
from oslo_utils import netutils
CONF = config.CONF
@ -78,7 +79,7 @@ class Nameserver(object):
@classmethod
def from_str(self, nameserver):
if ':' in nameserver:
ip, port = nameserver.rsplit(':', 1)
return Nameserver(ip, int(port))
ip, port = netutils.parse_host_port(nameserver)
if port:
return Nameserver(ip, port)
return Nameserver(nameserver)