summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Boddie <paul@boddie.org.uk>2014-08-07 14:25:59 (GMT)
committerPaul Boddie <paul@boddie.org.uk>2014-08-07 14:25:59 (GMT)
commitaf4b7b00141f9768b06f600c7e8b7bff4d362c1e (patch)
tree982d8d8bdbe2f2558b061db4ac745cf74279dca0
parentf9d9f274fba200bd0b4ab4df0f72b6316703324d (diff)
downloadpykolab-af4b7b00141f9768b06f600c7e8b7bff4d362c1e.tar.gz
Made option testing more robust; adjusted the settings data structure.
-rw-r--r--pykolab/setup/setup_freebusy.py15
1 files changed, 8 insertions, 7 deletions
diff --git a/pykolab/setup/setup_freebusy.py b/pykolab/setup/setup_freebusy.py
index 5096f65..6993d5e 100644
--- a/pykolab/setup/setup_freebusy.py
+++ b/pykolab/setup/setup_freebusy.py
@@ -91,8 +91,8 @@ def execute(*args, **kw):
resources_imap_uri = '%s://%s:%s@%s:%s/%%kolabtargetfolder?acl=lrs' % (scheme, admin_login, admin_password, hostname, port)
users_imap_uri = '%s://%%mail:%s@%s:%s/?proxy_auth=%s' % (scheme, admin_password, hostname, port, admin_login)
- freebusy_settings = {
- 'directory "kolab-users"': {
+ freebusy_settings = [
+ ('directory "kolab-users"', {
'type': 'ldap',
'host': conf.get('ldap', 'ldap_uri'),
'base_dn': conf.get('ldap', 'base_dn'),
@@ -105,8 +105,8 @@ def execute(*args, **kw):
'cacheto': '/var/cache/kolab-freebusy/%mail.ifb',
'expires': '15m',
'loglevel': 300,
- },
- 'directory "kolab-resources"': {
+ }),
+ ('directory "kolab-resources"', {
'type': 'ldap',
'host': conf.get('ldap', 'ldap_uri'),
'base_dn': conf.get('ldap', 'resource_base_dn'),
@@ -118,8 +118,8 @@ def execute(*args, **kw):
'cacheto': '/var/cache/kolab-freebusy/%mail.ifb',
'expires': '15m',
'loglevel': 300
- },
- }
+ }),
+ ]
cfg_parser = RawConfigParser()
cfg_parser.read(config)
@@ -135,7 +135,8 @@ def execute(*args, **kw):
cfg_parser.add_section(section)
for key, value in definitions.items():
- current = cfg_parser.get(section, key)
+ value = str(value)
+ current = cfg_parser.has_option(section, key) and cfg_parser.get(section, key) or None
# ConfigParser does not handle quoting for certain consumers of
# .ini files like PHP's parse_ini_file.