From a02ca6e6f66f366d85d8ff70b07130a5ead42f64 Mon Sep 17 00:00:00 2001 From: Ana Krivokapic Date: Mon, 20 Aug 2018 17:04:55 +0300 Subject: [PATCH] Make inventory fail if Heat engine is down This change ensures that the inventory script will fail, and not hang, if the Heat engine is not running. Change-Id: Ib22a926aca736819cbfbe53fd3c5d53640e462b8 --- scripts/tripleo-ansible-inventory | 3 ++- tripleo_validations/utils.py | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/scripts/tripleo-ansible-inventory b/scripts/tripleo-ansible-inventory index 29002271a..8f4056cf5 100755 --- a/scripts/tripleo-ansible-inventory +++ b/scripts/tripleo-ansible-inventory @@ -126,7 +126,8 @@ def main(): 'project_name': configs.project_name, 'os_auth_token': configs.auth_token, 'password': configs.password, - 'cacert': configs.cacert + 'cacert': configs.cacert, + 'timeout': 30 } inventory = TripleoInventory( diff --git a/tripleo_validations/utils.py b/tripleo_validations/utils.py index 787950b19..005a3e555 100644 --- a/tripleo_validations/utils.py +++ b/tripleo_validations/utils.py @@ -36,6 +36,7 @@ def get_auth_session(auth_variables): auth_token = auth_variables.get('os_auth_token') password = auth_variables.get('password') cacert = auth_variables.get('cacert') + timeout = auth_variables.get('timeout') if auth_token: auth = ks_id.Token(auth_url=auth_url, @@ -49,7 +50,7 @@ def get_auth_session(auth_variables): project_name=project_name, user_domain_id='default', project_domain_id='default') - return ks_session.Session(auth=auth, verify=cacert) + return ks_session.Session(auth=auth, verify=cacert, timeout=timeout) def get_swift_client(auth_variables):