Author: jelmer Date: 2007-12-17 20:03:06 +0000 (Mon, 17 Dec 2007) New Revision: 26513
WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=26513 Log: Update substitution dictionary for ldifs. Modified: branches/SAMBA_4_0/ branches/SAMBA_4_0/source/scripting/python/misc.i branches/SAMBA_4_0/source/scripting/python/misc.py branches/SAMBA_4_0/source/scripting/python/misc_wrap.c branches/SAMBA_4_0/source/scripting/python/samba/__init__.py branches/SAMBA_4_0/source/scripting/python/samba/provision.py Changeset: Property changes on: branches/SAMBA_4_0 ___________________________________________________________________ Name: bzr:revision-info ...skipped... Name: bzr:revision-id:v3-trunk0 ...skipped... Modified: branches/SAMBA_4_0/source/scripting/python/misc.i =================================================================== --- branches/SAMBA_4_0/source/scripting/python/misc.i 2007-12-17 19:18:55 UTC (rev 26512) +++ branches/SAMBA_4_0/source/scripting/python/misc.i 2007-12-17 20:03:06 UTC (rev 26513) @@ -59,3 +59,6 @@ const struct dom_sid *dom_sid_in); WERROR dsdb_attach_schema_from_ldif_file(struct ldb_context *ldb, const char *pf, const char *df); + +%rename(version) samba_version_string; +const char *samba_version_string(void); Modified: branches/SAMBA_4_0/source/scripting/python/misc.py =================================================================== --- branches/SAMBA_4_0/source/scripting/python/misc.py 2007-12-17 19:18:55 UTC (rev 26512) +++ branches/SAMBA_4_0/source/scripting/python/misc.py 2007-12-17 20:03:06 UTC (rev 26513) @@ -67,5 +67,6 @@ ldb_set_loadparm = _misc.ldb_set_loadparm samdb_set_domain_sid = _misc.samdb_set_domain_sid dsdb_attach_schema_from_ldif_file = _misc.dsdb_attach_schema_from_ldif_file +version = _misc.version Modified: branches/SAMBA_4_0/source/scripting/python/misc_wrap.c =================================================================== --- branches/SAMBA_4_0/source/scripting/python/misc_wrap.c 2007-12-17 19:18:55 UTC (rev 26512) +++ branches/SAMBA_4_0/source/scripting/python/misc_wrap.c 2007-12-17 20:03:06 UTC (rev 26513) @@ -3038,6 +3038,19 @@ } +SWIGINTERN PyObject *_wrap_version(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + char *result = 0 ; + + if (!SWIG_Python_UnpackTuple(args,"version",0,0,0)) SWIG_fail; + result = (char *)samba_version_string(); + resultobj = SWIG_FromCharPtr((const char *)result); + return resultobj; +fail: + return NULL; +} + + static PyMethodDef SwigMethods[] = { { (char *)"random_password", (PyCFunction) _wrap_random_password, METH_VARARGS | METH_KEYWORDS, NULL}, { (char *)"ldb_set_credentials", (PyCFunction) _wrap_ldb_set_credentials, METH_VARARGS | METH_KEYWORDS, NULL}, @@ -3045,6 +3058,7 @@ { (char *)"ldb_set_loadparm", (PyCFunction) _wrap_ldb_set_loadparm, METH_VARARGS | METH_KEYWORDS, NULL}, { (char *)"samdb_set_domain_sid", (PyCFunction) _wrap_samdb_set_domain_sid, METH_VARARGS | METH_KEYWORDS, NULL}, { (char *)"dsdb_attach_schema_from_ldif_file", (PyCFunction) _wrap_dsdb_attach_schema_from_ldif_file, METH_VARARGS | METH_KEYWORDS, NULL}, + { (char *)"version", (PyCFunction)_wrap_version, METH_NOARGS, NULL}, { NULL, NULL, 0, NULL } }; Modified: branches/SAMBA_4_0/source/scripting/python/samba/__init__.py =================================================================== --- branches/SAMBA_4_0/source/scripting/python/samba/__init__.py 2007-12-17 19:18:55 UTC (rev 26512) +++ branches/SAMBA_4_0/source/scripting/python/samba/__init__.py 2007-12-17 20:03:06 UTC (rev 26513) @@ -122,6 +122,8 @@ for (name, value) in values.items(): text = text.replace("${%s}" % name, value) + assert "${" not in text, text + return text @@ -133,3 +135,4 @@ return False return True +version = misc.version Modified: branches/SAMBA_4_0/source/scripting/python/samba/provision.py =================================================================== --- branches/SAMBA_4_0/source/scripting/python/samba/provision.py 2007-12-17 19:18:55 UTC (rev 26512) +++ branches/SAMBA_4_0/source/scripting/python/samba/provision.py 2007-12-17 20:03:06 UTC (rev 26513) @@ -14,6 +14,7 @@ from socket import gethostname, gethostbyname import param import registry +import samba from samba import Ldb, substitute_var, valid_netbios_name from samba.samdb import SamDB import security @@ -56,6 +57,7 @@ self.schemedn_ldb = None self.s4_ldapi_path = None self.policyguid = None + self.extensibleobject = None def subst_vars(self): return {"SCHEMADN": self.schemadn, @@ -77,6 +79,7 @@ "NETBIOSNAME": self.netbiosname, "DNSNAME": self.dnsname, "ROOTDN": self.rootdn, + "DOMAIN": self.domain, "DNSDOMAIN": self.dnsdomain, "REALM": self.realm, "DEFAULTSITE": self.defaultsite, @@ -89,6 +92,9 @@ "POLICYGUID": self.policyguid, "RDN_DC": self.rdn_dc, "DOMAINGUID_MOD": self.domainguid_mod, + "VERSION": samba.version(), + "ACI": "# no aci for local ldb", + "EXTENSIBLEOBJECT": self.extensibleobject, } def fix(self, paths):
