db_sync doesn't create default domain
The reason db_sync needed to create the default domain is because we needed a domain for existing v2 users. Since the migrations don't add the domain_id to users anymore there's no need to create the default domain. DocImpact -- The install guide should be updated to say to use keystone-manage bootstrap or to create the default domain if the deployment is going to support v2. Change-Id: I65860fe989ac2456b73bcc12fd02643564b24574
This commit is contained in:
parent
66fef6491e
commit
a7b7fea7a3
@ -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()
|
||||
|
@ -281,22 +281,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:
|
||||
|
@ -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``.
|
Loading…
Reference in New Issue
Block a user