Fixed bug where showcfg for non-existing config files died silently

Made servername verification talk directly to the nameserver, not just any server.
This commit is contained in:
2004-01-24 00:17:48 +00:00
parent 397a5fff19
commit ff63f9f8d5

View File

@@ -130,7 +130,9 @@ def readcfg(msg, show=""):
return msg
else:
if not os.path.exists(msg['cfgfile']):
msg['error'].append("No such file: %s" % msg['cfgfile'])
if show:
checkerror(msg, show="errors")
msg['error'].append("No such file; '%s'" % msg['cfgfile'])
return msg
cfgfile = open(msg['cfgfile'], 'r')
@@ -229,7 +231,9 @@ def verify_ip(msg):
ip = ""
host = msg['hostname'] + "." + msg['domain']
try:
ans = dns.resolver.query(host, 'A')
res = dns.resolver.Resolver()
res.nameservers = [msg['nameserver']]
ans = res.query(host)
for res in ans:
ip = res.to_text()
except dns.exception.Timeout: