mirror of
https://github.com/samba-team/samba.git
synced 2025-01-08 21:18:16 +03:00
provision: Give a more helpful message when find_provision_key_parameters() fails
Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org> Autobuild-User(master): Stefan Metzmacher <metze@samba.org> Autobuild-Date(master): Fri Mar 6 20:11:52 CET 2015 on sn-devel-104
This commit is contained in:
parent
6fe8cd2fdf
commit
5b3c71cd9c
@ -243,8 +243,11 @@ def find_provision_key_parameters(samdb, secretsdb, idmapdb, paths, smbconf,
|
||||
|
||||
# dns hostname and server dn
|
||||
res4 = samdb.search(expression="(CN=%s)" % names.netbiosname,
|
||||
base="OU=Domain Controllers,%s" % basedn,
|
||||
scope=ldb.SCOPE_ONELEVEL, attrs=["dNSHostName"])
|
||||
base="OU=Domain Controllers,%s" % basedn,
|
||||
scope=ldb.SCOPE_ONELEVEL, attrs=["dNSHostName"])
|
||||
if len(res4) == 0:
|
||||
raise ProvisioningError("Unable to find DC called CN=%s under OU=Domain Controllers,%s" % (names.netbiosname, basedn))
|
||||
|
||||
names.hostname = str(res4[0]["dNSHostName"]).replace("." + names.dnsdomain, "")
|
||||
|
||||
server_res = samdb.search(expression="serverReference=%s" % res4[0].dn,
|
||||
|
Loading…
Reference in New Issue
Block a user