2 commits - pykolab/setup

Jeroen van Meeuwen vanmeeuwen at kolabsys.com
Wed Apr 24 17:00:55 CEST 2013


 pykolab/setup/setup_ldap.py |   30 ++++++++++++------------------
 1 file changed, 12 insertions(+), 18 deletions(-)

New commits:
commit 99a3ed7fdf4476a78aed722329bb874fc8b4ad06
Author: Jeroen van Meeuwen (Kolab Systems) <vanmeeuwen at kolabsys.com>
Date:   Wed Apr 24 17:00:16 2013 +0200

    These command-line options are now available to setup-kolab.
    
        --without-ldap will simply skip the entire step setting up LDAP.
    
        --with-openldap will set configuration options compatible with
            OpenLDAP (as opposed to Netscape-based directory services),
            including but not limited to 'unique_attribute' ('nsuniqueid'
            for Netscape-based directory services, 'entryuuid' for
            OpenLDAP).
    
    It is assumed deployments that use OpenLDAP:
    
        - Set up OpenLDAP themselves,
    
        - Provide, within this LDAP tree, a bind DN for Kolab to
          use, that is authorized to use syncrepl,
    
        - Provide the equivalent of a cyrus-admin login account,
    
        - Set the ldap_uri, base_dn, bind_dn, bind_pw,
          service_bind_dn, service_bind_pw, user_base_dn,
          group_base_dn, resource_base_dn, sharedfolder_base_dn,
          and other options in the [ldap] section in a file other
          then /etc/kolab/kolab.conf, to then specify this file
          to setup-kolab with the "-c" command-line option. This is
          seeding setup-kolab with an answer file.
    
        - Modify imapd.conf to not use roles for group authorization,
    
        - Are careful using the Kolab Web Administration Panel
          because of its dependency on effectiveRights controls.

diff --git a/pykolab/setup/setup_ldap.py b/pykolab/setup/setup_ldap.py
index 2650fa8..acb4cea 100644
--- a/pykolab/setup/setup_ldap.py
+++ b/pykolab/setup/setup_ldap.py
@@ -60,6 +60,22 @@ def cli_options():
             help    = _("Allow anonymous binds (default: no).")
         )
 
+    ldap_group.add_option(
+            "--without-ldap",
+            dest    = "without_ldap",
+            action  = "store_true",
+            default = False,
+            help    = _("Skip setting up the LDAP server.")
+        )
+
+    ldap_group.add_option(
+            "--with-openldap",
+            dest    = "with_openldap",
+            action  = "store_true",
+            default = False,
+            help    = _("Setup configuration for OpenLDAP compatibility.")
+        )
+
 def description():
     return _("Setup LDAP.")
 
@@ -69,6 +85,22 @@ def execute(*args, **kw):
     if not conf.config_file == conf.defaults.config_file:
         ask_questions = False
 
+    if conf.without_ldap:
+        print >> sys.stderr, _("Skipping setup of LDAP, as specified")
+        return
+
+    _input = {}
+
+    if conf.with_openldap:
+
+        conf.command_set('ldap', 'unique_attribute', 'entryuuid')
+
+        fp = open(conf.defaults.config_file, "w+")
+        conf.cfg_parser.write(fp)
+        fp.close()
+
+        return
+
     # Pre-execution checks
     for path, directories, files in os.walk('/etc/dirsrv/'):
         for direct in directories:
@@ -163,7 +195,6 @@ def execute(*args, **kw):
         _input['fqdn'] = fqdn
         _input['hostname'] = hostname.split('.')[0]
         _input['domain'] = domainname
-
     _input['nodotdomain'] = _input['domain'].replace('.','_')
 
     _input['rootdn'] = utils.standard_root_dn(_input['domain'])
@@ -608,3 +639,4 @@ ServerAdminPwd = %(admin_pass)s
     else:
         log.error(_("Could not start and configure to start on boot, the " + \
                 "directory server admin service."))
+


commit 537d26c497aee5856c82b711b367dff2b1e5ce1f
Author: Jeroen van Meeuwen (Kolab Systems) <vanmeeuwen at kolabsys.com>
Date:   Wed Apr 24 16:58:40 2013 +0200

    Revert "Add --without-ldap and --with-openldap"
    
    This reverts commit 64661dba08874578b4fa91b86ba7ceee9f669726.

diff --git a/pykolab/setup/setup_ldap.py b/pykolab/setup/setup_ldap.py
index de371b4..2650fa8 100644
--- a/pykolab/setup/setup_ldap.py
+++ b/pykolab/setup/setup_ldap.py
@@ -60,48 +60,15 @@ def cli_options():
             help    = _("Allow anonymous binds (default: no).")
         )
 
-    ldap_group.add_option(
-            "--without-ldap",
-            dest    = "without_ldap",
-            action  = "store_true",
-            default = False,
-            help    = _("Skip setting up the LDAP server.")
-        )
-
-    ldap_group.add_option(
-            "--with-openldap",
-            dest    = "with_openldap",
-            action  = "store_true",
-            default = False,
-            help    = _("Setup configuration for OpenLDAP compatibility.")
-        )
-
 def description():
     return _("Setup LDAP.")
 
 def execute(*args, **kw):
-
     ask_questions = True
 
     if not conf.config_file == conf.defaults.config_file:
         ask_questions = False
 
-    if conf.without_ldap:
-        print >> sys.stderr, _("Skipping setup of LDAP, as specified")
-        return
-
-    _input = {}
-
-    if conf.with_openldap:
-
-        conf.command_set('ldap', 'unique_attribute', 'entryuuid')
-
-        fp = open(conf.defaults.config_file, "w+")
-        conf.cfg_parser.write(fp)
-        fp.close()
-
-        return
-
     # Pre-execution checks
     for path, directories, files in os.walk('/etc/dirsrv/'):
         for direct in directories:
@@ -183,7 +150,19 @@ def execute(*args, **kw):
 
     # TODO: Verify the user and group exist.
 
-    _input = request_kolab_domain(_input)
+    # TODO: This takes the system fqdn, domainname and hostname, rather then
+    # the desired fqdn, domainname and hostname.
+    #
+    # TODO^2: This should be confirmed.
+
+    if conf.fqdn:
+        _input['fqdn'] = conf.fqdn
+        _input['hostname'] = conf.fqdn.split('.')[0]
+        _input['domain'] = '.'.join(conf.fqdn.split('.')[1:])
+    else:
+        _input['fqdn'] = fqdn
+        _input['hostname'] = hostname.split('.')[0]
+        _input['domain'] = domainname
 
     _input['nodotdomain'] = _input['domain'].replace('.','_')
 
@@ -629,20 +608,3 @@ ServerAdminPwd = %(admin_pass)s
     else:
         log.error(_("Could not start and configure to start on boot, the " + \
                 "directory server admin service."))
-
-def request_kolab_domain(_input):
-    # TODO: This takes the system fqdn, domainname and hostname, rather then
-    # the desired fqdn, domainname and hostname.
-    #
-    # TODO^2: This should be confirmed.
-
-    if conf.fqdn:
-        _input['fqdn'] = conf.fqdn
-        _input['hostname'] = conf.fqdn.split('.')[0]
-        _input['domain'] = '.'.join(conf.fqdn.split('.')[1:])
-    else:
-        _input['fqdn'] = fqdn
-        _input['hostname'] = hostname.split('.')[0]
-        _input['domain'] = domainname
-
-





More information about the commits mailing list