From 45503b548a2be61bc1799f176dae8558592db47a Mon Sep 17 00:00:00 2001 From: Denis Egorenko Date: Wed, 1 Jun 2016 18:36:49 +0300 Subject: [PATCH] Remove deprecated keystone::auth options Change-Id: I69df2e6ef68c79bdc6d564c78489cec555af396b --- manifests/keystone/auth.pp | 119 +----------------- ...eystone_auth_options-65fea5e2c80278e7.yaml | 3 + spec/classes/trove_keystone_auth_spec.rb | 21 ---- 3 files changed, 6 insertions(+), 137 deletions(-) create mode 100644 releasenotes/notes/remove_deprecated_keystone_auth_options-65fea5e2c80278e7.yaml diff --git a/manifests/keystone/auth.pp b/manifests/keystone/auth.pp index 51cecbb9..5af43f08 100644 --- a/manifests/keystone/auth.pp +++ b/manifests/keystone/auth.pp @@ -70,51 +70,6 @@ # (optional) The endpoint's internal url. (Defaults to 'http://127.0.0.1:8779/v1.0/%(tenant_id)s') # 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 9001) -# 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 $port) -# 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 { 'trove::keystone::auth': @@ -138,78 +93,10 @@ class trove::keystone::auth ( $public_url = 'http://127.0.0.1:8779/v1.0/%(tenant_id)s', $admin_url = 'http://127.0.0.1:8779/v1.0/%(tenant_id)s', $internal_url = 'http://127.0.0.1:8779/v1.0/%(tenant_id)s', - # DEPRECATED PARAMETERS - $port = undef, - $public_port = undef, - $public_protocol = undef, - $public_address = undef, - $internal_protocol = undef, - $internal_address = undef, - $admin_protocol = undef, - $admin_address = undef, ) { include ::trove::deps - if $port { - warning('The port parameter is deprecated, use public_url, internal_url and admin_url instead.') - } - - if $public_port { - warning('The public_port parameter is deprecated, use public_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/v1.0/%%(tenant_id)s', - pick($public_protocol, 'http'), - pick($public_address, '127.0.0.1'), - pick($public_port, $port, '8779')) - } else { - $public_url_real = $public_url - } - - if ($admin_protocol or $admin_address or $port) { - $admin_url_real = sprintf('%s://%s:%s/v1.0/%%(tenant_id)s', - pick($admin_protocol, 'http'), - pick($admin_address, '127.0.0.1'), - pick($port, '8779')) - } else { - $admin_url_real = $admin_url - } - - if ($internal_protocol or $internal_address or $port) { - $internal_url_real = sprintf('%s://%s:%s/v1.0/%%(tenant_id)s', - pick($internal_protocol, 'http'), - pick($internal_address, '127.0.0.1'), - pick($port, '8779')) - } else { - $internal_url_real = $internal_url - } - $real_service_name = pick($service_name, $auth_name) Keystone_user_role["${auth_name}@${tenant}"] ~> Service <| tag == 'trove-server' |> @@ -229,9 +116,9 @@ class trove::keystone::auth ( password => $password, email => $email, tenant => $tenant, - public_url => $public_url_real, - internal_url => $internal_url_real, - admin_url => $admin_url_real, + public_url => $public_url, + internal_url => $internal_url, + admin_url => $admin_url, } } diff --git a/releasenotes/notes/remove_deprecated_keystone_auth_options-65fea5e2c80278e7.yaml b/releasenotes/notes/remove_deprecated_keystone_auth_options-65fea5e2c80278e7.yaml new file mode 100644 index 00000000..5f3a6761 --- /dev/null +++ b/releasenotes/notes/remove_deprecated_keystone_auth_options-65fea5e2c80278e7.yaml @@ -0,0 +1,3 @@ +--- +other: + - Removed deprecated options for trove::keystone::auth class. diff --git a/spec/classes/trove_keystone_auth_spec.rb b/spec/classes/trove_keystone_auth_spec.rb index 3c90239f..2be9f19a 100644 --- a/spec/classes/trove_keystone_auth_spec.rb +++ b/spec/classes/trove_keystone_auth_spec.rb @@ -82,27 +82,6 @@ describe 'trove::keystone::auth' do ) } end - describe 'with deprecated endpoint parameters' do - let :params do - { :password => 'trove_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/trove::database').with( - :ensure => 'present', - :public_url => 'https://10.10.10.10:80/v1.0/%(tenant_id)s', - :internal_url => 'https://10.10.10.11:81/v1.0/%(tenant_id)s', - :admin_url => 'https://10.10.10.12:81/v1.0/%(tenant_id)s' - ) } - end - describe 'when overriding auth name' do let :params do { :password => 'foo',