2 commits - pykolab/setup

Jeroen van Meeuwen vanmeeuwen at kolabsys.com
Mon Aug 6 18:01:12 CEST 2012


 pykolab/setup/components.py |    9 +++++++++
 pykolab/setup/setup_php.py  |   23 ++++++++++++-----------
 2 files changed, 21 insertions(+), 11 deletions(-)

New commits:
commit 8bd871afc71bc9ffa945ce18757175140f646436
Author: Jeroen van Meeuwen (Kolab Systems) <vanmeeuwen at kolabsys.com>
Date:   Mon Aug 6 16:58:00 2012 +0100

    Use timezone from cli option --timezone if specified (#942)
    Correct path used with Augeas insert (#943)

diff --git a/pykolab/setup/setup_php.py b/pykolab/setup/setup_php.py
index 36e3b4d..4d2679b 100644
--- a/pykolab/setup/setup_php.py
+++ b/pykolab/setup/setup_php.py
@@ -53,16 +53,17 @@ def description():
     return _("Setup PHP.")
 
 def execute(*args, **kw):
-    print >> sys.stderr, utils.multiline_message(
-            _("""
-                    Please supply the timezone PHP should be using.
-                """)
-        )
-
-    conf.timezone = utils.ask_question(
-            _("Timezone ID"),
-            default="UTC"
-        )
+    if conf.timezone == None:
+        print >> sys.stderr, utils.multiline_message(
+                _("""
+                        Please supply the timezone PHP should be using.
+                    """)
+            )
+
+        conf.timezone = utils.ask_question(
+                _("Timezone ID"),
+                default="UTC"
+            )
 
     myaugeas = Augeas()
 
@@ -74,7 +75,7 @@ def execute(*args, **kw):
     if current_value == None:
         insert_paths = myaugeas.match('/files/etc/php.ini/Date/*')
         insert_path = insert_paths[(len(insert_paths)-1)]
-        myaugeas.insert(insert_path, setting_key, False)
+        myaugeas.insert(insert_path, 'date.timezone', False)
 
     log.debug(_("Setting key %r to %r") % ('Date/date.timezone', conf.timezone), level=8)
     myaugeas.set(setting, conf.timezone)


commit b1b4ef347b4fd7203bed641bb4b526aa339bb139
Author: Jeroen van Meeuwen (Kolab Systems) <vanmeeuwen at kolabsys.com>
Date:   Mon Aug 6 16:55:40 2012 +0100

    Prevent options from components from being added twice (#941)

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 == '':
 





More information about the commits mailing list