wcsinstd: pass the received site_options_cfg record to the site-options.cfg template file

refs #3193
This commit is contained in:
Benjamin Dauvergne 2013-09-02 10:35:13 +02:00
parent f0b68e3d05
commit 66e3d79fcd
1 changed files with 7 additions and 2 deletions

View File

@ -25,9 +25,10 @@ class DeployInstance(object):
skel_dir = None
collectivity_install_dir = None
def __init__(self, domain, title):
def __init__(self, domain, title, site_options_cfg):
self.domain = domain
self.title = title
self.site_options_cfg = site_options_cfg
def make(self):
self.skel_dir = os.path.join(settings.MEDIA_ROOT, 'skeletons', self.skeleton)
@ -202,7 +203,11 @@ class DeployInstance(object):
return
options_template = file(options_template_path).read()
file(os.path.join(self.collectivity_install_dir, 'site-options.cfg'), 'w').write(
string.Template(options_template).substitute({'domain': self.domain}))
string.Template(options_template).substitute({
'domain': self.domain,
'options': self.site_options_cfg
})
)
def make_apache_vhost(self):