Call directly function is_host_resolvable instead do call via framework

Reviewed-By: Petr Spacek <pspacek@redhat.com>
This commit is contained in:
Martin Basti 2015-11-18 19:25:04 +01:00
parent 749dfc3917
commit 7acfaee8ab

View File

@ -1563,9 +1563,7 @@ def check_ns_rec_resolvable(zone, name):
elif not name.is_absolute():
# this is a DNS name relative to the zone
name = name.derelativize(zone.make_absolute())
try:
return api.Command['dns_resolve'](unicode(name))
except errors.NotFound:
if not is_host_resolvable(name):
raise errors.NotFound(
reason=_('Nameserver \'%(host)s\' does not have a corresponding '
'A/AAAA record') % {'host': name}