"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "keystone/common/sql/contract_repo/versions/037_contract_remove_service_and_region_fk_for_registered_limit.py" between
keystone-16.0.1.tar.gz and keystone-17.0.0.tar.gz

About: OpenStack Keystone (Core Service: Identity) provides an authentication and authorization service for other OpenStack services. Provides a catalog of endpoints for all OpenStack services.
The "Ussuri" series (latest release).

037_contract_remove_service_and_region_fk_for_registered_limit.py  (keystone-16.0.1):037_contract_remove_service_and_region_fk_for_registered_limit.py  (keystone-17.0.0)
skipping to change at line 24 skipping to change at line 24
import sqlalchemy as sql import sqlalchemy as sql
def upgrade(migrate_engine): def upgrade(migrate_engine):
meta = sql.MetaData() meta = sql.MetaData()
meta.bind = migrate_engine meta.bind = migrate_engine
registered_limit_table = sql.Table('registered_limit', meta, autoload=True) registered_limit_table = sql.Table('registered_limit', meta, autoload=True)
service_table = sql.Table('service', meta, autoload=True) service_table = sql.Table('service', meta, autoload=True)
region_table = sql.Table('region', meta, autoload=True) region_table = sql.Table('region', meta, autoload=True)
inspector = sql.engine.reflection.Inspector.from_engine(migrate_engine) inspector = sql.inspect(migrate_engine)
for fk in inspector.get_foreign_keys('registered_limit'): for fk in inspector.get_foreign_keys('registered_limit'):
if fk['referred_table'] == 'service': if fk['referred_table'] == 'service':
fkey = ForeignKeyConstraint([registered_limit_table.c.service_id], fkey = ForeignKeyConstraint([registered_limit_table.c.service_id],
[service_table.c.id], [service_table.c.id],
name=fk['name']) name=fk['name'])
fkey.drop() fkey.drop()
else: else:
fkey = ForeignKeyConstraint([registered_limit_table.c.region_id], fkey = ForeignKeyConstraint([registered_limit_table.c.region_id],
[region_table.c.id], [region_table.c.id],
name=fk['name']) name=fk['name'])
 End of changes. 1 change blocks. 
1 lines changed or deleted 1 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)