diff options
author | Jeroen van Meeuwen (Kolab Systems) <vanmeeuwen@kolabsys.com> | 2012-05-10 16:17:12 +0100 |
---|---|---|
committer | Jeroen van Meeuwen (Kolab Systems) <vanmeeuwen@kolabsys.com> | 2012-05-10 16:17:48 +0100 |
commit | 42f7c1d55b1949c35c3a5e94fb424e49a8a73a99 (patch) | |
tree | 6b5e8a9b67ce6806e5df0c3428d246cbf3bb8823 /pykolab | |
parent | 65906121805fe74f384bc265883731a1c0a0695e (diff) | |
download | pykolab-42f7c1d55b1949c35c3a5e94fb424e49a8a73a99.tar.gz |
Rename the 'example.org' section to the primary domain having been set up if appropriate (#750)
Diffstat (limited to 'pykolab')
-rw-r--r-- | pykolab/setup/setup_kolabd.py | 19 |
1 files changed, 19 insertions, 0 deletions
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']) |