summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authortermie <github@anarkystic.com>2012-01-18 21:10:08 -0800
committertermie <github@anarkystic.com>2012-01-18 21:47:18 -0800
commite2f04f224e36c16430d7f7430b05d625ca5145a1 (patch)
tree0e28bfdd2587667817501a2c34e23b64447a28c0
parentff6af1f808bc962c816528174096b5e386c1cb9a (diff)
fix some imports
-rw-r--r--keystone/catalog/core.py6
-rw-r--r--keystone/common/sql/__init__.py2
-rw-r--r--keystone/common/sql/util.py2
-rw-r--r--keystone/common/wsgi.py11
-rw-r--r--keystone/config.py2
-rw-r--r--keystone/contrib/ec2/backends/sql.py4
-rw-r--r--keystone/contrib/ec2/core.py2
-rw-r--r--keystone/identity/core.py18
-rw-r--r--keystone/middleware/internal.py2
-rw-r--r--keystone/policy/__init__.py1
-rw-r--r--keystone/policy/core.py2
-rw-r--r--keystone/test.py6
-rw-r--r--keystone/token/core.py2
-rw-r--r--tests/test_keystoneclient_sql.py4
14 files changed, 32 insertions, 32 deletions
diff --git a/keystone/catalog/core.py b/keystone/catalog/core.py
index 8177f2cf..31e41688 100644
--- a/keystone/catalog/core.py
+++ b/keystone/catalog/core.py
@@ -3,9 +3,6 @@
"""Main entry point into the Catalog service."""
from keystone import config
-from keystone import identity
-from keystone import token
-from keystone import policy
from keystone.common import manager
from keystone.common import wsgi
@@ -31,9 +28,6 @@ class Manager(manager.Manager):
class ServiceController(wsgi.Application):
def __init__(self):
self.catalog_api = Manager()
- self.identity_api = identity.Manager()
- self.token_api = token.Manager()
- self.policy_api = policy.Manager()
super(ServiceController, self).__init__()
# CRUD extensions
diff --git a/keystone/common/sql/__init__.py b/keystone/common/sql/__init__.py
index c52d6cbc..ae31c702 100644
--- a/keystone/common/sql/__init__.py
+++ b/keystone/common/sql/__init__.py
@@ -1 +1 @@
-from keystone.backends.sql.core import *
+from keystone.common.sql.core import *
diff --git a/keystone/common/sql/util.py b/keystone/common/sql/util.py
index e96ac6c6..a181c284 100644
--- a/keystone/common/sql/util.py
+++ b/keystone/common/sql/util.py
@@ -3,7 +3,7 @@
import os
from keystone import config
-from keystone.backends.sql import migration
+from keystone.common.sql import migration
CONF = config.CONF
diff --git a/keystone/common/wsgi.py b/keystone/common/wsgi.py
index b7b244fa..fafa9694 100644
--- a/keystone/common/wsgi.py
+++ b/keystone/common/wsgi.py
@@ -19,6 +19,7 @@
"""Utility methods for working with WSGI servers."""
+import json
import logging
import sys
@@ -31,6 +32,8 @@ import webob
import webob.dec
import webob.exc
+from keystone.common import utils
+
class WritableLogger(object):
"""A thin wrapper that responds to `write` and logs."""
@@ -146,7 +149,7 @@ class BaseApplication(object):
raise NotImplementedError('You must implement __call__')
-class Application(wsgi.BaseApplication):
+class Application(BaseApplication):
@webob.dec.wsgify
def __call__(self, req):
arg_dict = req.environ['wsgiorg.routing_args'][1]
@@ -375,7 +378,7 @@ class ComposingRouter(Router):
super(ComposingRouter, self).__init__(mapper)
-class ComposableRouter(object):
+class ComposableRouter(Router):
"""Router that supports use by ComposingRouter."""
def __init__(self, mapper=None):
@@ -394,7 +397,9 @@ class ExtensionRouter(Router):
Expects to be subclassed.
"""
- def __init__(self, application, mapper):
+ def __init__(self, application, mapper=None):
+ if mapper is None:
+ mapper = routes.Mapper()
self.application = application
self.add_routes(mapper)
mapper.connect('{path_info:.*}', controller=self.application)
diff --git a/keystone/config.py b/keystone/config.py
index f3064dc7..a89c6e90 100644
--- a/keystone/config.py
+++ b/keystone/config.py
@@ -5,7 +5,7 @@ import logging
import sys
import os
-from keystone import cfg
+from keystone.common import cfg
gettext.install('keystone', unicode=1)
diff --git a/keystone/contrib/ec2/backends/sql.py b/keystone/contrib/ec2/backends/sql.py
index 3f786a6a..a0464ba8 100644
--- a/keystone/contrib/ec2/backends/sql.py
+++ b/keystone/contrib/ec2/backends/sql.py
@@ -20,10 +20,6 @@ class Ec2Credential(sql.ModelBase, sql.DictBase):
class Ec2(sql.Base):
- # Internal interface to manage the database
- def db_sync(self):
- migration.db_sync()
-
def get_credential(self, credential_id):
session = self.get_session()
credential_ref = session.query(Ec2Credential)\
diff --git a/keystone/contrib/ec2/core.py b/keystone/contrib/ec2/core.py
index 1c83689c..e12c9efc 100644
--- a/keystone/contrib/ec2/core.py
+++ b/keystone/contrib/ec2/core.py
@@ -30,7 +30,7 @@ class Manager(manager.Manager):
class Ec2Extension(wsgi.ExtensionRouter):
- def add_routes(self, mapper)
+ def add_routes(self, mapper):
ec2_controller = Ec2Controller()
# validation
mapper.connect('/ec2tokens',
diff --git a/keystone/identity/core.py b/keystone/identity/core.py
index 4400d7f6..3d46b66d 100644
--- a/keystone/identity/core.py
+++ b/keystone/identity/core.py
@@ -2,8 +2,12 @@
"""Main entry point into the Identity service."""
+from keystone import catalog
from keystone import config
-from keystone import manager
+from keystone import policy
+from keystone import token
+from keystone.common import manager
+from keystone.common import wsgi
CONF = config.CONF
@@ -65,9 +69,9 @@ class AdminRouter(wsgi.ComposableRouter):
conditions=dict(method=['GET']))
-class TenantController(Application):
+class TenantController(wsgi.Application):
def __init__(self):
- self.identity_api = identity.Manager()
+ self.identity_api = Manager()
self.policy_api = policy.Manager()
self.token_api = token.Manager()
super(TenantController, self).__init__()
@@ -148,10 +152,10 @@ class TenantController(Application):
return o
-class UserController(Application):
+class UserController(wsgi.Application):
def __init__(self):
self.catalog_api = catalog.Manager()
- self.identity_api = identity.Manager()
+ self.identity_api = Manager()
self.policy_api = policy.Manager()
self.token_api = token.Manager()
super(UserController, self).__init__()
@@ -211,10 +215,10 @@ class UserController(Application):
return self.update_user(context, user_id, user)
-class RoleController(Application):
+class RoleController(wsgi.Application):
def __init__(self):
self.catalog_api = catalog.Manager()
- self.identity_api = identity.Manager()
+ self.identity_api = Manager()
self.token_api = token.Manager()
self.policy_api = policy.Manager()
super(RoleController, self).__init__()
diff --git a/keystone/middleware/internal.py b/keystone/middleware/internal.py
index ccf68b82..389c9bf0 100644
--- a/keystone/middleware/internal.py
+++ b/keystone/middleware/internal.py
@@ -3,7 +3,7 @@
import json
from keystone import config
-from keystone import wsgi
+from keystone.common import wsgi
CONF = config.CONF
diff --git a/keystone/policy/__init__.py b/keystone/policy/__init__.py
index e69de29b..d16de59f 100644
--- a/keystone/policy/__init__.py
+++ b/keystone/policy/__init__.py
@@ -0,0 +1 @@
+from keystone.policy.core import *
diff --git a/keystone/policy/core.py b/keystone/policy/core.py
index 4aa24df7..87ad743c 100644
--- a/keystone/policy/core.py
+++ b/keystone/policy/core.py
@@ -3,7 +3,7 @@
"""Main entry point into the Policy service."""
from keystone import config
-from keystone import manager
+from keystone.common import manager
CONF = config.CONF
diff --git a/keystone/test.py b/keystone/test.py
index b3473b54..04502f80 100644
--- a/keystone/test.py
+++ b/keystone/test.py
@@ -11,10 +11,10 @@ from paste import deploy
from keystone import catalog
from keystone import config
from keystone import identity
-from keystone import logging
from keystone import token
-from keystone import utils
-from keystone import wsgi
+from keystone.common import logging
+from keystone.common import utils
+from keystone.common import wsgi
ROOTDIR = os.path.dirname(os.path.dirname(__file__))
diff --git a/keystone/token/core.py b/keystone/token/core.py
index d3e9a5f0..c48ca0be 100644
--- a/keystone/token/core.py
+++ b/keystone/token/core.py
@@ -3,7 +3,7 @@
"""Main entry point into the Token service."""
from keystone import config
-from keystone import manager
+from keystone.common import manager
CONF = config.CONF
diff --git a/tests/test_keystoneclient_sql.py b/tests/test_keystoneclient_sql.py
index 2adcc745..ce8ce011 100644
--- a/tests/test_keystoneclient_sql.py
+++ b/tests/test_keystoneclient_sql.py
@@ -1,8 +1,8 @@
# vim: tabstop=4 shiftwidth=4 softtabstop=4
from keystone import config
from keystone import test
-from keystone.backends.sql import util as sql_util
-from keystone.backends.sql import migration
+from keystone.common.sql import util as sql_util
+from keystone.common.sql import migration
import test_keystoneclient