From 46e46998d076311e0c127667b1834fb9d2ddb809 Mon Sep 17 00:00:00 2001 From: Cody Herriges Date: Tue, 26 Jan 2016 13:24:33 -0800 Subject: [PATCH] Remove code deprecated in liberty cycle This commit removes all code that was related to deprecations, including tests put in during the liberty release cycle and increases the verbosity of warnings provided for code deprecated during this cycle (Mitaka). Change-Id: I991654c6c0706eea31a6702703596e73080bec4e --- manifests/backend/dellsc_iscsi.pp | 4 +- manifests/backend/eqlx.pp | 4 +- manifests/backend/hp3par_iscsi.pp | 2 - manifests/backend/vmdk.pp | 4 +- manifests/backends.pp | 9 +- manifests/backup/swift.pp | 2 +- manifests/db/mysql.pp | 2 +- manifests/init.pp | 2 +- manifests/keystone/auth.pp | 154 +--------------------- manifests/qpid.pp | 2 +- manifests/rabbitmq.pp | 45 +++---- spec/classes/cinder_backends_spec.rb | 13 -- spec/classes/cinder_keystone_auth_spec.rb | 33 ----- spec/classes/cinder_rabbitmq_spec.rb | 20 +-- 14 files changed, 35 insertions(+), 261 deletions(-) diff --git a/manifests/backend/dellsc_iscsi.pp b/manifests/backend/dellsc_iscsi.pp index fc938378..9c7d3f27 100644 --- a/manifests/backend/dellsc_iscsi.pp +++ b/manifests/backend/dellsc_iscsi.pp @@ -65,11 +65,11 @@ define cinder::backend::dellsc_iscsi ( ) { if $dell_sc_server_folder == 'srv' { - warning('The OpenStack default value of dell_sc_server_folder differs from the puppet module default of "srv" and may change in later versions of the module.') + warning('The OpenStack default value of dell_sc_server_folder differs from the puppet module default of "srv" and will be changed to the upstream OpenStack default in N-release.') } if $dell_sc_volume_folder == 'vol' { - warning('The OpenStack default value of dell_sc_volume_folder differs from the puppet module default of "vol" and may change in later versions of the module.') + warning('The OpenStack default value of dell_sc_volume_folder differs from the puppet module default of "vol" and will be changed to the upstream OpenStack default in N-release.') } $driver = 'dell.dell_storagecenter_iscsi.DellStorageCenterISCSIDriver' diff --git a/manifests/backend/eqlx.pp b/manifests/backend/eqlx.pp index 49daf900..bc7c7b3b 100644 --- a/manifests/backend/eqlx.pp +++ b/manifests/backend/eqlx.pp @@ -82,11 +82,11 @@ define cinder::backend::eqlx ( } if $eqlx_chap_login == 'chapadmin' { - warning('The OpenStack default value of eqlx_chap_login differs from the puppet module default of "chapadmin" and may change in later versions of the module.') + warning('The OpenStack default value of eqlx_chap_login differs from the puppet module default of "chapadmin" and will be changed to the upstream OpenStack default in N-release.') } if $eqlx_chap_password == '12345' { - warning('The OpenStack default value of eqlx_chap_password differs from the puppet module default of "12345" and may change in later versions of the module.') + warning('The OpenStack default value of eqlx_chap_password differs from the puppet module default of "12345" and will be changed to the upstream OpenStack default in N-release.') } diff --git a/manifests/backend/hp3par_iscsi.pp b/manifests/backend/hp3par_iscsi.pp index 5e71c142..d93088f9 100644 --- a/manifests/backend/hp3par_iscsi.pp +++ b/manifests/backend/hp3par_iscsi.pp @@ -1,5 +1,3 @@ -# == Define: cinder::backend::hp3par_iscsi -# # Configures Cinder volume HP 3par ISCSI driver. # Parameters are particular to each volume driver. # diff --git a/manifests/backend/vmdk.pp b/manifests/backend/vmdk.pp index 159ab4e0..d0fef7b4 100644 --- a/manifests/backend/vmdk.pp +++ b/manifests/backend/vmdk.pp @@ -70,11 +70,11 @@ define cinder::backend::vmdk ( ) { if $volume_folder == 'cinder-volumes' { - warning('The OpenStack default value of volume_folder differs from the puppet module default of "cinder-volumes" and may change in later versions of the module.') + warning('The OpenStack default value of volume_folder differs from the puppet module default of "cinder-volumes" and will be changed to the upstream OpenStack default in N-release.') } if $task_poll_interval == 5 { - warning('The OpenStack default value of task_poll_interval differs from the puppet module default of "5" and may change in later versions of the module.') + warning('The OpenStack default value of task_poll_interval differs from the puppet module default of "5" and will be changed to the upstream OpenStack default in N-release.') } cinder_config { diff --git a/manifests/backends.pp b/manifests/backends.pp index 2a023d71..f691d5a0 100644 --- a/manifests/backends.pp +++ b/manifests/backends.pp @@ -17,17 +17,10 @@ # Author: Andrew Woodward class cinder::backends ( $enabled_backends = undef, - # DEPRECATED - $default_volume_type = false - ){ +) { # Maybe this could be extented to dynamicly find the enabled names cinder_config { 'DEFAULT/enabled_backends': value => join($enabled_backends, ','); } - - if $default_volume_type { - fail('The default_volume_type parameter is deprecated in this class, you should declare it in cinder::api.') - } - } diff --git a/manifests/backup/swift.pp b/manifests/backup/swift.pp index 94e66d75..e1f84443 100644 --- a/manifests/backup/swift.pp +++ b/manifests/backup/swift.pp @@ -71,7 +71,7 @@ class cinder::backup::swift ( ) { if ($backup_swift_container == 'volumes_backup') { - warning('WARNING: The default backup_swift_container value in puppet differs from the OpenStack default and may change in future releases') + warning('The OpenStack default value of backup_swift_container differs from the puppet module default of "volumes_backup" and will be changed to the upstream OpenStack default in N-release.') } cinder_config { diff --git a/manifests/db/mysql.pp b/manifests/db/mysql.pp index 2bc5ec75..49265d34 100644 --- a/manifests/db/mysql.pp +++ b/manifests/db/mysql.pp @@ -47,7 +47,7 @@ class cinder::db::mysql ( validate_string($password) if $cluster_id != 'localzone' { - warning('The cluster_id parameter is deprecated and has no affect. It will be removed in the next release') + warning('The cluster_id parameter is deprecated and has no affect. It will be completely removed from puppet-cinder in the N-release') } ::openstacklib::db::mysql { 'cinder': diff --git a/manifests/init.pp b/manifests/init.pp index 69c0164f..e1f5985f 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -372,7 +372,7 @@ class cinder ( } if $rpc_backend == 'cinder.openstack.common.rpc.impl_qpid' or $rpc_backend == 'qpid' { - warning('Qpid driver is removed from Oslo.messaging in the Mitaka release') + warning('Qpid driver is removed from Oslo.messaging in the Mitaka release and puppet-cinder no longer attempts to configure it. All qpid related parameters will be removed from puppet-cinder in the N-release.') } if ! $default_availability_zone { diff --git a/manifests/keystone/auth.pp b/manifests/keystone/auth.pp index df62f7fd..71289f80 100644 --- a/manifests/keystone/auth.pp +++ b/manifests/keystone/auth.pp @@ -112,51 +112,6 @@ # (optional) The v2 endpoint's admin url. (Defaults to 'http://127.0.0.1:8776/v2/%(tenant_id)s') # This url should *not* contain any trailing '/'. # -# [*volume_version*] -# (optional) DEPRECATED: Use public_url, internal_url and admin_url instead. -# Cinder API version. (Defaults to 'v1') -# Setting this parameter overrides public_url, internal_url and admin_url parameters. -# -# [*port*] -# (optional) DEPRECATED: Use public_url, internal_url and admin_url instead. -# Port for endpoint. (Defaults to 8776) -# Setting this parameter overrides public_url, internal_url and admin_url parameters. -# -# [*public_protocol*] -# (optional) DEPRECATED: Use public_url instead. -# Protocol for public endpoint. (Defaults to 'http') -# Setting this parameter overrides public_url parameter. -# -# [*internal_protocol*] -# (optional) DEPRECATED: Use internal_url and internal_url_v2 instead. -# Protocol for internal endpoint. (Defaults to 'http') -# Setting this parameter overrides internal_url and internal_url_v2 parameter. -# -# [*admin_protocol*] -# (optional) DEPRECATED: Use admin_url and admin_url_v2 instead. -# Protocol for admin endpoint. (Defaults to 'http') -# Setting this parameter overrides admin_url and admin_url_v2 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 and public_url_v2 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 and internal_url_v2 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 and admin_url_v2 parameter. -# -# === Deprecation notes -# -# If any value is provided for public_protocol, public_address or public_port parameters, -# public_url will be completely ignored. The same applies for internal and admin parameters. -# # === Examples # # class { 'cinder::keystone::auth': @@ -194,48 +149,8 @@ class cinder::keystone::auth ( $service_description_v2 = 'Cinder Service v2', $region = 'RegionOne', # DEPRECATED PARAMETERS - $port = undef, - $volume_version = undef, - $public_address = undef, - $admin_address = undef, - $internal_address = undef, - $public_protocol = undef, - $admin_protocol = undef, - $internal_protocol = undef ) { - if $volume_version { - warning('The volume_version parameter is deprecated, use public_url, internal_url and admin_url instead.') - } - - 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.') - } - $real_service_name = pick($service_name, $auth_name) $real_service_name_v2 = pick($service_name_v2, $auth_name_v2) @@ -243,63 +158,6 @@ class cinder::keystone::auth ( fail('cinder::keystone::auth parameters service_name and service_name_v2 must be different.') } - if ($public_protocol or $public_address or $port or $volume_version) { - $public_url_real = sprintf('%s://%s:%s/%s/%%(tenant_id)s', - pick($public_protocol, 'http'), - pick($public_address, '127.0.0.1'), - pick($port, '8776'), - pick($volume_version, 'v1')) - } else { - $public_url_real = $public_url - } - - if ($internal_protocol or $internal_address or $port or $volume_version) { - $internal_url_real = sprintf('%s://%s:%s/%s/%%(tenant_id)s', - pick($internal_protocol, 'http'), - pick($internal_address, '127.0.0.1'), - pick($port, '8776'), - pick($volume_version, 'v1')) - } else { - $internal_url_real = $internal_url - } - - if ($admin_protocol or $admin_address or $port or $volume_version) { - $admin_url_real = sprintf('%s://%s:%s/%s/%%(tenant_id)s', - pick($admin_protocol, 'http'), - pick($admin_address, '127.0.0.1'), - pick($port, '8776'), - pick($volume_version, 'v1')) - } else { - $admin_url_real = $admin_url - } - - if ($public_protocol or $public_address or $port) { - $public_url_v2_real = sprintf('%s://%s:%s/v2/%%(tenant_id)s', - pick($public_protocol, 'http'), - pick($public_address, '127.0.0.1'), - pick($port, '8776')) - } else { - $public_url_v2_real = $public_url_v2 - } - - if ($internal_protocol or $internal_address or $port) { - $internal_url_v2_real = sprintf('%s://%s:%s/v2/%%(tenant_id)s', - pick($internal_protocol, 'http'), - pick($internal_address, '127.0.0.1'), - pick($port, '8776')) - } else { - $internal_url_v2_real = $internal_url_v2 - } - - if ($admin_protocol or $admin_address or $port) { - $admin_url_v2_real = sprintf('%s://%s:%s/v2/%%(tenant_id)s', - pick($admin_protocol, 'http'), - pick($admin_address, '127.0.0.1'), - pick($port, '8776')) - } else { - $admin_url_v2_real = $admin_url_v2 - } - keystone::resource::service_identity { 'cinder': configure_user => $configure_user, configure_user_role => $configure_user_role, @@ -312,9 +170,9 @@ class cinder::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, } keystone::resource::service_identity { 'cinderv2': @@ -329,9 +187,9 @@ class cinder::keystone::auth ( password => $password_user_v2, email => $email_user_v2, tenant => $tenant_user_v2, - public_url => $public_url_v2_real, - admin_url => $admin_url_v2_real, - internal_url => $internal_url_v2_real, + public_url => $public_url_v2, + admin_url => $admin_url_v2, + internal_url => $internal_url_v2, } if $configure_user_role { diff --git a/manifests/qpid.pp b/manifests/qpid.pp index 6c9e658a..6e84f1be 100644 --- a/manifests/qpid.pp +++ b/manifests/qpid.pp @@ -32,5 +32,5 @@ class cinder::qpid ( $realm = undef ) { - warning('Qpid driver is removed from Oslo.messaging in the Mitaka release') + warning('Qpid driver is removed from Oslo.messaging in the Mitaka release and puppet-cinder no longer attempts to configure it. This class will be completely removed from puppet-cinder in the N-release.') } diff --git a/manifests/rabbitmq.pp b/manifests/rabbitmq.pp index f8a30907..31a8d21b 100644 --- a/manifests/rabbitmq.pp +++ b/manifests/rabbitmq.pp @@ -22,41 +22,30 @@ # (optional) The virtual host to use when connecting to Rabbit # Defaults to '/' # -# [*enabled*] -# (optional) Deprecated. Whether to enable the Rabbit resources -# This parameter keeps backward compatibility when we used to manage -# RabbitMQ service. -# Defaults to true -# class cinder::rabbitmq( $userid = 'guest', $password = 'guest', $virtual_host = '/', - # DEPRECATED PARAMETER - $port = '5672', - $enabled = true, ) { - if ($enabled) { - if $userid == 'guest' { - $delete_guest_user = false - } else { - $delete_guest_user = true - rabbitmq_user { $userid: - admin => true, - password => $password, - provider => 'rabbitmqctl', - } - # I need to figure out the appropriate permissions - rabbitmq_user_permissions { "${userid}@${virtual_host}": - configure_permission => '.*', - write_permission => '.*', - read_permission => '.*', - provider => 'rabbitmqctl', - }->Anchor<| title == 'cinder-start' |> - } - rabbitmq_vhost { $virtual_host: + if $userid == 'guest' { + $delete_guest_user = false + } else { + $delete_guest_user = true + rabbitmq_user { $userid: + admin => true, + password => $password, provider => 'rabbitmqctl', } + # I need to figure out the appropriate permissions + rabbitmq_user_permissions { "${userid}@${virtual_host}": + configure_permission => '.*', + write_permission => '.*', + read_permission => '.*', + provider => 'rabbitmqctl', + }->Anchor<| title == 'cinder-start' |> + } + rabbitmq_vhost { $virtual_host: + provider => 'rabbitmqctl', } } diff --git a/spec/classes/cinder_backends_spec.rb b/spec/classes/cinder_backends_spec.rb index 50515b39..c6006150 100644 --- a/spec/classes/cinder_backends_spec.rb +++ b/spec/classes/cinder_backends_spec.rb @@ -40,7 +40,6 @@ describe 'cinder::backends' do before :each do params.merge!( :enabled_backends => ['lowcost', 'regular', 'premium'], - :default_volume_type => false ) end @@ -48,18 +47,6 @@ describe 'cinder::backends' do is_expected.to contain_cinder_config('DEFAULT/enabled_backends').with_value(p[:enabled_backends].join(',')) end end - - context 'configure cinder with a default volume type' do - before :each do - params.merge!( - :enabled_backends => ['foo', 'bar'], - :default_volume_type => 'regular' - ) - end - - it_raises 'a Puppet::Error', /The default_volume_type parameter is deprecated in this class, you should declare it in cinder::api./ - end - end on_supported_os({ diff --git a/spec/classes/cinder_keystone_auth_spec.rb b/spec/classes/cinder_keystone_auth_spec.rb index 38226708..9ba83088 100644 --- a/spec/classes/cinder_keystone_auth_spec.rb +++ b/spec/classes/cinder_keystone_auth_spec.rb @@ -77,39 +77,6 @@ describe 'cinder::keystone::auth' do end end - context 'with deprecated parameters' do - before do - params.merge!({ - :public_address => '10.0.42.1', - :admin_address => '10.0.42.2', - :internal_address => '10.0.42.3', - :region => 'RegionThree', - :port => '4242', - :admin_protocol => 'https', - :internal_protocol => 'https', - :public_protocol => 'https', - :volume_version => 'v42' - }) - end - - it 'configures keystone endpoints' do - is_expected.to contain_keystone_endpoint('RegionThree/cinder::volume').with( - :ensure => 'present', - :public_url => 'https://10.0.42.1:4242/v42/%(tenant_id)s', - :admin_url => 'https://10.0.42.2:4242/v42/%(tenant_id)s', - :internal_url => 'https://10.0.42.3:4242/v42/%(tenant_id)s' - ) - - is_expected.to contain_keystone_endpoint('RegionThree/cinderv2::volumev2').with( - :ensure => 'present', - :public_url => 'https://10.0.42.1:4242/v2/%(tenant_id)s', - :admin_url => 'https://10.0.42.2:4242/v2/%(tenant_id)s', - :internal_url => 'https://10.0.42.3:4242/v2/%(tenant_id)s' - ) - end - end - - describe 'when endpoint is_expected.to not be configured' do before do params.merge!( diff --git a/spec/classes/cinder_rabbitmq_spec.rb b/spec/classes/cinder_rabbitmq_spec.rb index 08e7d3b1..bccea7be 100644 --- a/spec/classes/cinder_rabbitmq_spec.rb +++ b/spec/classes/cinder_rabbitmq_spec.rb @@ -3,7 +3,7 @@ require 'spec_helper' describe 'cinder::rabbitmq' do let :facts do - { :puppetversion => '2.7', + { :osfamily => 'Debian', } end @@ -47,22 +47,4 @@ describe 'cinder::rabbitmq' do end - describe 'when disabled' do - let :params do - { - :userid => 'dan', - :password => 'pass', - :enabled => false - } - end - - it 'should be disabled' do - - is_expected.to_not contain_rabbitmq_user('dan') - is_expected.to_not contain_rabbitmq_user_permissions('dan@/') - is_expected.to_not contain_rabbitmq_vhost('/') - - end - end - end