Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Installing kilo to fedora 21 virtual machine of vmware 10 comes this problem:

[root@localhost common]# openstack service create   --name keystone --description "OpenStack Identity" identity
Traceback (most recent call last):
  File "/usr/bin/openstack", line 6, in <module>
    from openstackclient.shell import main
  File "/usr/lib/python2.7/site-packages/openstackclient/shell.py", line 28, in <module>
    from openstackclient.common import clientmanager
  File "/usr/lib/python2.7/site-packages/openstackclient/common/clientmanager.py", line 25, in <module>
    from openstackclient.api import auth
  File "/usr/lib/python2.7/site-packages/openstackclient/api/auth.py", line 34, in <module>
    base.PLUGIN_NAMESPACE,
AttributeError: 'module' object has no attribute 'PLUGIN_NAMESPACE'

In the file "/usr/lib/python2.7/site-packages/openstackclient/api/auth.py", import part list below:

import argparse
import logging

import stevedore

from keystoneclient.auth import base

from openstackclient.common import exceptions as exc
from openstackclient.common import utils
from openstackclient.i18n import _


LOG = logging.getLogger(__name__)


# Initialize the list of Authentication plugins early in order
# to get the command-line options
PLUGIN_LIST = stevedore.ExtensionManager(
    base.PLUGIN_NAMESPACE,
    invoke_on_load=False,
    propagate_map_exceptions=True,
)

The file "/usr/lib/python2.7/site-packages/keystoneclient/auth/base.py" all list below:

# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
#      http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.

import abc
import six


@six.add_metaclass(abc.ABCMeta)
class BaseAuthPlugin(object):
    """The basic structure of an authentication plugin."""

    @abc.abstractmethod
    def get_token(self, session, **kwargs):
        """Obtain a token.

        How the token is obtained is up to the plugin. If it is still valid
        it may be re-used, retrieved from cache or invoke an authentication
        request against a server.

        There are no required kwargs. They are passed directly to the auth
        plugin and they are implementation specific.

        Returning None will indicate that no token was able to be retrieved.

        :param session: A session object so the plugin can make HTTP calls.
        :return string: A token to use.
        """

    def get_endpoint(self, session, **kwargs):
        """Return an endpoint for the client.

        There are no required keyword arguments to ``get_endpoint`` as a plugin
        implementation should use best effort with the information available to
        determine the endpoint. However there are certain standard options that
        will be generated by the clients and should be used by plugins:

        - ``service_type``: what sort of service is required.
        - ``interface``: what visibility the endpoint should have.
        - ``region_name``: the region the endpoint exists in.

        :param Session session: The session object that the auth_plugin
                                belongs to.

        :returns string: The base URL that will be used to talk to the
                         required service or None if not available.
        """

    def invalidate(self):
        """Invalidate the current authentication data.

        This should result in fetching a new token on next call.

        A plugin may be invalidated if an Unauthorized HTTP response is
        returned to indicate that the token may have been revoked or is
        otherwise now invalid.

        :returns bool: True if there was something that the plugin did to
                       invalidate. This means that it makes sense to try again.
                       If nothing happens returns False to indicate give up.
        """
        return False

This base.py seems to have no attribute "PLUGIN_NAMESPACE".

I have checked already with two fresh installed server.

Maybe this is bug with Kilo release .

Please help me with this issue.

Thank you very much!


yum install openstack-keystone

====================================================================================================================================================================================================
Install  1 Package (+1 Dependent package)

Total download size: 484 k
Installed size: 2.3 M
Is this ok [y/d/N]: y
Downloading packages:
(1/2): openstack-keystone-2014.1.2.1-1.fc21.noarch.rpm                                                                                                                       |  44 kB  00:00:00     
(2/2): python-keystoneclient-0.9.0-2.fc21.noarch.rpm                                                                                                                         | 440 kB  00:00:05     
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Total                                                                                                                                                                87 kB/s | 484 kB  00:00:05     
Running transaction check
Running transaction test
Transaction test succeeded

The keystoneclent version is python-keystoneclient-0.9.0-2.fc21.noarch.rpm above.

In python-keystoneclient-1.5.0/keystoneclient/auth/base.py

# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
#      http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.

import os

import six
import stevedore

from keystoneclient import exceptions


# NOTE(jamielennox): The AUTH_INTERFACE is a special value that can be
# requested from get_endpoint. If a plugin receives this as the value of
# 'interface' it should return the initial URL that was passed to the plugin.
AUTH_INTERFACE = object()

PLUGIN_NAMESPACE = 'keystoneclient.auth.plugin'
IDENTITY_AUTH_HEADER_NAME = 'X-Auth-Token'


def get_available_plugin_names():
    """Get the names of all the plugins that are available on the system.

    This is particularly useful for help and error text to prompt a user for
    example what plugins they may specify.

    :returns: A list of names.
    :rtype: frozenset
    """
    mgr = stevedore.ExtensionManager(namespace=PLUGIN_NAMESPACE,
                                     invoke_on_load=False)
    return frozenset(mgr.names())

There has the attribute PLUGIN_NAMESPACE. This means the yum installing keystoneclient version and opsntackclient version do not match well.

What the fuck!