X-Git-Url: https://gerrit.opnfv.org/gerrit/gitweb?a=blobdiff_plain;f=deploy%2Fdeploy_env.py;h=93dc3959b3c8f102dfafa03a46c622e6a895b517;hb=2ade11e26759979ecc213505b6657a36105ee60d;hp=735ea66a3e07c868733d3ea2a483e1a1a70b1e51;hpb=ce32b60906075b9471e9ebdb035998fd20afacc6;p=fuel.git diff --git a/deploy/deploy_env.py b/deploy/deploy_env.py index 735ea66a3..93dc3959b 100644 --- a/deploy/deploy_env.py +++ b/deploy/deploy_env.py @@ -20,6 +20,7 @@ from ssh_client import SSHClient from common import ( err, log, + exec_cmd, parse, N, E, @@ -34,7 +35,8 @@ BLADE_RESTART_TIMES = 3 class CloudDeploy(object): def __init__(self, dea, dha, fuel_ip, fuel_username, fuel_password, - dea_file, fuel_plugins_conf_dir, work_dir, no_health_check): + dea_file, fuel_plugins_conf_dir, work_dir, no_health_check, + deploy_timeout, no_deploy_environment, deploy_log): self.dea = dea self.dha = dha self.fuel_ip = fuel_ip @@ -48,6 +50,9 @@ class CloudDeploy(object): self.fuel_plugins_conf_dir = fuel_plugins_conf_dir self.work_dir = work_dir self.no_health_check = no_health_check + self.deploy_timeout = deploy_timeout + self.no_deploy_environment = no_deploy_environment + self.deploy_log = deploy_log self.file_dir = os.path.dirname(os.path.realpath(__file__)) self.ssh = SSHClient(self.fuel_ip, self.fuel_username, self.fuel_password) @@ -103,8 +108,13 @@ class CloudDeploy(object): deploy_app = '%s/%s' % (self.work_dir, deploy_app) dea_file = '%s/%s' % (self.work_dir, os.path.basename(self.dea_file)) with self.ssh as s: - status = s.run('python %s %s %s' % ( - deploy_app, ('-nh' if self.no_health_check else ''), dea_file)) + status = s.run('python %s %s %s %s %s' % ( + deploy_app, + ('-nh' if self.no_health_check else ''), + ('-dt %s' % + self.deploy_timeout if self.deploy_timeout else ''), + ('-nde' if self.no_deploy_environment else ''), + dea_file)) return status def check_supported_release(self): @@ -208,7 +218,8 @@ class CloudDeploy(object): def node_discovery(self, node_list, discovered_macs): for node in node_list: if (node[N['status']] == 'discover' and - node[N['online']] == 'True' and + (node[N['online']] == 'True' or + node[N['online']] == '1') and node[N['mac']] not in discovered_macs): discovered_macs.append(node[N['mac']]) blade = self.find_mac_in_dict(node[N['mac']]) @@ -247,6 +258,10 @@ class CloudDeploy(object): self.set_boot_order(['pxe', 'disk']) self.power_on_nodes() + def get_put_deploy_log(self): + with self.ssh as s: + s.scp_get("deploy-*", local=self.deploy_log) + def deploy(self): self.set_boot_order_nodes() @@ -263,4 +278,8 @@ class CloudDeploy(object): delete(self.updated_dea_file) - return self.run_cloud_deploy(CLOUD_DEPLOY_FILE) + rc = self.run_cloud_deploy(CLOUD_DEPLOY_FILE) + + self.get_put_deploy_log() + + return rc