aboutsummaryrefslogtreecommitdiffstats
path: root/deploy/cloud/deploy.py
diff options
context:
space:
mode:
authorPeter Barabas <peter.barabas@ericsson.com>2016-02-16 13:33:46 +0100
committerJonas Bjurel <jonas.bjurel@ericsson.com>2016-02-24 14:16:30 +0000
commitb4140094a6f8988c9dade3b4d4c378ac034f823b (patch)
tree2fea20f69ed31c26975aaa21e0eb6ed2e4cd1b04 /deploy/cloud/deploy.py
parent02f90f6fb95192a11b99a27584a82bcaf21f067e (diff)
Add timeout option for deployment
Change-Id: I6f3f35680c9f90f99148865edf8ba905ecbb6c30 Signed-off-by: Peter Barabas <peter.barabas@ericsson.com>
Diffstat (limited to 'deploy/cloud/deploy.py')
-rw-r--r--deploy/cloud/deploy.py12
1 files changed, 9 insertions, 3 deletions
diff --git a/deploy/cloud/deploy.py b/deploy/cloud/deploy.py
index 679b0ad6f..3d3017e42 100644
--- a/deploy/cloud/deploy.py
+++ b/deploy/cloud/deploy.py
@@ -29,9 +29,10 @@ 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):
self.dea = DeploymentEnvironmentAdapter(dea_file)
self.no_health_check = no_health_check
+ self.deploy_timeout = deploy_timeout
self.macs_per_blade = {}
self.blades = self.dea.get_node_ids()
self.blade_node_dict = self.dea.get_blade_node_map()
@@ -59,7 +60,8 @@ 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)
+ self.node_roles_dict, self.no_health_check,
+ self.deploy_timeout)
dep.deploy()
def deploy(self):
@@ -76,13 +78,17 @@ 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('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}
return kwargs