From 6b376cfffb2c468442d2fb32d093e28372c6f2d9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20P=C3=A9ters?= Date: Wed, 12 Jun 2013 16:50:45 +0200 Subject: [PATCH] wcsinstd: do not fail on missing config.pck --- wcsinst/wcsinstd/deploy.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/wcsinst/wcsinstd/deploy.py b/wcsinst/wcsinstd/deploy.py index 08dcefc..b57929b 100644 --- a/wcsinst/wcsinstd/deploy.py +++ b/wcsinst/wcsinstd/deploy.py @@ -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()