Skip to content

Commit

Permalink
Catch ConnectFailure
Browse files Browse the repository at this point in the history
  • Loading branch information
Liam Young committed Oct 25, 2023
1 parent 8f9eff8 commit d98638f
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions zaza/openstack/charm_tests/keystone/tests_ldap_k8s.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -118,7 +119,8 @@ def _find_keystone_v3_group(self, group, domain):
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),
Expand All @@ -132,7 +134,8 @@ def _find_keystone_v3_user(self, username, domain, group=None):
username,
domain,
group=group)
except (AttributeError, http_NotFound, ConnectionError):
except (AttributeError, http_NotFound, ConnectionError,
ConnectFailure):
raise KeystoneLookupError


Expand Down

0 comments on commit d98638f

Please sign in to comment.