Merge "Enable keystone feature flags"
This commit is contained in:
commit
bd890d53b2
|
@ -176,6 +176,7 @@ def main():
|
||||||
|
|
||||||
configure_discovered_services(conf, services)
|
configure_discovered_services(conf, services)
|
||||||
configure_boto(conf, services)
|
configure_boto(conf, services)
|
||||||
|
configure_keystone_feature_flags(conf, services)
|
||||||
configure_horizon(conf)
|
configure_horizon(conf)
|
||||||
|
|
||||||
# remove all unwanted values if were specified
|
# remove all unwanted values if were specified
|
||||||
|
@ -793,6 +794,25 @@ def create_tempest_networks(clients, conf, has_neutron, public_network_id):
|
||||||
' must be specified')
|
' must be specified')
|
||||||
|
|
||||||
|
|
||||||
|
def configure_keystone_feature_flags(conf, services):
|
||||||
|
"""Set keystone feature flags based upon version ID."""
|
||||||
|
supported_versions = services.get('identity', {}).get('versions', [])
|
||||||
|
for version in supported_versions:
|
||||||
|
major, minor = version.split('.')[:2]
|
||||||
|
# We are going to enable two feature flags that are available
|
||||||
|
# after version 3.6: one related to domain specific roles and
|
||||||
|
# another one related to the security compliance feature.
|
||||||
|
# For more information, see
|
||||||
|
# https://developer.openstack.org/api-ref/identity/v3
|
||||||
|
if major == 'v3' and int(minor) >= 6:
|
||||||
|
conf.set('identity-feature-enabled',
|
||||||
|
'forbid_global_implied_dsr',
|
||||||
|
'True')
|
||||||
|
conf.set('identity-feature-enabled',
|
||||||
|
'security_compliance',
|
||||||
|
'True')
|
||||||
|
|
||||||
|
|
||||||
def configure_boto(conf, services):
|
def configure_boto(conf, services):
|
||||||
"""Set boto URLs based on discovered APIs."""
|
"""Set boto URLs based on discovered APIs."""
|
||||||
if 'ec2' in services:
|
if 'ec2' in services:
|
||||||
|
|
|
@ -234,6 +234,15 @@ class TestConfigTempest(BaseConfigTempestTest):
|
||||||
func2mock = 'config_tempest.api_discovery.get_identity_v3_extensions'
|
func2mock = 'config_tempest.api_discovery.get_identity_v3_extensions'
|
||||||
self.useFixture(MonkeyPatch(func2mock, mock_function))
|
self.useFixture(MonkeyPatch(func2mock, mock_function))
|
||||||
|
|
||||||
|
def test_configure_keystone_feature_flags(self):
|
||||||
|
tool.configure_keystone_feature_flags(self.conf, self.FAKE_SERVICES)
|
||||||
|
self.assertEqual(
|
||||||
|
self.conf.get('identity-feature-enabled',
|
||||||
|
'forbid_global_implied_dsr'), 'True')
|
||||||
|
self.assertEqual(
|
||||||
|
self.conf.get('identity-feature-enabled',
|
||||||
|
'security_compliance'), 'True')
|
||||||
|
|
||||||
def test_configure_boto(self):
|
def test_configure_boto(self):
|
||||||
tool.configure_boto(self.conf, self.FAKE_SERVICES)
|
tool.configure_boto(self.conf, self.FAKE_SERVICES)
|
||||||
expected_url = "http://172.16.52.151:5000"
|
expected_url = "http://172.16.52.151:5000"
|
||||||
|
|
Loading…
Reference in New Issue