diff --git a/compass/actions/deploy.py b/compass/actions/deploy.py index 1b527c74..dfb16d5e 100644 --- a/compass/actions/deploy.py +++ b/compass/actions/deploy.py @@ -51,7 +51,9 @@ def deploy(cluster_id, hosts_id_list, username=None): #deploy_manager.prepare_for_deploy() deployed_config = deploy_manager.deploy() - ActionHelper.save_deployed_config(deployed_config, user) + ActionHelper.save_deployed_config( + cluster_id, hosts_id_list, deployed_config, user + ) def redeploy(cluster_id, hosts_id_list, username=None): @@ -224,17 +226,25 @@ class ActionHelper(object): return hosts_info @staticmethod - def save_deployed_config(deployed_config, user): - cluster_config = deployed_config[const.CLUSTER] - cluster_id = cluster_config[const.ID] - del cluster_config[const.ID] + def save_deployed_config( + cluster_id, hosts_id_list, deployed_config, user + ): + cluster_config = dict([ + (key, value[const.CLUSTER]) + for key, value in deployed_config.items() + ]) + for key, value in cluster_config.items(): + if const.ID in value: + del value[const.ID] cluster_db.update_cluster_deployed_config(user, cluster_id, **cluster_config) - hosts_id_list = deployed_config[const.HOSTS].keys() for clusterhost_id in hosts_id_list: - config = deployed_config[const.HOSTS][clusterhost_id] + config = dict([ + (key, value[const.HOSTS][clusterhost_id]) + for key, value in deployed_config.items() + ]) cluster_db.update_clusterhost_deployed_config(user, clusterhost_id, **config) diff --git a/compass/deployment/deploy_manager.py b/compass/deployment/deploy_manager.py index d95f4079..9cea4ece 100644 --- a/compass/deployment/deploy_manager.py +++ b/compass/deployment/deploy_manager.py @@ -92,7 +92,7 @@ class DeployManager(object): # start to deploy OS try: os_deploy_config = self.os_installer.deploy() - deploy_config = os_deploy_config + deploy_config['os_config'] = os_deploy_config except Exception as ex: logging.error(ex.message) @@ -101,7 +101,7 @@ class DeployManager(object): self.pk_installer) pk_deploy_config = self.pk_installer.deploy() - util.merge_dict(deploy_config, pk_deploy_config) + deploy_config['package_config'] = pk_deploy_config return deploy_config diff --git a/install/compass.sh b/install/compass.sh index e33bfaae..ed920596 100755 --- a/install/compass.sh +++ b/install/compass.sh @@ -10,6 +10,7 @@ mkdir -p /var/www/compass sudo cp -rf $COMPASSDIR/misc/apache/ods-server.conf /etc/httpd/conf.d/ods-server.conf sudo cp -rf $COMPASSDIR/misc/apache/compass.wsgi /var/www/compass/compass.wsgi sudo cp -rf $COMPASSDIR/conf/* /etc/compass/ +sudo cp -rf $COMPASSDIR/templates /etc/compass/ sudo cp -rf $COMPASSDIR/service/* /etc/init.d/ sudo cp -rf $COMPASSDIR/bin/*.py /opt/compass/bin/ sudo cp -rf $COMPASSDIR/bin/*.sh /opt/compass/bin/