From d98638fa4bca564f8ada84f45356e8c21c14dd6b Mon Sep 17 00:00:00 2001 From: Liam Young Date: Wed, 25 Oct 2023 12:24:55 +0000 Subject: [PATCH] Catch ConnectFailure --- zaza/openstack/charm_tests/keystone/tests_ldap_k8s.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/zaza/openstack/charm_tests/keystone/tests_ldap_k8s.py b/zaza/openstack/charm_tests/keystone/tests_ldap_k8s.py index b3abff4..2183d98 100644 --- a/zaza/openstack/charm_tests/keystone/tests_ldap_k8s.py +++ b/zaza/openstack/charm_tests/keystone/tests_ldap_k8s.py @@ -16,6 +16,7 @@ import json import tenacity import contextlib +from keystoneauth1.exceptions.connection import ConnectFailure from keystoneauth1.exceptions.http import NotFound as http_NotFound import logging from requests.exceptions import ConnectionError @@ -118,7 +119,8 @@ class LdapExplicitCharmConfigTestsK8S(ks_tests.LdapExplicitCharmConfigTests): logging.info('Looking for group: {}'.format(group)) try: return super()._find_keystone_v3_group(group, domain) - except (AttributeError, http_NotFound, ConnectionError): + except (AttributeError, http_NotFound, ConnectionError, + ConnectFailure): raise KeystoneLookupError @tenacity.retry(wait=tenacity.wait_exponential(multiplier=2, max=60), @@ -132,7 +134,8 @@ class LdapExplicitCharmConfigTestsK8S(ks_tests.LdapExplicitCharmConfigTests): username, domain, group=group) - except (AttributeError, http_NotFound, ConnectionError): + except (AttributeError, http_NotFound, ConnectionError, + ConnectFailure): raise KeystoneLookupError