Move swift::client to include from declared class

We need to be able to include swift::client multiple times in a
given catalog. In order to ensure that we get the value of
$swift::client_package_ensure, we change it to be the default in
swift::client

This cherry-pick to newton is required for cherry picking puppet-glance(I1eeb9f12cf82961ae820067ad8fe91d096d1d6e1) to newton.

Change-Id: I65fb0736e9fa9e68c3c7877cf6caf228c49eb82d
Related-bug: 1632143
(cherry picked from commit 4304c6e7bc)
This commit is contained in:
Andrew Woodward 2016-10-14 12:58:50 -07:00 committed by yatin
parent 1d4afc04b4
commit 9e32a6aca3
2 changed files with 9 additions and 6 deletions

View File

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

View File

@ -58,6 +58,7 @@ class swift(
include ::swift::deps
include ::swift::params
include ::swift::client
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')
@ -71,10 +72,6 @@ class swift(
}
}
class { '::swift::client':
ensure => $client_package_ensure;
}
File {
owner => 'swift',
group => 'swift',