Disable keystone client if running under Py3K

Since keystoneclient is not Py3K compliant, it should be disabled when
running under python >= 2.7

Partially-implements: py3k-support
Change-Id: I9016748b3fc65f1437cb0d561b738ede704f642f
This commit is contained in:
Flavio Percoco
2013-12-05 01:20:02 +01:00
parent eef012d4c4
commit 304f94cbe5
2 changed files with 12 additions and 3 deletions

View File

@@ -15,7 +15,10 @@
"""Middleware for handling authorization and authentication."""
from keystoneclient.middleware import auth_token
import six
if not six.PY3:
from keystoneclient.middleware import auth_token
from marconi.openstack.common.gettextutils import _
from marconi.openstack.common import log
@@ -47,7 +50,8 @@ class KeystoneAuth(object):
return auth_token.AuthProtocol(app, conf=conf)
STRATEGIES['keystone'] = KeystoneAuth
if not six.PY3:
STRATEGIES['keystone'] = KeystoneAuth
def strategy(strategy):

View File

@@ -18,11 +18,16 @@ import uuid
import falcon
from falcon import testing
from keystoneclient.middleware import auth_token
import six
import testtools
if not six.PY3:
from keystoneclient.middleware import auth_token
import base # noqa
@testtools.skipIf(six.PY3, "No Py3K support for keystoneclient")
class TestWSGIAuth(base.TestBase):
config_file = 'keystone_auth.conf'