summaryrefslogtreecommitdiff
path: root/python/samba/netcmd/dns.py
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2019-11-05 11:23:48 +0100
committerAndreas Schneider <asn@cryptomilk.org>2020-03-27 09:02:37 +0000
commit23bd1eff751fad67a5caacd9fbc2911cd85f8e49 (patch)
treee69edb71fa33198e3db3f6298d2d85b5c0298fad /python/samba/netcmd/dns.py
parentcefa9be9d7d9877a1d00caaf5c536f08ecdee0f4 (diff)
downloadsamba-23bd1eff751fad67a5caacd9fbc2911cd85f8e49.tar.gz
samba-23bd1eff751fad67a5caacd9fbc2911cd85f8e49.tar.bz2
samba-23bd1eff751fad67a5caacd9fbc2911cd85f8e49.zip
python/netcmd/dns: improve exception handling in cmd_delete_record()
Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
Diffstat (limited to 'python/samba/netcmd/dns.py')
-rw-r--r--python/samba/netcmd/dns.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/python/samba/netcmd/dns.py b/python/samba/netcmd/dns.py
index 6cf8d40b2aa..330e2efbdcd 100644
--- a/python/samba/netcmd/dns.py
+++ b/python/samba/netcmd/dns.py
@@ -1067,7 +1067,9 @@ class cmd_delete_record(Command):
del_rec_buf)
except WERRORError as e:
if e.args[0] == werror.WERR_DNS_ERROR_NAME_DOES_NOT_EXIST:
- raise CommandError('Zone does not exist; record could not be deleted.')
+ raise CommandError('Zone does not exist; record could not be deleted. zone[%s] name[%s]' % (zone, name))
+ if e.args[0] == werror.WERR_DNS_ERROR_RECORD_DOES_NOT_EXIST:
+ raise CommandError('Record does not exist; record could not be deleted. zone[%s] name[%s]' % (zone, name))
raise e
self.outf.write('Record deleted successfully\n')