Merge "db_sync doesn't create default domain"

This commit is contained in:
Jenkins 2016-02-24 21:06:36 +00:00 committed by Gerrit Code Review
commit f699ca93fc
3 changed files with 6 additions and 23 deletions

View File

@ -14,11 +14,9 @@
import migrate
from oslo_log import log
import sqlalchemy as sql
from sqlalchemy import orm
from keystone.assignment.backends import sql as assignment_sql
from keystone.common import sql as ks_sql
from keystone.common.sql import migration_helpers
from keystone.identity.mapping_backends import mapping as mapping_backend
@ -317,8 +315,3 @@ def upgrade(migrate_engine):
migrate.ForeignKeyConstraint(columns=fkey['columns'],
refcolumns=fkey['references'],
name=fkey.get('name')).create()
# Create the default domain.
session = orm.sessionmaker(bind=migrate_engine)()
domain.insert(migration_helpers.get_default_domain()).execute()
session.commit()

View File

@ -300,22 +300,6 @@ class SqlUpgradeTests(SqlMigrateBase):
for table in INITIAL_TABLE_STRUCTURE:
self.assertTableColumns(table, INITIAL_TABLE_STRUCTURE[table])
# Ensure the default domain was properly created.
default_domain = migration_helpers.get_default_domain()
meta = sqlalchemy.MetaData()
meta.bind = self.engine
domain_table = sqlalchemy.Table('domain', meta, autoload=True)
session = self.Session()
q = session.query(domain_table)
refs = q.all()
self.assertEqual(1, len(refs))
for k in default_domain.keys():
self.assertEqual(default_domain[k], getattr(refs[0], k))
def insert_dict(self, session, table_name, d, table=None):
"""Naively inserts key-value pairs into a table, given a dictionary."""
if table is None:

View File

@ -0,0 +1,6 @@
---
other:
- >
``keystone-manage db_sync`` will no longer create the Default domain. This
domain is used as the domain for any users created using the legacy v2.0
API. A default domain is created by ``keystone-manage bootstrap``.