r26499: Allow testing python provision by setting the PROVISION_PYTHON environment...
authorJelmer Vernooij <jelmer@samba.org>
Mon, 17 Dec 2007 07:36:39 +0000 (08:36 +0100)
committerStefan Metzmacher <metze@samba.org>
Fri, 21 Dec 2007 04:50:55 +0000 (05:50 +0100)
source/scripting/python/samba/provision.py
source/selftest/env/Samba4.pm

index 63e50897fe0a170a4084438beac2aba826af60f9..60dcf06c8325f893d6fcd173bf6910272a9de50b 100644 (file)
@@ -189,7 +189,6 @@ def ldb_delete(ldb):
     ldb.connect(ldb.filename)
 
 
     ldb.connect(ldb.filename)
 
 
-
 def open_ldb(session_info, credentials, dbname):
     assert session_info is not None
     try:
 def open_ldb(session_info, credentials, dbname):
     assert session_info is not None
     try:
@@ -641,25 +640,16 @@ def provision_guess(lp):
     return subobj
 
 
     return subobj
 
 
-
 def load_schema(setup_dir, subobj, samdb):
     """Load schema."""
     src = os.path.join(setup_dir, "schema.ldif")
 def load_schema(setup_dir, subobj, samdb):
     """Load schema."""
     src = os.path.join(setup_dir, "schema.ldif")
-
     schema_data = open(src, 'r').read()
     schema_data = open(src, 'r').read()
-
     src = os.path.join(setup_dir, "schema_samba4.ldif")
     src = os.path.join(setup_dir, "schema_samba4.ldif")
-
     schema_data += open(src, 'r').read()
     schema_data += open(src, 'r').read()
-
     schema_data = substitute_var(schema_data, subobj.subst_vars())
     schema_data = substitute_var(schema_data, subobj.subst_vars())
-
     src = os.path.join(setup_dir, "provision_schema_basedn_modify.ldif")
     src = os.path.join(setup_dir, "provision_schema_basedn_modify.ldif")
-
     head_data = open(src, 'r').read()
     head_data = open(src, 'r').read()
-
     head_data = substitute_var(head_data, subobj.subst_vars())
     head_data = substitute_var(head_data, subobj.subst_vars())
-
     samdb.attach_dsdb_schema_from_ldif(head_data, schema_data)
 
 
     samdb.attach_dsdb_schema_from_ldif(head_data, schema_data)
 
 
index dbddb25465f490c5039da8477be2efc94467e2ee..f2ba37f618961ec4233dc5e28733228b3eb9668e 100644 (file)
@@ -628,8 +628,12 @@ nogroup:x:65534:nobody
        my @provision_options = ();
        push (@provision_options, "NSS_WRAPPER_PASSWD=\"$nsswrap_passwd\"");
        push (@provision_options, "NSS_WRAPPER_GROUP=\"$nsswrap_group\"");
        my @provision_options = ();
        push (@provision_options, "NSS_WRAPPER_PASSWD=\"$nsswrap_passwd\"");
        push (@provision_options, "NSS_WRAPPER_GROUP=\"$nsswrap_group\"");
-       push (@provision_options, "$self->{bindir}/smbscript");
-       push (@provision_options, "$self->{setupdir}/provision");
+       if (defined($ENV{PROVISION_PYTHON})) {
+               push (@provision_options, "$self->{setupdir}/provision.py");
+       } else {
+               push (@provision_options, "$self->{bindir}/smbscript");
+               push (@provision_options, "$self->{setupdir}/provision");
+       }
        push (@provision_options, split(' ', $configuration));
        push (@provision_options, "--host-name=$netbiosname");
        push (@provision_options, "--host-ip=$ifaceipv4");
        push (@provision_options, split(' ', $configuration));
        push (@provision_options, "--host-name=$netbiosname");
        push (@provision_options, "--host-ip=$ifaceipv4");