Merge "Tag all Swift packages"

This commit is contained in:
Jenkins 2015-04-11 09:15:19 +00:00 committed by Gerrit Code Review
commit ebb8986567
7 changed files with 47 additions and 14 deletions

@ -17,6 +17,7 @@ class swift::client (
package { 'swiftclient': package { 'swiftclient':
ensure => $ensure, ensure => $ensure,
name => $::swift::params::client_package, name => $::swift::params::client_package,
tag => 'openstack',
} }
} }

@ -39,6 +39,7 @@ class swift(
package { 'swift': package { 'swift':
ensure => $package_ensure, ensure => $package_ensure,
name => $::swift::params::package_name, name => $::swift::params::package_name,
tag => 'openstack',
} }
} }

@ -166,6 +166,7 @@ class swift::proxy(
package { 'swift-proxy': package { 'swift-proxy':
ensure => $package_ensure, ensure => $package_ensure,
name => $::swift::params::proxy_package_name, name => $::swift::params::proxy_package_name,
tag => 'openstack',
} }
concat { '/etc/swift/proxy-server.conf': concat { '/etc/swift/proxy-server.conf':

@ -29,6 +29,7 @@ class swift::proxy::swift3(
package { 'swift-plugin-s3': package { 'swift-plugin-s3':
ensure => $ensure, ensure => $ensure,
name => $::swift::params::swift3, name => $::swift::params::swift3,
tag => 'openstack',
} }
concat::fragment { 'swift_swift3': concat::fragment { 'swift_swift3':

@ -47,6 +47,7 @@ define swift::storage::generic(
# this is a way to dynamically build the variables to lookup # this is a way to dynamically build the variables to lookup
# sorry its so ugly :( # sorry its so ugly :(
name => inline_template("<%= scope.lookupvar('::swift::params::${name}_package_name') %>"), name => inline_template("<%= scope.lookupvar('::swift::params::${name}_package_name') %>"),
tag => 'openstack',
before => Service["swift-${name}", "swift-${name}-replicator"], before => Service["swift-${name}", "swift-${name}-replicator"],
} }

@ -1,20 +1,45 @@
require 'spec_helper' require 'spec_helper'
describe 'swift::client' do describe 'swift::client' do
it { is_expected.to contain_package('swiftclient').with(
:ensure => 'present',
:name => 'python-swiftclient'
)}
let :facts do
{:osfamily => 'Debian'}
end
context 'with params' do
let :params do let :params do
{:ensure => 'latest'} {}
end end
it { is_expected.to contain_package('swiftclient').with(
:ensure => 'latest', let :default_params do
:name => 'python-swiftclient' { :package_ensure => 'present' }
)} end
shared_examples_for 'swift client' do
let :p do
default_params.merge(params)
end
it { is_expected.to contain_class('swift::params') }
it 'installs swift client package' do
is_expected.to contain_package('swiftclient').with(
:name => 'python-swiftclient',
:ensure => p[:package_ensure],
:tag => 'openstack'
)
end
end
context 'on Debian platform' do
let :facts do
{ :osfamily => 'Debian' }
end
it_configures 'swift client'
end
context 'on RedHat platform' do
let :facts do
{ :osfamily => 'RedHat' }
end
it_configures 'swift client'
end end
end end

@ -46,7 +46,10 @@ describe 'swift::storage::generic' do
let :params do let :params do
param_set param_set
end end
it { is_expected.to contain_package("swift-#{t}").with_ensure(param_hash[:package_ensure]) } it { is_expected.to contain_package("swift-#{t}").with(
:ensure => param_hash[:package_ensure],
:tag => 'openstack'
)}
it { is_expected.to contain_service("swift-#{t}").with( it { is_expected.to contain_service("swift-#{t}").with(
:ensure => 'running', :ensure => 'running',
:enable => true, :enable => true,