Merge "fix deployment bug" into dev/experimental

This commit is contained in:
Jenkins 2014-08-07 06:48:18 +00:00 committed by Gerrit Code Review
commit 5ac173e9bb
3 changed files with 20 additions and 9 deletions

View File

@ -51,7 +51,9 @@ def deploy(cluster_id, hosts_id_list, username=None):
#deploy_manager.prepare_for_deploy() #deploy_manager.prepare_for_deploy()
deployed_config = deploy_manager.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): def redeploy(cluster_id, hosts_id_list, username=None):
@ -224,17 +226,25 @@ class ActionHelper(object):
return hosts_info return hosts_info
@staticmethod @staticmethod
def save_deployed_config(deployed_config, user): def save_deployed_config(
cluster_config = deployed_config[const.CLUSTER] cluster_id, hosts_id_list, deployed_config, user
cluster_id = cluster_config[const.ID] ):
del cluster_config[const.ID] 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_db.update_cluster_deployed_config(user, cluster_id,
**cluster_config) **cluster_config)
hosts_id_list = deployed_config[const.HOSTS].keys()
for clusterhost_id in hosts_id_list: 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, cluster_db.update_clusterhost_deployed_config(user,
clusterhost_id, clusterhost_id,
**config) **config)

View File

@ -92,7 +92,7 @@ class DeployManager(object):
# start to deploy OS # start to deploy OS
try: try:
os_deploy_config = self.os_installer.deploy() os_deploy_config = self.os_installer.deploy()
deploy_config = os_deploy_config deploy_config['os_config'] = os_deploy_config
except Exception as ex: except Exception as ex:
logging.error(ex.message) logging.error(ex.message)
@ -101,7 +101,7 @@ class DeployManager(object):
self.pk_installer) self.pk_installer)
pk_deploy_config = self.pk_installer.deploy() 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 return deploy_config

View File

@ -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/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/misc/apache/compass.wsgi /var/www/compass/compass.wsgi
sudo cp -rf $COMPASSDIR/conf/* /etc/compass/ 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/service/* /etc/init.d/
sudo cp -rf $COMPASSDIR/bin/*.py /opt/compass/bin/ sudo cp -rf $COMPASSDIR/bin/*.py /opt/compass/bin/
sudo cp -rf $COMPASSDIR/bin/*.sh /opt/compass/bin/ sudo cp -rf $COMPASSDIR/bin/*.sh /opt/compass/bin/