1
0
mirror of https://github.com/samba-team/samba.git synced 2025-07-06 08:59:08 +03:00

samba-tool dns: query uses DnsConnWrapper messages

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
This commit is contained in:
Douglas Bagnall
2022-08-12 16:46:03 +12:00
committed by Douglas Bagnall
parent 633872c7d2
commit bee727a559

View File

@ -1073,14 +1073,14 @@ class cmd_query(Command):
self.creds = credopts.get_credentials(self.lp)
dns_conn = DnsConnWrapper(server, self.lp, self.creds)
try:
buflen, res = dns_conn.DnssrvEnumRecords2(
dnsserver.DNS_CLIENT_VERSION_LONGHORN, 0, server, zone, name,
None, record_type, select_flags, None, None)
except WERRORError as e:
if e.args[0] == werror.WERR_DNS_ERROR_NAME_DOES_NOT_EXIST:
raise CommandError('Record or zone does not exist.')
raise e
messages = {
werror.WERR_DNS_ERROR_NAME_DOES_NOT_EXIST: (
'Record or zone does not exist.')
}
buflen, res = dns_conn.DnssrvEnumRecords2(
dnsserver.DNS_CLIENT_VERSION_LONGHORN, 0, server, zone, name,
None, record_type, select_flags, None, None,
messages=messages)
print_dnsrecords(self.outf, res)