summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeroen van Meeuwen (Kolab Systems) <vanmeeuwen@kolabsys.com>2012-05-06 10:53:10 (GMT)
committerJeroen van Meeuwen (Kolab Systems) <vanmeeuwen@kolabsys.com>2012-05-06 10:53:10 (GMT)
commit3507c91d8308870637245e54e6d8acec1208ca53 (patch)
tree97c5f72e51c4549e4820da3aa1b97fbdf05e99d7
parent9bc25577dfaa1235b6971affe8bd9f566ea261e9 (diff)
downloadpykolab-3507c91d8308870637245e54e6d8acec1208ca53.tar.gz
Correct duplication in setup_freebusy
-rw-r--r--pykolab/setup/setup_freebusy.py38
1 files changed, 6 insertions, 32 deletions
diff --git a/pykolab/setup/setup_freebusy.py b/pykolab/setup/setup_freebusy.py
index 0c66a17..4a5a282 100644
--- a/pykolab/setup/setup_freebusy.py
+++ b/pykolab/setup/setup_freebusy.py
@@ -44,6 +44,12 @@ def execute(*args, **kw):
log.error(_("Free/Busy is not installed on this system"))
return
+ if not hasattr(conf, 'mysql_roundcube_password'):
+ conf.mysql_roundcube_password = utils.ask_question(
+ _("MySQL roundcube password"),
+ password=True
+ )
+
horde_settings = {
'ldap_base_dn': conf.get('ldap', 'base_dn'),
'ldap_ldap_uri': conf.get('ldap', 'ldap_uri'),
@@ -85,38 +91,6 @@ def execute(*args, **kw):
fp.write(t.__str__())
fp.close()
- want_files = [
- 'config.php',
- ]
-
- for want_file in want_files:
- template_file = None
- if os.path.isfile('/etc/kolab/templates/freebusy/%s.tpl' % (want_file)):
- template_file = '/etc/kolab/templates/freebusy/%s.tpl' % (want_file)
- elif os.path.isfile('/usr/share/kolab/templates/freebusy/%s.tpl' % (want_file)):
- template_file = '/usr/share/kolab/templates/freebusy/%s.tpl' % (want_file)
- elif os.path.isfile(os.path.abspath(os.path.join(__file__, '..', '..', '..', 'share', 'templates', 'freebusy', '%s.tpl' % (want_file)))):
- template_file = os.path.abspath(os.path.join(__file__, '..', '..', '..', 'share', 'templates', 'freebusy', '%s.tpl' % (want_file)))
-
- if not template_file == None:
- log.debug(_("Using template file %r") % (template_file), level=8)
- fp = open(template_file, 'r')
- template_definition = fp.read()
- fp.close()
-
- t = Template(template_definition, searchList=[freebusy_settings])
- log.debug(
- _("Successfully compiled template %r, writing out to %r") % (
- template_file,
- '/etc/freebusy/%s' % (want_file)
- ),
- level=8
- )
-
- fp = open('/etc/kolab/freebusy/%s' % (want_file), 'w')
- fp.write(t.__str__())
- fp.close()
-
if os.path.isfile('/bin/systemctl'):
subprocess.call(['/bin/systemctl', 'restart', 'httpd.service'])
subprocess.call(['/bin/systemctl', 'enable', 'httpd.service'])