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:
@@ -5,10 +5,4 @@
|
|||||||
# This file is loaded in the params.pp of each class.
|
# This file is loaded in the params.pp of each class.
|
||||||
#
|
#
|
||||||
class openstacklib::defaults {
|
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'
|
require 'spec_helper'
|
||||||
|
|
||||||
describe 'openstacklib::defaults', type: :class do
|
describe 'openstacklib::defaults' do
|
||||||
on_supported_os.each do |os, facts|
|
shared_examples 'openstacklib::defaults' do
|
||||||
let(:pre_condition) do
|
context 'with defaults' do
|
||||||
<<-eof
|
it { should contain_class('openstacklib::defaults') }
|
||||||
package { 'my_virt_package' :
|
end
|
||||||
ensure => present,
|
|
||||||
tag => 'openstack'
|
|
||||||
}
|
|
||||||
eof
|
|
||||||
end
|
end
|
||||||
|
|
||||||
context "Puppet < 4.0.0" do
|
on_supported_os({
|
||||||
|
:supported_os => OSDefaults.get_supported_os
|
||||||
|
}).each do |os,facts|
|
||||||
context "on #{os}" do
|
context "on #{os}" do
|
||||||
let(:facts) { facts.merge(:puppetversion => '3.8.0') }
|
let (:facts) do
|
||||||
it { is_expected.to compile.with_all_deps }
|
facts.merge(OSDefaults.get_facts())
|
||||||
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)}
|
|
||||||
end
|
end
|
||||||
|
|
||||||
|
it_behaves_like 'openstacklib::defaults'
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
Reference in New Issue
Block a user