summaryrefslogtreecommitdiffstats
path: root/pykolab
diff options
context:
space:
mode:
authorJeroen van Meeuwen (Kolab Systems) <vanmeeuwen@kolabsys.com>2012-08-06 16:55:40 +0100
committerJeroen van Meeuwen (Kolab Systems) <vanmeeuwen@kolabsys.com>2012-08-06 17:00:22 +0100
commitf1914c04c8e924b81aeffd1e465654ff81ff40ca (patch)
tree51cce6a7aa1f5713d4a51602f5dff6c713606e3e /pykolab
parent8636607bc5bb01ee6c4c4e52e1cc4f3fa1739df3 (diff)
downloadpykolab-f1914c04c8e924b81aeffd1e465654ff81ff40ca.tar.gz
Prevent options from components from being added twice (#941)
Diffstat (limited to 'pykolab')
-rw-r--r--pykolab/setup/components.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/pykolab/setup/components.py b/pykolab/setup/components.py
index f69db05..f12fe84 100644
--- a/pykolab/setup/components.py
+++ b/pykolab/setup/components.py
@@ -32,6 +32,8 @@ components = {}
component_groups = {}
executed_components = []
+components_included_in_cli = []
+
finalize_conf_ok = None
def __init__():
@@ -117,6 +119,11 @@ def _list_components(*args, **kw):
return _components
def cli_options_from_component(component_name, *args, **kw):
+ global components_included_in_cli
+
+ if component_name in components_included_in_cli:
+ return
+
if components[component_name].has_key('group'):
group = components[component_name]['group']
component_name = components[component_name]['component_name']
@@ -133,6 +140,8 @@ def cli_options_from_component(component_name, *args, **kw):
except ImportError, e:
pass
+ components_included_in_cli.append(component_name)
+
def execute(component_name, *args, **kw):
if component_name == '':