From 0638d539fb3a9709732f62dc8ff880eedf9078eb Mon Sep 17 00:00:00 2001 From: Nikolas Hermanns Date: Mon, 7 Mar 2016 13:31:16 +0100 Subject: Add no_deploy_environment option For development reason it is useable to have an option so that everything is done except the deploy of the openstack environment. Change-Id: I1f1b7f9c89ee8c9ceea96353e25a51eee53b955c Conflicts: deploy/cloud/deploy.py deploy/deploy.py deploy/deploy_env.py --- deploy/cloud/deploy.py | 25 +++++++++++++++++++++---- 1 file changed, 21 insertions(+), 4 deletions(-) (limited to 'deploy/cloud') diff --git a/deploy/cloud/deploy.py b/deploy/cloud/deploy.py index 59f63ff4f..e00934bd9 100644 --- a/deploy/cloud/deploy.py +++ b/deploy/cloud/deploy.py @@ -22,6 +22,7 @@ from common import ( check_file_exists, commafy, ArgParser, + log, ) YAML_CONF_DIR = '/var/lib/opnfv' @@ -29,9 +30,12 @@ YAML_CONF_DIR = '/var/lib/opnfv' class Deploy(object): - def __init__(self, dea_file, no_health_check): + def __init__(self, dea_file, no_health_check, deploy_timeout, + no_deploy_environment): self.dea = DeploymentEnvironmentAdapter(dea_file) self.no_health_check = no_health_check + self.deploy_timeout = deploy_timeout + self.no_deploy_environment = no_deploy_environment self.macs_per_blade = {} self.blades = self.dea.get_node_ids() self.blade_node_dict = self.dea.get_blade_node_map() @@ -59,8 +63,12 @@ class Deploy(object): def deploy_cloud(self): dep = Deployment(self.dea, YAML_CONF_DIR, self.env_id, - self.node_roles_dict, self.no_health_check) - dep.deploy() + self.node_roles_dict, self.no_health_check, + self.deploy_timeout) + if not self.no_deploy_environment: + dep.deploy() + else: + log('Configuration is done. Deployment is not launched.') def deploy(self): @@ -76,13 +84,22 @@ def parse_arguments(): parser.add_argument('-nh', dest='no_health_check', action='store_true', default=False, help='Don\'t run health check after deployment') + parser.add_argument('-dt', dest='deploy_timeout', action='store', + default=240, help='Deployment timeout (in minutes) ' + '[default: 240]') + parser.add_argument('-nde', dest='no_deploy_environment', + action='store_true', default=False, + help=('Do not launch environment deployment')) parser.add_argument('dea_file', action='store', help='Deployment Environment Adapter: dea.yaml') + args = parser.parse_args() check_file_exists(args.dea_file) kwargs = {'dea_file': args.dea_file, - 'no_health_check': args.no_health_check} + 'no_health_check': args.no_health_check, + 'deploy_timeout': args.deploy_timeout, + 'no_deploy_environment': args.no_deploy_environment} return kwargs -- cgit 1.2.3-korg