remove deprecated auth type password-ceilometer-legacy

Change-Id: I7822964503439886ae08192c8edfb64c6201d438
This commit is contained in:
ZhiQiang Fan 2016-04-19 02:24:26 +08:00
parent b6a61f28f3
commit 372d70ce08
4 changed files with 2 additions and 67 deletions

View File

@ -15,7 +15,6 @@
import os
from keystoneauth1 import identity as ka_identity
from keystoneauth1 import loading as ka_loading
from keystoneclient.v3 import client as ks_client_v3
from oslo_config import cfg
@ -77,63 +76,3 @@ def register_keystoneauth_opts(conf):
cfg.DeprecatedOpt('os-cacert', group=CFG_GROUP),
cfg.DeprecatedOpt('os-cacert', group="DEFAULT")]
})
conf.set_default("auth_type", default="password-ceilometer-legacy",
group=CFG_GROUP)
def setup_keystoneauth(conf):
if conf[CFG_GROUP].auth_type == "password-ceilometer-legacy":
LOG.warning("Value 'password-ceilometer-legacy' for '[%s]/auth_type' "
"is deprecated. And will be removed in Ceilometer 7.0. "
"Use 'password' instead.",
CFG_GROUP)
ka_loading.load_auth_from_conf_options(conf, CFG_GROUP)
class LegacyCeilometerKeystoneLoader(ka_loading.BaseLoader):
@property
def plugin_class(self):
return ka_identity.V2Password
def get_options(self):
options = super(LegacyCeilometerKeystoneLoader, self).get_options()
options.extend([
ka_loading.Opt(
'os-username',
default=os.environ.get('OS_USERNAME', 'ceilometer'),
help='User name to use for OpenStack service access.'),
ka_loading.Opt(
'os-password',
secret=True,
default=os.environ.get('OS_PASSWORD', 'admin'),
help='Password to use for OpenStack service access.'),
ka_loading.Opt(
'os-tenant-id',
default=os.environ.get('OS_TENANT_ID', ''),
help='Tenant ID to use for OpenStack service access.'),
ka_loading.Opt(
'os-tenant-name',
default=os.environ.get('OS_TENANT_NAME', 'admin'),
help='Tenant name to use for OpenStack service access.'),
ka_loading.Opt(
'os-auth-url',
default=os.environ.get('OS_AUTH_URL',
'http://localhost:5000/v2.0'),
help='Auth URL to use for OpenStack service access.'),
])
return options
def load_from_options(self, **kwargs):
options_map = {
'os_auth_url': 'auth_url',
'os_username': 'username',
'os_password': 'password',
'os_tenant_name': 'tenant_name',
'os_tenant_id': 'tenant_id',
}
identity_kwargs = dict((options_map[o.dest],
kwargs.get(o.dest) or o.default)
for o in self.get_options()
if o.dest in options_map)
return self.plugin_class(**identity_kwargs)

View File

@ -110,8 +110,6 @@ def list_opts():
# NOTE(sileht): the configuration file contains only the options
# for the password plugin that handles keystone v2 and v3 API
# with discovery. But other options are possible.
# Also, the default loaded plugin is password-ceilometer-legacy for
# backward compatibility
('service_credentials', (
ceilometer.keystone_client.CLI_OPTS +
loading.get_auth_common_conf_options() +

View File

@ -15,6 +15,7 @@
import socket
import sys
from keystoneauth1 import loading as ka_loading
from oslo_config import cfg
import oslo_i18n
from oslo_log import log
@ -82,7 +83,7 @@ def prepare_service(argv=None, config_files=None):
version=version.version_info.version_string(),
default_config_files=config_files)
keystone_client.setup_keystoneauth(cfg.CONF)
ka_loading.load_auth_from_conf_options(cfg.CONF, "service_credentials")
log.setup(cfg.CONF, 'ceilometer')
# NOTE(liusheng): guru cannot run with service under apache daemon, so when

View File

@ -270,9 +270,6 @@ oslo.config.opts =
oslo.config.opts.defaults =
ceilometer = ceilometer.conf.defaults:set_cors_middleware_defaults
keystoneauth1.plugin =
password-ceilometer-legacy = ceilometer.keystone_client:LegacyCeilometerKeystoneLoader
tempest.test_plugins =
ceilometer_tests = ceilometer.tests.tempest.plugin:CeilometerTempestPlugin