From c2a1075037d7da835227fdb2727e5a264edd6785 Mon Sep 17 00:00:00 2001 From: Fang Zhen Date: Sat, 7 May 2016 11:42:56 +0800 Subject: [PATCH] Drop deprecated parameters for keystone::auth Change-Id: I16e9fc1cefeb9026fdec516eff64c1019c7cae8d --- manifests/keystone/auth.pp | 115 +----------------- ...eprecated-parameters-986fbfeaf482ef1d.yaml | 6 + spec/classes/neutron_keystone_auth_spec.rb | 23 ---- 3 files changed, 9 insertions(+), 135 deletions(-) create mode 100644 releasenotes/notes/remove-deprecated-parameters-986fbfeaf482ef1d.yaml diff --git a/manifests/keystone/auth.pp b/manifests/keystone/auth.pp index abf7655ff..ed4461208 100644 --- a/manifests/keystone/auth.pp +++ b/manifests/keystone/auth.pp @@ -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, } } diff --git a/releasenotes/notes/remove-deprecated-parameters-986fbfeaf482ef1d.yaml b/releasenotes/notes/remove-deprecated-parameters-986fbfeaf482ef1d.yaml new file mode 100644 index 000000000..8030fb4c6 --- /dev/null +++ b/releasenotes/notes/remove-deprecated-parameters-986fbfeaf482ef1d.yaml @@ -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. diff --git a/spec/classes/neutron_keystone_auth_spec.rb b/spec/classes/neutron_keystone_auth_spec.rb index 7c15b8386..364c90bd1 100644 --- a/spec/classes/neutron_keystone_auth_spec.rb +++ b/spec/classes/neutron_keystone_auth_spec.rb @@ -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