diff options
| author | Cory Stone <corystone@gmail.com> | 2014-02-14 13:42:58 -0600 |
|---|---|---|
| committer | Cory Stone <corystone@gmail.com> | 2014-02-14 15:09:44 -0600 |
| commit | d5334aa929beb4190ae04fddc98e693df142b9bd (patch) | |
| tree | 62b025148cdb867473fa6c994da7087d82c10c00 /cinderclient/utils.py | |
| parent | 6fd8d8e12e7788e7f5b85bc3b8ef2f6ee2eb7714 (diff) | |
| download | python-cinderclient-d5334aa929beb4190ae04fddc98e693df142b9bd.tar.gz | |
Add auth_plugin support to cinderclient
With CINDER_RAX_AUTH being rightfully removed, cinderclient is no longer
compatible with Rackspace/any non-keystone auth. To fix this, I stole
auth_system/auth_plugin from novaclient's implementation.
See https://review.openstack.org/#/c/23820/.
Change-Id: If5f84003f868ef02bb7eb7da67cf62018602e8f0
Closes-Bug: 1280393
Diffstat (limited to 'cinderclient/utils.py')
| -rw-r--r-- | cinderclient/utils.py | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/cinderclient/utils.py b/cinderclient/utils.py index a941873..018f12a 100644 --- a/cinderclient/utils.py +++ b/cinderclient/utils.py @@ -16,6 +16,7 @@ from __future__ import print_function import os +import pkg_resources import re import sys import uuid @@ -286,6 +287,15 @@ def import_class(import_str): __import__(mod_str) return getattr(sys.modules[mod_str], class_str) + +def _load_entry_point(ep_name, name=None): + """Try to load the entry point ep_name that matches name.""" + for ep in pkg_resources.iter_entry_points(ep_name, name=name): + try: + return ep.load() + except (ImportError, pkg_resources.UnknownExtra, AttributeError): + continue + _slugify_strip_re = re.compile(r'[^\w\s-]') _slugify_hyphenate_re = re.compile(r'[-\s]+') |
