From 716c70c315c3344ee718e63e38bced2f12560cf7 Mon Sep 17 00:00:00 2001 From: Lance Bragstad Date: Mon, 10 Apr 2017 17:04:13 +0000 Subject: [PATCH] Remove usage of enforce_type The usage of `enforce_type` from oslo.config will be removed in the 4.0 release of oslo.config. The default behavior has been incorporated into set_override/set_default as of: Ifa552de0a994e40388cbc9f7dbaa55700ca276b0 We no longer need to specify `enforce_type=True` and we should remove it since it will be removed from oslo.config. This commit also fixes violations with enforce_type=True. Change-Id: I8222e84583aaa4de4c7c36ec8cec5e35c2e7e253 Related-Bug: 1517839 --- keystone/identity/core.py | 3 +-- keystone/tests/unit/identity/test_core.py | 2 +- keystone/tests/unit/test_backend_ldap.py | 2 +- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/keystone/identity/core.py b/keystone/identity/core.py index d29455b010..b783836d85 100644 --- a/keystone/identity/core.py +++ b/keystone/identity/core.py @@ -266,8 +266,7 @@ class DomainConfigs(dict): for group in specific_config: for option in specific_config[group]: domain_config['cfg'].set_override( - option, specific_config[group][option], - group, enforce_type=True) + option, specific_config[group][option], group) domain_config['cfg_overrides'] = specific_config domain_config['driver'] = self._load_driver(domain_config) diff --git a/keystone/tests/unit/identity/test_core.py b/keystone/tests/unit/identity/test_core.py index 71ebde81d2..50c2a66535 100644 --- a/keystone/tests/unit/identity/test_core.py +++ b/keystone/tests/unit/identity/test_core.py @@ -143,7 +143,7 @@ class TestDatabaseDomainConfigs(unit.TestCase): # Override two config options for our domain conf = {'ldap': {'url': uuid.uuid4().hex, 'suffix': uuid.uuid4().hex, - 'use_tls': 'True'}, + 'use_tls': True}, 'identity': { 'driver': 'ldap'}} self.domain_config_api.create_config(domain['id'], conf) diff --git a/keystone/tests/unit/test_backend_ldap.py b/keystone/tests/unit/test_backend_ldap.py index b199b3435e..8576a322fa 100644 --- a/keystone/tests/unit/test_backend_ldap.py +++ b/keystone/tests/unit/test_backend_ldap.py @@ -2608,7 +2608,7 @@ class MultiLDAPandSQLIdentityDomainConfigsInSQL(MultiLDAPandSQLIdentity): 'password': 'password', 'suffix': 'cn=example,cn=com'}, 'identity': {'driver': 'ldap', - 'list_limit': '101'} + 'list_limit': 101} } domain2_config = { 'ldap': {'url': 'fake://memory',