From 585100d2cc3371b8227378b2428b314e67518102 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20P=C3=A9ters?= Date: Wed, 12 Jun 2013 14:21:46 +0200 Subject: [PATCH] wcsinstd: generate apache vhost configuration file --- wcsinst/wcsinstd/deploy.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/wcsinst/wcsinstd/deploy.py b/wcsinst/wcsinstd/deploy.py index f82c5ff..08dcefc 100644 --- a/wcsinst/wcsinstd/deploy.py +++ b/wcsinst/wcsinstd/deploy.py @@ -152,7 +152,15 @@ class DeployInstance(object): def make_apache_vhost(self): - pass + apache_vhost_template_path = os.path.join(self.skel_dir, 'apache-vhost.conf') + if not os.path.exists(apache_vhost_template_path): + return + apache_vhost_template = file(apache_vhost_template_path).read() + apache_dir = os.path.join(settings.MEDIA_ROOT, 'vhosts.d') + if not os.path.exists(apache_dir): + os.mkdir(apache_dir) + file(os.path.join(apache_dir, '%s.conf' % self.domain), 'w').write( + string.Template(apache_vhost_template).substitute({'domain': self.domain})) def reload_apache(self):