summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormdietz <mdietz@openstack>2010-09-23 18:29:17 +0000
committermdietz <mdietz@openstack>2010-09-23 18:29:17 +0000
commit020f1a304c15db3086169efe67994ca59ca04e0c (patch)
tree1dcdf81f564eca5360362453e4c3ac346a538682
parent94b9d491d4f691f7ede3c0d5d8ca98288af1646f (diff)
Added a primary_key to AuthToken, fixed some unbound variables, and now all unit tests pass
-rw-r--r--nova/api/rackspace/auth.py5
-rw-r--r--nova/db/sqlalchemy/models.py2
2 files changed, 5 insertions, 2 deletions
diff --git a/nova/api/rackspace/auth.py b/nova/api/rackspace/auth.py
index 1ef90c324..ce5a967eb 100644
--- a/nova/api/rackspace/auth.py
+++ b/nova/api/rackspace/auth.py
@@ -8,6 +8,9 @@ from nova import flags
from nova import auth
from nova import manager
from nova import db
+from nova import utils
+
+FLAGS = flags.FLAGS
class Context(object):
pass
@@ -15,7 +18,7 @@ class Context(object):
class BasicApiAuthManager(object):
""" Implements a somewhat rudimentary version of Rackspace Auth"""
- def __init__(self):
+ def __init__(self, host=None, db_driver=None):
if not host:
host = FLAGS.host
self.host = host
diff --git a/nova/db/sqlalchemy/models.py b/nova/db/sqlalchemy/models.py
index 6e1c0ce16..161c5f1bc 100644
--- a/nova/db/sqlalchemy/models.py
+++ b/nova/db/sqlalchemy/models.py
@@ -401,7 +401,7 @@ class AuthToken(BASE, NovaBase):
are a string representing the actual token and a user id for mapping
to the actual user"""
__tablename__ = 'auth_tokens'
- token_hash = Column(String(255))
+ token_hash = Column(String(255), primary_key=True)
user_id = Column(Integer)
server_manageent_url = Column(String(255))
storage_url = Column(String(255))