summaryrefslogtreecommitdiffstats
path: root/pykolab
diff options
context:
space:
mode:
authorJeroen van Meeuwen (Kolab Systems) <vanmeeuwen@kolabsys.com>2012-08-06 16:58:00 +0100
committerJeroen van Meeuwen (Kolab Systems) <vanmeeuwen@kolabsys.com>2012-08-06 16:59:33 +0100
commit8636607bc5bb01ee6c4c4e52e1cc4f3fa1739df3 (patch)
treeed6b85403b9236f3ac1a07de675419a4471be411 /pykolab
parent933d9a23f272c7633b195ed435a288e8015a2fa5 (diff)
downloadpykolab-8636607bc5bb01ee6c4c4e52e1cc4f3fa1739df3.tar.gz
Use timezone from cli option --timezone if specified (#942)
Correct path used with Augeas insert (#943)
Diffstat (limited to 'pykolab')
-rw-r--r--pykolab/setup/setup_php.py23
1 files changed, 12 insertions, 11 deletions
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)