Skip to content

Commit

Permalink
Merge pull request #121 from aerostitch/fixing_provider_name
Browse files Browse the repository at this point in the history
Fixing the provider name bug introduced in #117
  • Loading branch information
jyaworski committed Feb 20, 2016
2 parents ef99433 + fb7132a commit 0fa23f4
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
6 changes: 4 additions & 2 deletions manifests/params.pp
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
$seven_zip_name = '7zip'
$seven_zip_provider = 'chocolatey'
if versioncmp($::puppetversion, '4.3.1') >= 0 {
$gem_provider = 'pe_gem'
$gem_provider = 'puppet_gem'
} else {
$gem_provider = 'gem'
}
Expand All @@ -21,8 +21,10 @@
$mode = '0640'
$seven_zip_name = undef
$seven_zip_provider = undef
if $::puppetversion =~ /Puppet Enterprise/ or versioncmp($::puppetversion, '4.0.0') >= 0 {
if $::puppetversion =~ /Puppet Enterprise/ {
$gem_provider = 'pe_gem'
} elsif versioncmp($::puppetversion, '4.0.0') >= 0 {
$gem_provider = 'puppet_gem'
} else {
$gem_provider = 'gem'
}
Expand Down
8 changes: 4 additions & 4 deletions spec/classes/archive_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@
context 'RHEL Puppet 4.0.0 opensource' do
let(:facts) { { :osfamily => 'RedHat', :puppetversion => '4.0.0' } }

it { is_expected.to contain_package('faraday').with_provider('pe_gem') }
it { is_expected.to contain_package('faraday_middleware').with_provider('pe_gem') }
it { is_expected.to contain_package('faraday').with_provider('puppet_gem') }
it { is_expected.to contain_package('faraday_middleware').with_provider('puppet_gem') }
it { is_expected.to_not contain_package('7zip') }
end

Expand All @@ -39,8 +39,8 @@
context 'Windows Puppet 4.3.1 opensource' do
let(:facts) { { :osfamily => 'Windows', :archive_windir => 'C:/staging', :puppetversion => '4.3.1' } }

it { is_expected.to contain_package('faraday').with_provider('pe_gem') }
it { is_expected.to contain_package('faraday_middleware').with_provider('pe_gem') }
it { is_expected.to contain_package('faraday').with_provider('puppet_gem') }
it { is_expected.to contain_package('faraday_middleware').with_provider('puppet_gem') }
it do
should contain_package('7zip').with(:name => '7zip',
:provider => 'chocolatey',)
Expand Down

0 comments on commit 0fa23f4

Please sign in to comment.