wcsinstd: generate apache vhost configuration file

This commit is contained in:
Frédéric Péters 2013-06-12 14:21:46 +02:00
parent d24a398daa
commit 585100d2cc
1 changed files with 9 additions and 1 deletions

View File

@ -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):