

def client_request(self, client, method, url, **kwargs):
    "Send an http request using `client`'s endpoint and specified `url`.\n\n        If request was rejected as unauthorized (possibly because the token is\n        expired), issue one authorization attempt and send the request once\n        again.\n\n        :param client: instance of BaseClient descendant\n        :param method: method of HTTP request\n        :param url: URL of HTTP request\n        :param kwargs: any other parameter that can be passed to\n            `HTTPClient.request`\n        "
    filter_args = {
        'endpoint_type': (client.endpoint_type or self.endpoint_type),
        'service_type': client.service_type,
    }
    (token, endpoint) = (self.cached_token, client.cached_endpoint)
    just_authenticated = False
    if (not (token and endpoint)):
        try:
            (token, endpoint) = self.auth_plugin.token_and_endpoint(**filter_args)
        except exceptions.EndpointException:
            pass
        if (not (token and endpoint)):
            self.authenticate()
            just_authenticated = True
            (token, endpoint) = self.auth_plugin.token_and_endpoint(**filter_args)
            if (not (token and endpoint)):
                raise exceptions.AuthorizationFailure(_('Cannot find endpoint or token for request'))
    old_token_endpoint = (token, endpoint)
    kwargs.setdefault('headers', {
        
    })['X-Auth-Token'] = token
    self.cached_token = token
    client.cached_endpoint = endpoint
    try:
        return self.request(method, self.concat_url(endpoint, url), **kwargs)
    except exceptions.Unauthorized as unauth_ex:
        if just_authenticated:
            raise
        self.cached_token = None
        client.cached_endpoint = None
        if url.auth_plugin.opts.get('token'):
            self.auth_plugin.opts['token'] = None
        if self.auth_plugin.opts.get('endpoint'):
            self.auth_plugin.opts['endpoint'] = None
        self.authenticate()
        try:
            (token, endpoint) = self.auth_plugin.token_and_endpoint(**filter_args)
        except exceptions.EndpointException:
            raise unauth_ex
        if ((not (token and endpoint)) or (old_token_endpoint == (token, endpoint))):
            raise unauth_ex
        self.cached_token = token
        client.cached_endpoint = endpoint
        kwargs['headers']['X-Auth-Token'] = token
        return self.request(method, self.concat_url(endpoint, url), **kwargs)

dataset/ETHPy150Open openstack-infra/python-storyboardclient/storyboardclient/openstack/common/apiclient/client.py HTTPClient.client_request/VarMisuse@266/513 `self`->`url`