summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2007-12-22 05:11:21 -0600
committerStefan Metzmacher <metze@samba.org>2007-12-24 01:51:01 -0600
commitf053e385ff796914392d0eafa1e8756ff5ffdb18 (patch)
treebb8031088c27819f9fe8f44a9b6729411bcf9d11
parent249cc734cebfef31320ec10b05dbfaaaa39682ca (diff)
downloadsamba-f053e385ff796914392d0eafa1e8756ff5ffdb18.tar.gz
samba-f053e385ff796914392d0eafa1e8756ff5ffdb18.tar.bz2
samba-f053e385ff796914392d0eafa1e8756ff5ffdb18.zip
r26566: Fix member provision when using python.
(This used to be commit e5573283df9e98bccc8eae227cf0f11367ecf084)
-rw-r--r--source4/scripting/python/samba/provision.py18
1 files changed, 9 insertions, 9 deletions
diff --git a/source4/scripting/python/samba/provision.py b/source4/scripting/python/samba/provision.py
index b5fe3eba9e..dcf567954a 100644
--- a/source4/scripting/python/samba/provision.py
+++ b/source4/scripting/python/samba/provision.py
@@ -729,17 +729,17 @@ def provision(lp, setup_dir, message, blank, paths, session_info,
message("Please install the phpLDAPadmin configuration located at %s into /etc/phpldapadmin/config.php" % paths.phpldapadminconfig)
- samdb = SamDB(paths.samdb, session_info=session_info,
- credentials=credentials, lp=lp)
+ if lp.get("server role") == "domain controller":
+ samdb = SamDB(paths.samdb, session_info=session_info,
+ credentials=credentials, lp=lp)
- domainguid = samdb.searchone(Dn(samdb, domaindn), "objectGUID")
- assert isinstance(domainguid, str)
- hostguid = samdb.searchone(Dn(samdb, domaindn), "objectGUID",
- expression="(&(objectClass=computer)(cn=%s))" % hostname,
- scope=SCOPE_SUBTREE)
- assert isinstance(hostguid, str)
+ domainguid = samdb.searchone(Dn(samdb, domaindn), "objectGUID")
+ assert isinstance(domainguid, str)
+ hostguid = samdb.searchone(Dn(samdb, domaindn), "objectGUID",
+ expression="(&(objectClass=computer)(cn=%s))" % hostname,
+ scope=SCOPE_SUBTREE)
+ assert isinstance(hostguid, str)
- if lp.get("server role") == "domain controller":
message("Setting up DNS zone: %s" % dnsdomain)
create_zone_file(paths.dns, setup_path, samdb,
hostname=hostname, hostip=hostip, dnsdomain=dnsdomain,