summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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,