summaryrefslogtreecommitdiffstats
path: root/deploy
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-04-10 19:27:19 +0200
commita2bd1d8baa9d2c256671834fc90a1c7e489850d7 (patch)
tree0dd5d7bfc3fb11dade1d6f4270797de777a930e3 /deploy
parentcc51d7477901e5acf27e3599754f6a751231a2f1 (diff)
Add timeout option for deployment
Change-Id: I6f3f35680c9f90f99148865edf8ba905ecbb6c30 Signed-off-by: Peter Barabas <peter.barabas@ericsson.com> Conflicts: deploy/cloud/deploy.py deploy/deploy.py deploy/deploy_env.py
Diffstat (limited to 'deploy')
-rw-r--r--deploy/cloud/deployment.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/deploy/cloud/deployment.py b/deploy/cloud/deployment.py
index 42bab09bb..306abf006 100644
--- a/deploy/cloud/deployment.py
+++ b/deploy/cloud/deployment.py
@@ -31,12 +31,13 @@ LIST_OF_CHAR_TO_BE_ESCAPED = ['[', ']', '"']
class Deployment(object):
def __init__(self, dea, yaml_config_dir, env_id, node_id_roles_dict,
- no_health_check):
+ no_health_check, deploy_timeout):
self.dea = dea
self.yaml_config_dir = yaml_config_dir
self.env_id = env_id
self.node_id_roles_dict = node_id_roles_dict
self.no_health_check = no_health_check
+ self.deploy_timeout = deploy_timeout
self.pattern = re.compile(
'\d\d\d\d-\d\d-\d\d\s\d\d:\d\d:\d\d')
@@ -96,7 +97,6 @@ class Deployment(object):
print(log_msg + '\n')
def run_deploy(self):
- WAIT_LOOP = 240
SLEEP_TIME = 60
LOG_FILE = 'cloud.log'
@@ -105,7 +105,7 @@ class Deployment(object):
% (self.env_id, LOG_FILE))
ready = False
- for i in range(WAIT_LOOP):
+ for i in range(int(self.deploy_timeout)):
env = parse(exec_cmd('fuel env --env %s' % self.env_id))
log('Environment status: %s' % env[0][E['status']])
r, _ = exec_cmd('tail -2 %s | head -1' % LOG_FILE, False)