Clean up the auth url to extract the exact Keystone URL

def clean_up_auth_url(auth_url):
    """Clean up the auth url to extract the exact Keystone URL"""

    # NOTE(mnaser): This drops the query and fragment because we're only
    #               trying to extract the Keystone URL.
    scheme, netloc, path, query, fragment = urlparse.urlsplit(auth_url)
    return urlparse.urlunsplit((
        scheme, netloc, re.sub(r'/auth.*', '', path), '', ''))