summaryrefslogtreecommitdiffstats
path: root/deploy/deploy_env.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/deploy_env.py
parent02f90f6fb95192a11b99a27584a82bcaf21f067e (diff)
Add timeout option for deployment
Change-Id: I6f3f35680c9f90f99148865edf8ba905ecbb6c30 Signed-off-by: Peter Barabas <peter.barabas@ericsson.com>
Diffstat (limited to 'deploy/deploy_env.py')
-rw-r--r--deploy/deploy_env.py11
1 files changed, 8 insertions, 3 deletions
diff --git a/deploy/deploy_env.py b/deploy/deploy_env.py
index 735ea66a3..3d1cdf430 100644
--- a/deploy/deploy_env.py
+++ b/deploy/deploy_env.py
@@ -34,7 +34,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):
self.dea = dea
self.dha = dha
self.fuel_ip = fuel_ip
@@ -48,6 +49,7 @@ 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.file_dir = os.path.dirname(os.path.realpath(__file__))
self.ssh = SSHClient(self.fuel_ip, self.fuel_username,
self.fuel_password)
@@ -103,8 +105,11 @@ 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' % (
+ deploy_app,
+ ('-nh' if self.no_health_check else ''),
+ ('-dt %s' % self.deploy_timeout if self.deploy_timeout else ''),
+ dea_file))
return status
def check_supported_release(self):