Remove migration_helpers.get_default_domain
Since a default domain isn't created during migration, get_default_domain() shouldn't be a migration helper. Closes-Bug: 1547214 Change-Id: I0e0cfd3ad9d7c6ab91e693a6122bf43abfcd6321
This commit is contained in:
parent
a7b7fea7a3
commit
08f8db34ca
|
@ -127,7 +127,13 @@ class BootStrap(BaseApp):
|
|||
raise ValueError
|
||||
|
||||
# NOTE(morganfainberg): Ensure the default domain is in-fact created
|
||||
default_domain = migration_helpers.get_default_domain()
|
||||
default_domain = {
|
||||
'id': CONF.identity.default_domain_id,
|
||||
'name': 'Default',
|
||||
'enabled': True,
|
||||
'description': 'Owns users and tenants (i.e. projects) available '
|
||||
'on Identity API v2.'
|
||||
}
|
||||
try:
|
||||
self.resource_manager.create_domain(
|
||||
domain_id=default_domain['id'],
|
||||
|
|
|
@ -21,7 +21,6 @@ import migrate
|
|||
from migrate import exceptions
|
||||
from oslo_config import cfg
|
||||
from oslo_db.sqlalchemy import migration
|
||||
from oslo_serialization import jsonutils
|
||||
from oslo_utils import importutils
|
||||
import six
|
||||
import sqlalchemy
|
||||
|
@ -44,18 +43,6 @@ MIGRATED_EXTENSIONS = ['endpoint_policy',
|
|||
]
|
||||
|
||||
|
||||
def get_default_domain():
|
||||
# Return the reference used for the default domain structure during
|
||||
# sql migrations.
|
||||
return {
|
||||
'id': CONF.identity.default_domain_id,
|
||||
'name': 'Default',
|
||||
'enabled': True,
|
||||
'extra': jsonutils.dumps({'description': 'Owns users and tenants '
|
||||
'(i.e. projects) available '
|
||||
'on Identity API v2.'})}
|
||||
|
||||
|
||||
# Different RDBMSs use different schemes for naming the Foreign Key
|
||||
# Constraints. SQLAlchemy does not yet attempt to determine the name
|
||||
# for the constraint, and instead attempts to deduce it from the column.
|
||||
|
|
|
@ -23,7 +23,6 @@ from testtools import matchers
|
|||
|
||||
from keystone.cmd import cli
|
||||
from keystone.common import dependency
|
||||
from keystone.common.sql import migration_helpers
|
||||
from keystone.i18n import _
|
||||
from keystone import resource
|
||||
from keystone.tests import unit
|
||||
|
@ -108,7 +107,10 @@ class CliBootStrapTestCaseWithEnvironment(CliBootStrapTestCase):
|
|||
self.username = uuid.uuid4().hex
|
||||
self.project_name = uuid.uuid4().hex
|
||||
self.role_name = uuid.uuid4().hex
|
||||
self.default_domain = migration_helpers.get_default_domain()
|
||||
self.default_domain = {
|
||||
'id': CONF.identity.default_domain_id,
|
||||
'name': 'Default',
|
||||
}
|
||||
self.useFixture(
|
||||
fixtures.EnvironmentVariable('OS_BOOTSTRAP_PASSWORD',
|
||||
newvalue=self.password))
|
||||
|
|
Loading…
Reference in New Issue