Remove --ldap-base from the python provision script
authorAndrew Bartlett <abartlet@samba.org>
Fri, 18 Jan 2008 02:25:01 +0000 (13:25 +1100)
committerAndrew Bartlett <abartlet@samba.org>
Fri, 18 Jan 2008 02:25:01 +0000 (13:25 +1100)
(This is a merge from the ejs script)

Andrew Bartlett
(This used to be commit d822dfa017b84895222ace8c44935fb872930548)

source4/scripting/python/samba/provision.py
source4/setup/provision.py

index 1607cb343bf6d3397e3ff5db587d7d98113e7b80..d59cea121e8b0e4c0467867bd1d4e4eed110c1f2 100644 (file)
@@ -180,12 +180,6 @@ def provision_paths_from_lp(lp, dnsdomain):
     paths.dns_keytab = os.path.join(private_dir, "dns.keytab")
     paths.dns = os.path.join(private_dir, dnsdomain + ".zone")
     paths.winsdb = os.path.join(private_dir, "wins.ldb")
     paths.dns_keytab = os.path.join(private_dir, "dns.keytab")
     paths.dns = os.path.join(private_dir, dnsdomain + ".zone")
     paths.winsdb = os.path.join(private_dir, "wins.ldb")
-    paths.ldap_basedn_ldif = os.path.join(private_dir, 
-                                          dnsdomain + ".ldif")
-    paths.ldap_config_basedn_ldif = os.path.join(private_dir, 
-                                             dnsdomain + "-config.ldif")
-    paths.ldap_schema_basedn_ldif = os.path.join(private_dir, 
-                                              dnsdomain + "-schema.ldif")
     paths.s4_ldapi_path = os.path.join(private_dir, "ldapi")
     paths.phpldapadminconfig = os.path.join(private_dir, 
                                             "phpldapadmin-config.php")
     paths.s4_ldapi_path = os.path.join(private_dir, "ldapi")
     paths.phpldapadminconfig = os.path.join(private_dir, 
                                             "phpldapadmin-config.php")
@@ -465,7 +459,6 @@ def setup_samdb(path, setup_path, session_info, credentials, lp,
         setup_add_ldif(samdb, setup_path("provision_basedn.ldif"), {
             "DOMAINDN": domaindn,
             "ACI": aci,
         setup_add_ldif(samdb, setup_path("provision_basedn.ldif"), {
             "DOMAINDN": domaindn,
             "ACI": aci,
-            "EXTENSIBLEOBJECT": "# no objectClass: extensibleObject for local ldb",
             "RDN_DC": rdn_dc,
             })
 
             "RDN_DC": rdn_dc,
             })
 
@@ -823,31 +816,6 @@ def create_zone_file(path, setup_path, samdb, dnsdomain, domaindn,
         })
 
 
         })
 
 
-def provision_ldapbase(setup_dir, message, paths):
-    """Write out a DNS zone file, from the info in the current database."""
-    message("Setting up LDAP base entry: %s" % domaindn)
-    rdns = domaindn.split(",")
-
-    rdn_dc = rdns[0][len("DC="):]
-
-    def setup_path(file):
-        return os.path.join(setup_dir, file)
-
-    setup_file(setup_path("provision_basedn.ldif"), 
-           paths.ldap_basedn_ldif)
-
-    setup_file(setup_path("provision_configuration_basedn.ldif"), 
-           paths.ldap_config_basedn_ldif)
-
-    setup_file(setup_path("provision_schema_basedn.ldif"), 
-           paths.ldap_schema_basedn_ldif, {
-            "SCHEMADN": schemadn,
-            "ACI": "# no aci for local ldb",
-            "EXTENSIBLEOBJECT": "objectClass: extensibleObject"})
-
-    message("Please install the LDIF located in " + paths.ldap_basedn_ldif + ", " + paths.ldap_config_basedn_ldif + " and " + paths.ldap_schema_basedn_ldif + " into your LDAP server, and re-run with --ldap-backend=ldap://my.ldap.server")
-
-
 def load_schema(setup_path, samdb, schemadn, netbiosname, configdn):
     """Load schema.
     
 def load_schema(setup_path, samdb, schemadn, netbiosname, configdn):
     """Load schema.
     
index e166d5f3dd28fc76ba06cd7732b12d0b23ceb702..88015ce0a314f9ef0945a39b4f0bd59d27a462f6 100755 (executable)
@@ -34,7 +34,7 @@ from auth import system_session
 import samba.getopt as options
 import param
 from samba.provision import (provision,  
 import samba.getopt as options
 import param
 from samba.provision import (provision,  
-                             provision_paths_from_lp, provision_ldapbase)
+                             provision_paths_from_lp)
 
 parser = optparse.OptionParser("provision [options]")
 parser.add_option_group(options.SambaOptions(parser))
 
 parser = optparse.OptionParser("provision [options]")
 parser.add_option_group(options.SambaOptions(parser))
@@ -81,9 +81,6 @@ parser.add_option("--users", type="string", metavar="GROUPNAME",
 parser.add_option("--quiet", help="Be quiet", action="store_true")
 parser.add_option("--blank", action="store_true",
                help="do not add users or groups, just the structure")
 parser.add_option("--quiet", help="Be quiet", action="store_true")
 parser.add_option("--blank", action="store_true",
                help="do not add users or groups, just the structure")
-parser.add_option("--ldap-base", 
-               help="output only an LDIF file, suitable for creating an LDAP baseDN",
-        action="store_true")
 parser.add_option("--ldap-backend", type="string", metavar="LDAPSERVER", 
                help="LDAP server to use for this provision")
 parser.add_option("--ldap-module=", type="string", metavar="MODULE", 
 parser.add_option("--ldap-backend", type="string", metavar="LDAPSERVER", 
                help="LDAP server to use for this provision")
 parser.add_option("--ldap-module=", type="string", metavar="MODULE", 
@@ -152,10 +149,7 @@ creds = credopts.get_credentials()
 setup_dir = opts.setupdir
 if setup_dir is None:
        setup_dir = "setup"
 setup_dir = opts.setupdir
 if setup_dir is None:
        setup_dir = "setup"
-if opts.ldap_base:
-       provision_ldapbase(setup_dir, message, paths)
-       message("Please install the LDIF located in %s, %s and  into your LDAP server, and re-run with --ldap-backend=ldap://my.ldap.server" % (paths.ldap_basedn_ldif, paths.ldap_config_basedn_ldif, paths.ldap_schema_basedn_ldif))
-elif opts.partitions_only:
+if opts.partitions_only:
     provision_become_dc(setup_dir, message, False, 
                         paths, lp, system_session(), creds)
 else:
     provision_become_dc(setup_dir, message, False, 
                         paths, lp, system_session(), creds)
 else: