Use ensure_packages to install utilities

* Remove nested declaration of nova::utilities::install

Change-Id: I232f8aae8889e448710157966de61510d7420c63
This commit is contained in:
Mathieu Gagné
2013-08-07 22:35:11 -04:00
parent 5c960aa967
commit 0903bb1615
2 changed files with 19 additions and 9 deletions

View File

@@ -1,14 +1,6 @@
# unzip swig screen parted curl euca2ools - extra packages
class nova::utilities {
define nova::utilities::install(){
if !defined(Package[$title]){
package { $title:
ensure => present
}
}
}
if $::osfamily == 'Debian' {
$pkgs = ['unzip', 'screen', 'parted', 'curl', 'euca2ools']
nova::utilities::install{$pkgs:}
ensure_packages(['unzip', 'screen', 'parted', 'curl', 'euca2ools'])
}
}

View File

@@ -0,0 +1,18 @@
require 'spec_helper'
describe 'nova::utilities' do
describe 'on debian platforms' do
let :facts do
{ :osfamily => 'Debian' }
end
it 'installes utilities' do
should contain_package('unzip').with_ensure('present')
should contain_package('screen').with_ensure('present')
should contain_package('parted').with_ensure('present')
should contain_package('curl').with_ensure('present')
should contain_package('euca2ools').with_ensure('present')
end
end
end