summaryrefslogtreecommitdiff
path: root/python
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2013-03-22 21:58:25 +1100
committerStefan Metzmacher <metze@samba.org>2013-03-25 13:25:30 +0100
commit30adf0cdbae6d9aaf2e72513d9c33267248f20c0 (patch)
tree938570ace85a6dcf2637eaf35614c8a38d98324f /python
parent5d42260eecfd4f26cc82637ce1bc989083c9eb9d (diff)
downloadsamba-30adf0cdbae6d9aaf2e72513d9c33267248f20c0.tar.gz
samba-30adf0cdbae6d9aaf2e72513d9c33267248f20c0.tar.bz2
samba-30adf0cdbae6d9aaf2e72513d9c33267248f20c0.zip
scripting: Fill the ProvisionNames hash with strings, not ldb.MessageElement or Dn
This avoids the need to fix it up again in samba_upgradedns. Andrew Bartlett Reviewed-by: Stefan Metzmacher <metze@samba.org> Autobuild-User(master): Stefan Metzmacher <metze@samba.org> Autobuild-Date(master): Mon Mar 25 13:25:30 CET 2013 on sn-devel-104
Diffstat (limited to 'python')
-rw-r--r--python/samba/provision/__init__.py15
1 files changed, 7 insertions, 8 deletions
diff --git a/python/samba/provision/__init__.py b/python/samba/provision/__init__.py
index ee4cc10dca..252cfd9021 100644
--- a/python/samba/provision/__init__.py
+++ b/python/samba/provision/__init__.py
@@ -201,9 +201,8 @@ def find_provision_key_parameters(samdb, secretsdb, idmapdb, paths, smbconf,
"configurationNamingContext","rootDomainNamingContext",
"namingContexts"])
- names.configdn = current[0]["configurationNamingContext"]
- configdn = str(names.configdn)
- names.schemadn = current[0]["schemaNamingContext"]
+ names.configdn = current[0]["configurationNamingContext"][0]
+ names.schemadn = current[0]["schemaNamingContext"][0]
if not (ldb.Dn(samdb, basedn) == (ldb.Dn(samdb,
current[0]["defaultNamingContext"][0]))):
raise ProvisioningError(("basedn in %s (%s) and from %s (%s)"
@@ -211,8 +210,8 @@ def find_provision_key_parameters(samdb, secretsdb, idmapdb, paths, smbconf,
str(current[0]["defaultNamingContext"][0]),
paths.smbconf, basedn)))
- names.domaindn=current[0]["defaultNamingContext"]
- names.rootdn=current[0]["rootDomainNamingContext"]
+ names.domaindn=current[0]["defaultNamingContext"][0]
+ names.rootdn=current[0]["rootDomainNamingContext"][0]
names.ncs=current[0]["namingContexts"]
names.dnsforestdn = None
names.dnsdomaindn = None
@@ -232,7 +231,7 @@ def find_provision_key_parameters(samdb, secretsdb, idmapdb, paths, smbconf,
# default site name
res3 = samdb.search(expression="(objectClass=site)",
- base="CN=Sites," + configdn, scope=ldb.SCOPE_ONELEVEL, attrs=["cn"])
+ base="CN=Sites," + names.configdn, scope=ldb.SCOPE_ONELEVEL, attrs=["cn"])
names.sitename = str(res3[0]["cn"])
# dns hostname and server dn
@@ -242,8 +241,8 @@ def find_provision_key_parameters(samdb, secretsdb, idmapdb, paths, smbconf,
names.hostname = str(res4[0]["dNSHostName"]).replace("." + names.dnsdomain, "")
server_res = samdb.search(expression="serverReference=%s" % res4[0].dn,
- attrs=[], base=configdn)
- names.serverdn = server_res[0].dn
+ attrs=[], base=names.configdn)
+ names.serverdn = str(server_res[0].dn)
# invocation id/objectguid
res5 = samdb.search(expression="(objectClass=*)",