Remove allow_virtual for Package in defaults
We only test and support Puppet 4 and Puppet 5 now and this parameter to the Package resource defaults to true in these versions making this unneccesary. Change-Id: I1459cf5382cd3090c051b25c884399d5cf37d264
This commit is contained in:
parent
78c08ad6dc
commit
4ef3b1e843
@ -5,10 +5,4 @@
|
||||
# This file is loaded in the params.pp of each class.
|
||||
#
|
||||
class openstacklib::defaults {
|
||||
# Ensure all package resources have virtual package enable.
|
||||
if versioncmp($::puppetversion, '4.0.0') < 0 and versioncmp($::puppetversion, '3.6.1') >= 0 {
|
||||
Package<| tag == 'openstack' |> {
|
||||
allow_virtual => true,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1,33 +1,21 @@
|
||||
require 'spec_helper'
|
||||
|
||||
describe 'openstacklib::defaults', type: :class do
|
||||
on_supported_os.each do |os, facts|
|
||||
let(:pre_condition) do
|
||||
<<-eof
|
||||
package { 'my_virt_package' :
|
||||
ensure => present,
|
||||
tag => 'openstack'
|
||||
}
|
||||
eof
|
||||
describe 'openstacklib::defaults' do
|
||||
shared_examples 'openstacklib::defaults' do
|
||||
context 'with defaults' do
|
||||
it { should contain_class('openstacklib::defaults') }
|
||||
end
|
||||
end
|
||||
|
||||
context "Puppet < 4.0.0" do
|
||||
context "on #{os}" do
|
||||
let(:facts) { facts.merge(:puppetversion => '3.8.0') }
|
||||
it { is_expected.to compile.with_all_deps }
|
||||
it { is_expected.to contain_class('openstacklib::defaults') }
|
||||
it { is_expected.to contain_package('my_virt_package')
|
||||
.with(:allow_virtual => true)}
|
||||
end
|
||||
end
|
||||
context "Puppet >= 4.0.0" do
|
||||
context "on #{os}" do
|
||||
let(:facts) { facts.merge(:puppetversion => '4.0.0') }
|
||||
it { is_expected.to compile.with_all_deps }
|
||||
it { is_expected.to contain_class('openstacklib::defaults') }
|
||||
it { is_expected.to contain_package('my_virt_package')
|
||||
.without(:allow_virtual)}
|
||||
on_supported_os({
|
||||
:supported_os => OSDefaults.get_supported_os
|
||||
}).each do |os,facts|
|
||||
context "on #{os}" do
|
||||
let (:facts) do
|
||||
facts.merge(OSDefaults.get_facts())
|
||||
end
|
||||
|
||||
it_behaves_like 'openstacklib::defaults'
|
||||
end
|
||||
end
|
||||
end
|
||||
|
Loading…
x
Reference in New Issue
Block a user