Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def fix_auth_url_version(auth_url):
- """Fix up the auth url if an invalid version prefix was given.
- People still give a v2 auth_url even when they specify that they want v3
- authentication. Fix the URL to say v3. This should be smarter and take the
- base, unversioned URL and discovery.
- """
- if get_keystone_version() >= 3:
- if has_in_url_path(auth_url, "/v2.0"):
- LOG.warning("The settings.py file points to a v2.0 keystone "
- "endpoint, but v3 is specified as the API version "
- "to use. Using v3 endpoint for authentication.")
- auth_url = url_path_replace(auth_url, "/v2.0", "/v3", 1)
- elif urlparse.urlsplit(auth_url).path.strip('/') == '':
- auth_url = urlparse.urljoin(auth_url, "/v3")
- return auth_url
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement