1
0
mirror of https://github.com/samba-team/samba.git synced 2025-12-05 12:23:50 +03:00

samba-tool: don't print backtrace on simple DNS errors

samba-tool throws backtraces even for simple DNS error
messages, we should not frighten users for no good reason.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=13721

Signed-off-by: Bjoern Jacke <bj@sernet.de>
Reviewed-by: Stefan Metzmacher <metze@samba.org>

Autobuild-User(master): Björn Jacke <bj@sernet.de>
Autobuild-Date(master): Wed Dec 19 20:58:52 CET 2018 on sn-devel-144
This commit is contained in:
Björn Jacke
2018-12-18 12:58:53 +01:00
committed by Bjoern Jacke
parent fe7ab7d513
commit 49dc04f9f5

View File

@@ -780,7 +780,7 @@ class cmd_zonedelete(Command):
None)
except WERRORError as e:
if e.args[0] == werror.WERR_DNS_ERROR_ZONE_DOES_NOT_EXIST:
self.outf.write('Zone does not exist and so could not be deleted.')
raise CommandError('Zone does not exist and so could not be deleted.')
raise e
self.outf.write('Zone %s deleted successfully\n' % zone)
@@ -860,7 +860,7 @@ class cmd_query(Command):
None, record_type, select_flags, None, None)
except WERRORError as e:
if e.args[0] == werror.WERR_DNS_ERROR_NAME_DOES_NOT_EXIST:
self.outf.write('Record or zone does not exist.')
raise CommandError('Record or zone does not exist.')
raise e
print_dnsrecords(self.outf, res)
@@ -940,7 +940,7 @@ class cmd_add_record(Command):
0, server, zone, name, add_rec_buf, None)
except WERRORError as e:
if e.args[0] == werror.WERR_DNS_ERROR_NAME_DOES_NOT_EXIST:
self.outf.write('Zone does not exist; record could not be added.\n')
raise CommandError('Zone does not exist; record could not be added.')
raise e
self.outf.write('Record added successfully\n')
@@ -1011,7 +1011,7 @@ class cmd_update_record(Command):
del_rec_buf)
except WERRORError as e:
if e.args[0] == werror.WERR_DNS_ERROR_NAME_DOES_NOT_EXIST:
self.outf.write('Zone does not exist; record could not be updated.\n')
raise CommandError('Zone does not exist; record could not be updated.')
raise e
self.outf.write('Record updated successfully\n')
@@ -1066,7 +1066,7 @@ class cmd_delete_record(Command):
del_rec_buf)
except WERRORError as e:
if e.args[0] == werror.WERR_DNS_ERROR_NAME_DOES_NOT_EXIST:
self.outf.write('Zone does not exist; record could not be deleted.\n')
raise CommandError('Zone does not exist; record could not be deleted.')
raise e
self.outf.write('Record deleted successfully\n')