Deprecated swift::client_package_ensure

This should be directly set in the swift::client
class, this also makes us supress the unknown
variable error.

Change-Id: I79a148c90fbd4f70f6f5e6d9857d0c14da99338f
This commit is contained in:
Tobias Urdin 2019-06-08 01:35:22 +02:00
parent 1041c07684
commit 38753f433d
5 changed files with 25 additions and 22 deletions

View File

@ -9,20 +9,14 @@
# Defaults to 'present'.
#
class swift::client (
$ensure = $::swift::client_package_ensure
$ensure = 'present',
) {
if $ensure {
$real_ensure = $ensure
} else {
$real_ensure = 'present'
}
include ::swift::deps
include ::swift::params
package { 'swiftclient':
ensure => $real_ensure,
ensure => $ensure,
name => $::swift::params::client_package,
tag => ['openstack','swift-support-package']
}

View File

@ -27,15 +27,17 @@
# (Optional) The ensure state for the swift package.
# Defaults to present.
#
# [*client_package_ensure*]
# (Optional) The ensure state for the swift client package.
# Defaults to present.
#
# [*max_header_size*]
# (Optional) Max HTTP header size for incoming requests for all swift
# services. Recommended size is 32768 for PKI keystone tokens.
# Defaults to 8192
#
## DEPRECATED
#
# [*client_package_ensure*]
# (Optional) The ensure state for the swift client package.
# Defaults to undef
#
# == Dependencies
#
# None
@ -52,14 +54,19 @@ class swift(
$swift_hash_path_suffix = undef,
$swift_hash_path_prefix = undef,
$package_ensure = 'present',
$client_package_ensure = 'present',
$max_header_size = '8192',
# DEPRECATED
$client_package_ensure = undef,
) {
include ::swift::deps
include ::swift::params
include ::swift::client
if $client_package_ensure {
warning('swift::client_package_ensure is deprecated and has no effect')
}
if ($swift_hash_path_prefix == undef and $swift_hash_path_suffix == undef) {
fail('You must specify at least swift_hash_path_prefix or swift_hash_path_suffix')
}

View File

@ -0,0 +1,9 @@
---
upgrade:
- |
The swift::client_ensure_package parameter is deprecated and has no effect
if you use the swift::client class please define the ensure parameter there.
deprecations:
- |
The swift::client_ensure_package parameter is deprecated, if you use the
swift::client class please define the ensure parameter there.

View File

@ -7,7 +7,7 @@ describe 'swift::client' do
end
let :default_params do
{ :package_ensure => 'present' }
{ :ensure => 'present' }
end
shared_examples 'swift::client' do
@ -21,7 +21,7 @@ describe 'swift::client' do
it 'installs swift client package' do
is_expected.to contain_package('swiftclient').with(
:name => platform_params[:client_package_name],
:ensure => p[:package_ensure],
:ensure => p[:ensure],
:tag => ['openstack','swift-support-package'],
)
end

View File

@ -79,13 +79,6 @@ describe 'swift' do
'swift-hash/swift_hash_path_prefix').with_value('myprefix')
end
end
describe 'when overriding client_package_ensure parameter' do
it 'should effect ensure state of swift package' do
params[:client_package_ensure] = '2.0.2-1'
is_expected.to contain_package('swiftclient').with_ensure(params[:client_package_ensure])
end
end
end
on_supported_os({