From 1a494f112a745f7e564dbd7c1d44bfd9a86ebb34 Mon Sep 17 00:00:00 2001 From: Endi S. Dewata Date: Mon, 18 Jan 2010 21:01:08 -0600 Subject: [PATCH 2/2] s4-provision: Fixed typos and redundant code --- source4/scripting/python/samba/provisionbackend.py | 20 ++++++++++---------- 1 files changed, 10 insertions(+), 10 deletions(-) diff --git a/source4/scripting/python/samba/provisionbackend.py b/source4/scripting/python/samba/provisionbackend.py index ae58a16..8241ed6 100644 --- a/source4/scripting/python/samba/provisionbackend.py +++ b/source4/scripting/python/samba/provisionbackend.py @@ -704,7 +704,7 @@ class FDSBackend(LDAPBackend): os.path.join(self.paths.ldapdir, "slapd-samba4", "ldif2db"), "-s", self.sambadn, "-i", self.samba_ldif], close_fds=True, shell=False) if retcode != 0: - raise("ldif2db failed") + raise ProvisioningError("ldif2db failed") def post_setup(self): ldapi_db = Ldb(self.ldapi_uri, credentials=self.credentials) @@ -717,16 +717,16 @@ class FDSBackend(LDAPBackend): dn = str(res[i]["dn"]) ldapi_db.delete(dn) - aci = """(targetattr = "*") (version 3.0;acl "full access to all by samba-admin";allow (all)(userdn = "ldap:///CN=samba-admin,%s");)""" % self.sambadn + aci = """(targetattr = "*") (version 3.0;acl "full access to all by samba-admin";allow (all)(userdn = "ldap:///CN=samba-admin,%s");)""" % self.sambadn - m = ldb.Message() - m["aci"] = ldb.MessageElement([aci], ldb.FLAG_MOD_REPLACE, "aci") + m = ldb.Message() + m["aci"] = ldb.MessageElement([aci], ldb.FLAG_MOD_REPLACE, "aci") - m.dn = ldb.Dn(1, self.names.domaindn) - ldapi_db.modify(m) + m.dn = ldb.Dn(ldapi_db, self.names.domaindn) + ldapi_db.modify(m) - m.dn = ldb.Dn(1, self.names.configdn) - ldapi_db.modify(m) + m.dn = ldb.Dn(ldapi_db, self.names.configdn) + ldapi_db.modify(m) - m.dn = ldb.Dn(1, self.names.schemadn) - ldapi_db.modify(m) + m.dn = ldb.Dn(ldapi_db, self.names.schemadn) + ldapi_db.modify(m) -- 1.6.5.2