pykolab/setup

Jeroen van Meeuwen vanmeeuwen at kolabsys.com
Thu May 10 17:24:15 CEST 2012


 pykolab/setup/setup_kolabd.py |   19 +++++++++++++++++++
 1 file changed, 19 insertions(+)

New commits:
commit 86fbc965b3bd9c845d5d0efcc014e4ebff300f87
Author: Jeroen van Meeuwen (Kolab Systems) <vanmeeuwen at kolabsys.com>
Date:   Thu May 10 16:17:12 2012 +0100

    Rename the 'example.org' section to the primary domain having been set up if appropriate (#750)

diff --git a/pykolab/setup/setup_kolabd.py b/pykolab/setup/setup_kolabd.py
index 13e1fd7..9e35a85 100644
--- a/pykolab/setup/setup_kolabd.py
+++ b/pykolab/setup/setup_kolabd.py
@@ -43,6 +43,25 @@ def description():
     return _("Setup the Kolab daemon.")
 
 def execute(*args, **kw):
+    if conf.has_section('example.org'):
+        primary_domain = conf.get('kolab', 'primary_domain')
+
+        if not primary_domain == 'example.org':
+            utils.multiline_message(
+                    _("""
+                            Copying the configuration section for 'example.org' over to
+                            a section applicable to your domain '%s'.
+                        """) % (primary_domain)
+                )
+
+            conf.cfg_parser._sections[primary_domain] = \
+                    conf.cfg_parser._sections['example.org']
+            conf.cfg_parser._sections.pop('example.org')
+
+            fp = open(conf.cli_keywords.config_file, "w+")
+            conf.cfg_parser.write(fp)
+            fp.close()
+
     if os.path.isfile('/bin/systemctl'):
         subprocess.call(['systemctl', 'restart', 'kolabd.service'])
         subprocess.call(['systemctl', 'enable', 'kolabd.service'])





More information about the commits mailing list