From 5aa1d57c99b8202f57df453b8049a93de4d432cb Mon Sep 17 00:00:00 2001 From: John Eo Date: Fri, 22 Apr 2011 10:54:52 -0500 Subject: More pep-8 cleanup --- setup.py | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/setup.py b/setup.py index 143f6223..f4fd1bc3 100644 --- a/setup.py +++ b/setup.py @@ -19,20 +19,20 @@ from setuptools import setup, find_packages version = '1.0' setup( - name = 'keystone', - version = version, - description = "", - license = 'Apache License (2.0)', - classifiers = ["Programming Language :: Python", ], - keywords = '', - author = 'OpenStack, LLC.', - author_email = 'openstack@lists.launchpad.net', - url = 'http://www.openstack.org', - include_package_data = True, - packages = find_packages(exclude=['test', 'bin']), - zip_safe = False, - install_requires = ['setuptools', ], - entry_points = { + name='keystone', + version=version, + description='', + license='Apache License (2.0)', + classifiers=["Programming Language :: Python", ], + keywords='', + author='OpenStack, LLC.', + author_email='openstack@lists.launchpad.net', + url='http://www.openstack.org', + include_package_data=True, + packages=find_packages(exclude=['test', 'bin']), + zip_safe=False, + install_requires=['setuptools', ], + entry_points={ 'paste.app_factory': ['main=identity:app_factory'], 'paste.filter_factory': [ 'papiauth=keystone.middleware.papiauth:filter_factory', -- cgit From 7116b9250b431b8f3d31001da26f115cf3c99f04 Mon Sep 17 00:00:00 2001 From: John Eo Date: Fri, 22 Apr 2011 11:33:29 -0500 Subject: pep-8 cleanup of model --- keystone/db/sqlalchemy/models.py | 69 ++++++++++++++++++++-------------------- 1 file changed, 34 insertions(+), 35 deletions(-) diff --git a/keystone/db/sqlalchemy/models.py b/keystone/db/sqlalchemy/models.py index 75b6499c..f8050377 100644 --- a/keystone/db/sqlalchemy/models.py +++ b/keystone/db/sqlalchemy/models.py @@ -25,6 +25,7 @@ from session import get_session Base = declarative_base() + class KeystoneBase(object): """Base class for Keystone Models.""" @@ -36,7 +37,7 @@ class KeystoneBase(object): try: session.flush() except IntegrityError: - raise + raise def delete(self, session=None): """Delete this object.""" @@ -76,61 +77,59 @@ class KeystoneBase(object): class UserTenantAssociation(Base, KeystoneBase): - __tablename__ = 'user_tenant_association' + __tablename__ = 'user_tenant_association' - user_id = Column(String(255), ForeignKey('users.id'), primary_key=True) - tenant_id = Column(String(255), ForeignKey('tenants.id'), primary_key=True) + user_id = Column(String(255), ForeignKey('users.id'), primary_key=True) + tenant_id = Column(String(255), ForeignKey('tenants.id'), primary_key=True) class UserGroupAssociation(Base, KeystoneBase): - __tablename__ = 'user_group_association' + __tablename__ = 'user_group_association' - user_id = Column(String(255), ForeignKey('users.id'), primary_key=True) - group_id = Column(String(255), ForeignKey('groups.id'), primary_key=True) + user_id = Column(String(255), ForeignKey('users.id'), primary_key=True) + group_id = Column(String(255), ForeignKey('groups.id'), primary_key=True) class User(Base, KeystoneBase): - __tablename__ = 'users' + __tablename__ = 'users' - id = Column(String(255), primary_key=True, unique=True) - password = Column(String(255)) - email = Column(String(255)) - enabled = Column(Integer) - groups = relationship(UserGroupAssociation, backref='users') - tenants = relationship(UserTenantAssociation, backref='user') + id = Column(String(255), primary_key=True, unique=True) + password = Column(String(255)) + email = Column(String(255)) + enabled = Column(Integer) + groups = relationship(UserGroupAssociation, backref='users') + tenants = relationship(UserTenantAssociation, backref='user') class Tenant(Base, KeystoneBase): - __tablename__ = 'tenants' + __tablename__ = 'tenants' - id = Column(String(255), primary_key=True, unique=True) - desc = Column(String(255)) - enabled = Column(Integer) - groups = relationship('Group', backref='tenants') + id = Column(String(255), primary_key=True, unique=True) + desc = Column(String(255)) + enabled = Column(Integer) + groups = relationship('Group', backref='tenants') class Group(Base, KeystoneBase): - __tablename__ = 'groups' + __tablename__ = 'groups' - id = Column(String(255), primary_key=True, unique=True) - desc = Column(String(255)) - tenant_id = Column(String(255), ForeignKey('tenants.id')) + id = Column(String(255), primary_key=True, unique=True) + desc = Column(String(255)) + tenant_id = Column(String(255), ForeignKey('tenants.id')) class Token(Base, KeystoneBase): - __tablename__ = 'token' + __tablename__ = 'token' - token_id = Column(String(255), primary_key=True, unique=True) - user_id = Column(String(255)) - tenant_id = Column(String(255)) - expires = Column(DateTime) + token_id = Column(String(255), primary_key=True, unique=True) + user_id = Column(String(255)) + tenant_id = Column(String(255)) + expires = Column(DateTime) def register_models(session, engine): - models = (User, Tenant, Group, Token, UserGroupAssociation, - UserTenantAssociation) - for model in models: - model.metadata.create_all(engine) - session.flush() - - + models = (User, Tenant, Group, Token, UserGroupAssociation, + UserTenantAssociation) + for model in models: + model.metadata.create_all(engine) + session.flush() -- cgit