wcsinstd: do not fail on missing config.pck

This commit is contained in:
Frédéric Péters 2013-06-12 16:50:45 +02:00
parent 0d0991a3b1
commit 6b376cfffb
1 changed files with 6 additions and 2 deletions

View File

@ -60,14 +60,18 @@ class DeployInstance(object):
open(path, 'w').write(data)
z.close()
wcs_cfg = cPickle.load(file(os.path.join(self.collectivity_install_dir, 'config.pck')))
config_file = os.path.join(self.collectivity_install_dir, 'config.pck')
if os.path.exists(config_file):
wcs_cfg = cPickle.load(file(os.path.join(self.collectivity_install_dir, 'config.pck')))
else:
wcs_cfg = {}
# TODO: there are some settings to change in wcs_cfg
# (like the name of the database)
self.make_sso_config(wcs_cfg)
self.make_site_options()
cPickle.dump(wcs_cfg, file(os.path.join(self.collectivity_install_dir, 'config.pck'), 'w'))
cPickle.dump(wcs_cfg, file(config_file, 'w'))
self.make_apache_vhost()
self.reload_apache()