[Kolab-devel] Proposal - Distro specific changes for Kolab 3

Enrico Tagliavini enrico.tagliavini at gmail.com
Wed May 22 16:03:33 CEST 2013


Hi Aeneas,

here it is your first feedback:

log.error(_("Unknown or unsupported distribution, falling back to default"))

talking from a sysadmin POV [I'm not a kolab developer, just an happy user
and administrator], please change this to info, or warning at most. It is
not an error if there is no distro specific config, and it is not a good
thing to scare the admin with an error, which might not be an error at all
:).

Cheers
Enrico


On Wed, May 22, 2013 at 2:36 PM, Aeneas Jaißle <jaissle at sewikom.de> wrote:

> **
>
> Hi everybody,
>
>
>
> I'd like to enhance Kolab's distribution support and make live for (us)
> packagers easier.
>
>
>
> For that, I put a layer between paths, service names, user and groups (=
> between all that could differ on another distribution).
>
>
>
> This layer eventually is a settings.py, that
>
> 1) Loads default settings
>
> 2) Selects and loads (optional) distribution specific settings,
> overwriting the default settings
>
> 3) Loads (optional) custom settings, overwriting default and distribution
> specific settings
>
>
>
> I'd use something similar to the following (as I have to get used to
> python, there might be some errors):
>
>
>
> import platform
>
> from pykolab.settings_default import *
>
>
>
> distribution = platform.linux_distribution()
>
> if distribution[0] = 'openSUSE':
>
> from pykolab.settings_suse import *
>
> elif distribution[0] = 'Fedora':
>
> from pykolab.settings_fedora import *
>
> elif distribution[0] = 'Mageia':
>
> from pykolab.settings_mageia import *
>
> elif distribution[0] = 'Debian':
>
> from pykolab.settings_debian import *
>
> ...
>
> else:
>
> log.error(_("Unknown or unsupported distribution, falling back to
> default"))
>
>
>
> from pykolab.settings_custom import *
>
>
>
>
>
> Settings are also stored in python files. settings_default.py would have
> something like
>
> s_cyrus-imapd = 'cyrus-imapd.service'
>
> s_kolabd = 'kolabd.service'
>
> s_postfix = 'postfix.service'
>
> s_amavisd = 'amavisd.service'
>
> s_clamd = 'clamd.service'
>
> s_wallace = 'wallace.service'
>
> s_mysqld = 'mysqld.service'
>
> s_httpd = 'httpd.service'
>
> if service_type = 'systemd':
>
> bin_systemctl = '/bin/systemctl'
>
>
>
> While settings_suse.py only has
>
> s_httpd = 'apache2.service'
>
> service_type = 'systemd'
>
>
>
> Services would be called
>
> def s_restart_httpd:
>
> subprocess.call([bin_systemctl, s_httpd, 'restart'])
>
>
>
> setup_roundcubemail.py:
>
> from pykolab.settings import *
>
> ...
>
> s_restart_httpd
>
>
>
> pykolab would only load the settings, packagers would adjust everything
> once inside their settings_dist.py (having everything in one place) and add
> their distribution to settings.py. They would only have to change settings,
> if these differ from the defaults. Users could further customize their
> installation, changing settings in settings_custom.py.
>
>
>
>
>
> Is something like this wanted upstream? Would this be the rights way to do
> (in python)? Feedback welcome!
>
>
>
> - Aeneas
>
>
>
> _______________________________________________
> Kolab-devel mailing list
> Kolab-devel at kolab.org
> https://www.intevation.de/mailman/listinfo/kolab-devel
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.kolab.org/pipermail/devel/attachments/20130522/0890b322/attachment.html>


More information about the devel mailing list