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()