1
0
mirror of https://github.com/samba-team/samba.git synced 2025-08-29 13:49:30 +03:00

samba-tool drs showrepl: do not crash if no dnsHostName found

This should not happen, but it does sometimes in an autobuild
environment. Rather than reporting this by crashing, we report it by
showing there is no DNS name.

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>

Autobuild-User(master): Douglas Bagnall <dbagnall@samba.org>
Autobuild-Date(master): Fri Oct 12 15:27:07 CEST 2018 on sn-devel-144
This commit is contained in:
Douglas Bagnall
2018-10-11 11:59:52 +13:00
committed by Douglas Bagnall
parent 3efb4588ab
commit 2fc855e7d2

View File

@ -301,7 +301,7 @@ class cmd_drs_showrepl(Command):
(errno, _) = e.args
if errno == ldb.ERR_NO_SUCH_OBJECT:
d['is deleted'] = True
except KeyError:
except (KeyError, IndexError):
pass
d['replicates NC'] = []
@ -359,7 +359,7 @@ class cmd_drs_showrepl(Command):
self.message("\tConnection name: %s" % d['name'])
self.message("\tEnabled : %s" % str(d['enabled']).upper())
self.message("\tServer DNS name : %s" % d['dns name'])
self.message("\tServer DNS name : %s" % d.get('dns name'))
self.message("\tServer DN name : %s" % d['remote DN'])
self.message("\t\tTransportType: RPC")
self.message("\t\toptions: 0x%08X" % d['options'])