diff --git a/wcsinst/wcsinstd/deploy.py b/wcsinst/wcsinstd/deploy.py index bd91222..9ba05e9 100644 --- a/wcsinst/wcsinstd/deploy.py +++ b/wcsinst/wcsinstd/deploy.py @@ -1,4 +1,3 @@ -import string import cPickle import os import zipfile @@ -153,7 +152,7 @@ class DeployInstance(object): idff_metadata_template = file( os.path.join(self.skel_dir, 'idff-metadata-template')).read() file(os.path.join(self.collectivity_install_dir, 'metadata.xml'), 'w').write( - string.Template(idff_metadata_template).substitute({'url': url_stripped})) + idff_metadata_template.format(url=url_stripped)) if os.path.exists(os.path.join(self.skel_dir, 'saml2-metadata-template')): # there's a SAMLv2 metadata template, so we do the SAMLv2 stuff @@ -167,7 +166,7 @@ class DeployInstance(object): saml2_metadata_template = file( os.path.join(self.skel_dir, 'saml2-metadata-template')).read() file(os.path.join(self.collectivity_install_dir, 'saml2-metadata.xml'), 'w').write( - string.Template(saml2_metadata_template).substitute({'url': url_stripped})) + saml2_metadata_template.format(url=url_stripped)) if has_idff or has_saml2: idp_metadata = ET.parse(file(os.path.join(self.skel_dir, 'idp-metadata.xml'))) @@ -207,11 +206,8 @@ 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, - 'options': self.site_options_cfg - }) - ) + options_template.format(domain=self.domain, + options=self.site_options_cfg)) def make_apache_vhost(self): @@ -223,7 +219,7 @@ class DeployInstance(object): 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})) + apache_vhost_template.format(domain=self.domain)) def reload_apache(self):