Merge "User-friendly error message for DiscoveryFailure"

Zuul 2022-05-06 17:07:04 +00:00 committed by Gerrit Code Review
commit 97477c3261
1 changed files with 6 additions and 3 deletions

View File

@ -1216,7 +1216,8 @@ class EndpointData(object):
except (exceptions.DiscoveryFailure,
exceptions.ConnectionError) as exc:
_LOGGER.debug('No version document at %s: %s', vers_url, exc)
if not self._disc:
# We couldn't find a version discovery document anywhere.
@ -1247,8 +1248,10 @@ class EndpointData(object):
# date enough to properly specify a version and keystoneauth
# can't deliver.
raise exceptions.DiscoveryFailure(
"Version requested but version discovery document was not"
" found and allow_version_hack was False")
"Unable to find a version discovery document at %s, "
"the service is unavailable or misconfigured. "
"Required version range (%s - %s), version hack disabled."
% (self.url, min_version or "any", max_version or "any"))
def _get_discovery_url_choices(
self, project_id=None, allow_version_hack=True,