Merge "Fix deprecated options in oslo_config"

This commit is contained in:
Jenkins 2015-10-15 05:08:16 +00:00 committed by Gerrit Code Review
commit 76d6a70864
2 changed files with 13 additions and 1 deletions

View File

@ -63,7 +63,7 @@ class Opt(object):
"you need to import it into your application's "
"requirements file. ")
deprecated_opts = [o._to_oslo_opt() for o in self.deprecated]
deprecated_opts = [cfg.DeprecatedOpt(o.name) for o in self.deprecated]
return cfg.Opt(name=self.name,
type=self.type,

View File

@ -201,3 +201,15 @@ class ConfTests(utils.TestCase):
plugin_names = set([o.name for o in plugin_opts])
self.assertEqual(plugin_names, loaded_names)
def test_register_cfg(self):
loading.register_auth_conf_options(self.conf_fixture.conf,
group=self.GROUP)
def test_common_conf_options(self):
opts = loading.get_auth_common_conf_options()
self.assertEqual(2, len(opts))
auth_type = [o for o in opts if o.name == 'auth_type'][0]
self.assertEqual(1, len(auth_type.deprecated_opts))
self.assertIsInstance(auth_type.deprecated_opts[0], cfg.DeprecatedOpt)