From 9e32a6aca30d67148b6364414152879824791f1e Mon Sep 17 00:00:00 2001 From: Andrew Woodward Date: Fri, 14 Oct 2016 12:58:50 -0700 Subject: [PATCH] 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 4304c6e7bc71a69bc2e646ce2e0aa59c918aec76) --- manifests/client.pp | 10 ++++++++-- manifests/init.pp | 5 +---- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/manifests/client.pp b/manifests/client.pp index b52af79d..79b8f3eb 100644 --- a/manifests/client.pp +++ b/manifests/client.pp @@ -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'] } diff --git a/manifests/init.pp b/manifests/init.pp index 99da904c..1d9b17ae 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -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',