summaryrefslogtreecommitdiffstats
path: root/pykolab/conf/__init__.py
diff options
context:
space:
mode:
Diffstat (limited to 'pykolab/conf/__init__.py')
-rw-r--r--pykolab/conf/__init__.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/pykolab/conf/__init__.py b/pykolab/conf/__init__.py
index 64dfbe5..16f38d8 100644
--- a/pykolab/conf/__init__.py
+++ b/pykolab/conf/__init__.py
@@ -564,7 +564,7 @@ class Conf(object):
return self.cfg_parser.has_option(section, option)
- def get_list(self, section, key):
+ def get_list(self, section, key, default=None):
"""
Gets a comma and/or space separated list from the configuration file
and returns a list.
@@ -573,13 +573,14 @@ class Conf(object):
untrimmed_values = []
setting = self.get_raw(section, key)
+
if setting is None:
- return []
+ return default if default else []
raw_values = setting.split(',')
if raw_values is None:
- return []
+ return default if default else []
for raw_value in raw_values:
untrimmed_values.extend(raw_value.split(' '))