Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

I was able to dig this up a bit more. After what I've found, I feel I'm probably doing something terribly wrong...

I've traced the error to the file keystoneauth1/session.py (take a look at it here: ), function get_endpoint():

def get_endpoint(self, auth=None, **kwargs):
    """Get an endpoint as provided by the auth plugin.

    :param auth: The auth plugin to use for token. Overrides the plugin on
                 the session. (optional)
    :type auth: keystoneauth1.plugin.BaseAuthPlugin

    :raises keystoneauth1.exceptions.auth_plugins.MissingAuthPlugin:
        if a plugin is not available.

    :returns: An endpoint if available or None.
    :rtype: string
    """
    auth = self._auth_required(auth, 'determine endpoint URL')          
    return auth.get_endpoint(self, **kwargs)

The above returns None every time. Since I'm able to get the actual endpoint URLs using curl, I coded a workaround in session.py, just to see things working. The workaround consists in setting the base_url variable to the respective URL, based on the service_type (e.g. 'identity' => 'http://192.168.8.99:35357/v2.0'):

    if not urllib.parse.urlparse(url).netloc:

        base_url = None

        if endpoint_override:
            base_url = endpoint_override % _StringFormatter(self, auth)
        elif endpoint_filter:
            base_url = self.get_endpoint(auth, allow=allow,
                                         **endpoint_filter)

            # UGLY FIX START
            if base_url is None:
                if endpoint_filter['service_type'] == 'identity':
                    if "/tenants" in url:
                        base_url = "http://192.168.8.99:35357/v2.0"
                    else:
                        base_url = "http://192.168.8.99:35357/v3"
            # UGLY FIX END

        if not base_url:
            raise exceptions.EndpointNotFound()

        url = '%s/%s' % (base_url.rstrip('/'), url.lstrip('/'))

So - considering the rally task - the process continues till the creation of new tenants (aka 'projects' with v3). But it stops when rally requests a token for newly created users, e.g.:

curl http://192.168.8.99:35357/v2.0/tokens -X POST -d '{"auth":{"tenantName":"test_project", "passwordCredentials":{"username":"test_user", "password":"hello"}}}' -H "Content-type: application/json"

I made sure the parameters are correct.

I was able to dig this up a bit more. After what I've found, I feel I'm probably doing something terribly wrong...

I've traced the error to the file keystoneauth1/session.py (take a look at it here: ), function get_endpoint():

def get_endpoint(self, auth=None, **kwargs):
    """Get an endpoint as provided by the auth plugin.

    :param auth: The auth plugin to use for token. Overrides the plugin on
                 the session. (optional)
    :type auth: keystoneauth1.plugin.BaseAuthPlugin

    :raises keystoneauth1.exceptions.auth_plugins.MissingAuthPlugin:
        if a plugin is not available.

    :returns: An endpoint if available or None.
    :rtype: string
    """
    auth = self._auth_required(auth, 'determine endpoint URL')          
    return auth.get_endpoint(self, **kwargs)

The above returns None every time. Since I'm able to get the actual endpoint URLs using curl, I coded a workaround in session.py, just to see things working. The workaround consists in setting the base_url variable to the respective URL, based on the service_type (e.g. 'identity' => 'http://192.168.8.99:35357/v2.0'):

    if not urllib.parse.urlparse(url).netloc:

        base_url = None

        if endpoint_override:
            base_url = endpoint_override % _StringFormatter(self, auth)
        elif endpoint_filter:
            base_url = self.get_endpoint(auth, allow=allow,
                                         **endpoint_filter)

            # UGLY FIX START
            if base_url is None:
                if endpoint_filter['service_type'] == 'identity':
                    if "/tenants" in url:
                        base_url = "http://192.168.8.99:35357/v2.0"
                    else:
                        base_url = "http://192.168.8.99:35357/v3"
            # UGLY FIX END

        if not base_url:
            raise exceptions.EndpointNotFound()

        url = '%s/%s' % (base_url.rstrip('/'), url.lstrip('/'))

So - considering the rally task - the process continues till the creation of new users and tenants (aka 'projects' with v3). But it stops when rally requests a token for newly created users, e.g.:

curl http://192.168.8.99:35357/v2.0/tokens -X POST -d '{"auth":{"tenantName":"test_project", "passwordCredentials":{"username":"test_user", "password":"hello"}}}' -H "Content-type: application/json"

I made sure the parameters are correct.

I was able to dig this up a bit more. After what I've found, I feel I'm probably doing something terribly wrong...wrong... By this I mean that the problem should be solvable by installing the correct versions of clients and Openstack services. I suspect I'm not doing it.

I've traced the error to the file keystoneauth1/session.py (take a look at it here: ), function get_endpoint():

def get_endpoint(self, auth=None, **kwargs):
    """Get an endpoint as provided by the auth plugin.

    :param auth: The auth plugin to use for token. Overrides the plugin on
                 the session. (optional)
    :type auth: keystoneauth1.plugin.BaseAuthPlugin

    :raises keystoneauth1.exceptions.auth_plugins.MissingAuthPlugin:
        if a plugin is not available.

    :returns: An endpoint if available or None.
    :rtype: string
    """
    auth = self._auth_required(auth, 'determine endpoint URL')          
    return auth.get_endpoint(self, **kwargs)

The above returns None every time. Since I'm able to get the actual endpoint URLs using curl, I coded a workaround in session.py, just to see things working. The workaround consists in setting the base_url variable to the respective URL, based on the service_type (e.g. 'identity' => 'http://192.168.8.99:35357/v2.0'):

    if not urllib.parse.urlparse(url).netloc:

        base_url = None

        if endpoint_override:
            base_url = endpoint_override % _StringFormatter(self, auth)
        elif endpoint_filter:
            base_url = self.get_endpoint(auth, allow=allow,
                                         **endpoint_filter)

            # UGLY FIX START
            if base_url is None:
                if endpoint_filter['service_type'] == 'identity':
                    if "/tenants" in url:
                        base_url = "http://192.168.8.99:35357/v2.0"
                    else:
                        base_url = "http://192.168.8.99:35357/v3"
            # UGLY FIX END

        if not base_url:
            raise exceptions.EndpointNotFound()

        url = '%s/%s' % (base_url.rstrip('/'), url.lstrip('/'))

So - considering the rally task - the process continues till the creation of new users and tenants (aka 'projects' with v3). But it stops when rally requests a token for newly created users, e.g.:

curl http://192.168.8.99:35357/v2.0/tokens -X POST -d '{"auth":{"tenantName":"test_project", "passwordCredentials":{"username":"test_user", "password":"hello"}}}' -H "Content-type: application/json"

I made sure the parameters are correct.