From f053e385ff796914392d0eafa1e8756ff5ffdb18 Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Sat, 22 Dec 2007 05:11:21 -0600 Subject: r26566: Fix member provision when using python. (This used to be commit e5573283df9e98bccc8eae227cf0f11367ecf084) --- source4/scripting/python/samba/provision.py | 18 +++++++++--------- 1 file 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, -- cgit