Drop deprecated parameters for keystone::auth

Change-Id: I16e9fc1cefeb9026fdec516eff64c1019c7cae8d
This commit is contained in:
Fang Zhen 2016-05-07 11:42:56 +08:00
parent c63a585f41
commit c2a1075037
3 changed files with 9 additions and 135 deletions

View File

@ -51,51 +51,6 @@
# (optional) The endpoint's internal url. (Defaults to 'http://127.0.0.1:9696')
# This url should *not* contain any trailing '/'.
#
# [*port*]
# (optional) DEPRECATED: Use public_url, internal_url and admin_url instead.
# Default port for endpoints. (Defaults to 9696)
# Setting this parameter overrides public_url, internal_url and admin_url parameters.
#
# [*public_port*]
# (optional) DEPRECATED: Use public_url instead.
# Default port for endpoints. (Defaults to 9696)
# Setting this parameter overrides public_url parameter.
#
# [*public_protocol*]
# (optional) DEPRECATED: Use public_url instead.
# Protocol for public endpoint. (Defaults to 'http')
# Setting this parameter overrides public_url parameter.
#
# [*public_address*]
# (optional) DEPRECATED: Use public_url instead.
# Public address for endpoint. (Defaults to '127.0.0.1')
# Setting this parameter overrides public_url parameter.
#
# [*internal_protocol*]
# (optional) DEPRECATED: Use internal_url instead.
# Protocol for internal endpoint. (Defaults to 'http')
# Setting this parameter overrides internal_url parameter.
#
# [*internal_address*]
# (optional) DEPRECATED: Use internal_url instead.
# Internal address for endpoint. (Defaults to '127.0.0.1')
# Setting this parameter overrides internal_url parameter.
#
# [*admin_protocol*]
# (optional) DEPRECATED: Use admin_url instead.
# Protocol for admin endpoint. (Defaults to 'http')
# Setting this parameter overrides admin_url parameter.
#
# [*admin_address*]
# (optional) DEPRECATED: Use admin_url instead.
# Admin address for endpoint. (Defaults to '127.0.0.1')
# Setting this parameter overrides admin_url parameter.
#
# === Deprecation notes
#
# If any value is provided for public_protocol, public_address or port parameters,
# public_url will be completely ignored. The same applies for internal and admin parameters.
#
# === Examples
#
# class { 'neutron::keystone::auth':
@ -120,72 +75,8 @@ class neutron::keystone::auth (
$public_url = 'http://127.0.0.1:9696',
$admin_url = 'http://127.0.0.1:9696',
$internal_url = 'http://127.0.0.1:9696',
# DEPRECATED PARAMETERS
$port = undef,
$public_protocol = undef,
$public_address = undef,
$public_port = undef,
$internal_protocol = undef,
$internal_address = undef,
$admin_protocol = undef,
$admin_address = undef,
) {
if $port {
warning('The port parameter is deprecated, use public_url, internal_url and admin_url instead.')
}
if $public_protocol {
warning('The public_protocol parameter is deprecated, use public_url instead.')
}
if $internal_protocol {
warning('The internal_protocol parameter is deprecated, use internal_url instead.')
}
if $admin_protocol {
warning('The admin_protocol parameter is deprecated, use admin_url instead.')
}
if $public_address {
warning('The public_address parameter is deprecated, use public_url instead.')
}
if $internal_address {
warning('The internal_address parameter is deprecated, use internal_url instead.')
}
if $admin_address {
warning('The admin_address parameter is deprecated, use admin_url instead.')
}
if ($public_protocol or $public_address or $port or $public_port) {
$public_url_real = sprintf('%s://%s:%s',
pick($public_protocol, 'http'),
pick($public_address, '127.0.0.1'),
pick($public_port, $port, '9696'))
} else {
$public_url_real = $public_url
}
if ($admin_protocol or $admin_address or $port) {
$admin_url_real = sprintf('%s://%s:%s',
pick($admin_protocol, 'http'),
pick($admin_address, '127.0.0.1'),
pick($port, '9696'))
} else {
$admin_url_real = $admin_url
}
if ($internal_protocol or $internal_address or $port) {
$internal_url_real = sprintf('%s://%s:%s',
pick($internal_protocol, 'http'),
pick($internal_address, '127.0.0.1'),
pick($port, '9696'))
} else {
$internal_url_real = $internal_url
}
$real_service_name = pick($service_name, $auth_name)
if $configure_endpoint {
@ -207,9 +98,9 @@ class neutron::keystone::auth (
password => $password,
email => $email,
tenant => $tenant,
public_url => $public_url_real,
admin_url => $admin_url_real,
internal_url => $internal_url_real,
public_url => $public_url,
admin_url => $admin_url,
internal_url => $internal_url,
}
}

View File

@ -0,0 +1,6 @@
---
other:
- Remove deprecated parameters for keystone::auth, including
port, public_protocol, public_address, public_port, internal_protocol,
internal_address, admin_protocol, admin_address. Use the new parameters
public_url, admin_url and internal_url instead.

View File

@ -79,29 +79,6 @@ describe 'neutron::keystone::auth' do
) }
end
describe 'with deprecated endpoint parameters' do
let :params do
{
:password => 'neutron_password',
:public_protocol => 'https',
:public_port => '80',
:public_address => '10.10.10.10',
:port => '81',
:internal_protocol => 'https',
:internal_address => '10.10.10.11',
:admin_protocol => 'https',
:admin_address => '10.10.10.12'
}
end
it { is_expected.to contain_keystone_endpoint('RegionOne/neutron::network').with(
:ensure => 'present',
:public_url => "https://10.10.10.10:80",
:internal_url => "https://10.10.10.11:81",
:admin_url => "https://10.10.10.12:81"
) }
end
describe 'when overriding auth name' do
let :params do