Invalid token provider

Bug #1402187 reported by Dave Chen
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Identity (keystone)
Won't Fix
Wishlist
Dave Chen

Bug Description

When specify token provoider as "pkiz" instead of full class path of token provider as "keystone.token.providers.[pkiz|pki|uuid].Provider" in keystone.conf I will get the following exception thrown in the log file.

2014-12-14 04:48:18.710721 Traceback (most recent call last):
2014-12-14 04:48:18.710732 File "/var/www/keystone/main", line 53, in <module>
2014-12-14 04:48:18.710798 drivers = backends.load_backends()
2014-12-14 04:48:18.710817 File "/opt/stack/keystone/keystone/backends.py", line 48, in load_backends
2014-12-14 04:48:18.710851 token_provider_api=token.provider.Manager())
2014-12-14 04:48:18.710867 File "/opt/stack/keystone/keystone/common/dependency.py", line 200, in wrapper
2014-12-14 04:48:18.710944 self.__wrapped_init__(*args, **kwargs)
2014-12-14 04:48:18.710950 File "/opt/stack/keystone/keystone/common/dependency.py", line 110, in __wrapped_init__
2014-12-14 04:48:18.710969 init(self, *args, **kwargs)
2014-12-14 04:48:18.710974 File "/opt/stack/keystone/keystone/token/provider.py", line 152, in __init__
2014-12-14 04:48:18.711100 super(Manager, self).__init__(self.get_token_provider())
2014-12-14 04:48:18.711106 File "/opt/stack/keystone/keystone/common/manager.py", line 70, in __init__
2014-12-14 04:48:18.711150 self.driver = importutils.import_object(driver_name)
2014-12-14 04:48:18.711165 File "/usr/local/lib/python2.7/dist-packages/oslo/utils/importutils.py", line 38, in import_object
2014-12-14 04:48:18.711226 return import_class(import_str)(*args, **kwargs)
2014-12-14 04:48:18.711244 File "/usr/local/lib/python2.7/dist-packages/oslo/utils/importutils.py", line 27, in import_class
2014-12-14 04:48:18.711252 __import__(mod_str)
2014-12-14 04:48:18.711264 ValueError: Empty module name

I understand the comment in "keystone.conf" has show us how to config the provider but in my opinion, it should also support "pkiz|pki|uuid" besides the full class path, or at least, there should be one dedicated exception to show us what's wrong with the config. Seen from the code there is no invalid provider checking, so invalid token provider exception to show us what's wrong with the config is desired.

Dave Chen (wei-d-chen)
Changed in keystone:
assignee: nobody → Dave Chen (wei-d-chen)
description: updated
Dave Chen (wei-d-chen)
description: updated
Revision history for this message
Morgan Fainberg (mdrnstm) wrote :

This is a problem that we've had with *all* of our drivers loading. This is not exclusive to the token provider. The dedicated exception is a good idea, we should move away from the full-class path and move to stevedore longer term.

tags: added: user-experience
Changed in keystone:
status: New → Triaged
importance: Undecided → Wishlist
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to keystone (master)

Fix proposed to branch: master
Review: https://review.openstack.org/143990

Changed in keystone:
status: Triaged → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Change abandoned on keystone (master)

Change abandoned by Dave Chen (<email address hidden>) on branch: master
Review: https://review.openstack.org/143990
Reason: stevedore

Revision history for this message
Dave Chen (wei-d-chen) wrote :

stevedore is landing

Changed in keystone:
status: In Progress → Won't Fix
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.