Skip to content

Commit

Permalink
Merge pull request #16 from jlambert121/rem_repo_from_yum
Browse files Browse the repository at this point in the history
repo parameter for yum wasn't used
  • Loading branch information
jamtur01 committed Feb 25, 2013
2 parents 36ea816 + 753fb18 commit 7ab31cc
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 7 deletions.
2 changes: 1 addition & 1 deletion manifests/repo.pp
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
}

'Fedora','Rhel','Centos': {
class { 'sensu::repo::yum': ensure => $ensure, repo => $repo }
class { 'sensu::repo::yum': ensure => $ensure }
}

default: { alert("${::operatingsystem} not supported yet") }
Expand Down
5 changes: 2 additions & 3 deletions manifests/repo/yum.pp
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,7 @@
#

class sensu::repo::yum (
$ensure = 'present',
$repo = 'main'
$ensure = 'present'
) {

$enabled = $ensure ? {
Expand All @@ -19,7 +18,7 @@
enabled => $enabled,
baseurl => 'http://repos.sensuapp.org/yum/el/$releasever/$basearch/',
gpgcheck => 0,
name => "sensu-${repo}",
name => "sensu",
before => Package['sensu'],
}

Expand Down
6 changes: 3 additions & 3 deletions spec/classes/sensu_repo_yum_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
describe 'sensu::repo::yum', :type => :class do

context 'ensure: present' do
let(:params) { { :ensure => 'present', :repo => 'main' } }
let(:params) { { :ensure => 'present' } }
it { should contain_yumrepo('sensu').with(
'enabled' => 1,
'baseurl' => 'http://repos.sensuapp.org/yum/el/$releasever/$basearch/',
Expand All @@ -13,15 +13,15 @@
end

context 'ensure: absent' do
let(:params) { { :ensure => 'absent', :repo => 'main' } }
let(:params) { { :ensure => 'absent' } }
it { should contain_yumrepo('sensu').with(
'enabled' => 'absent',
'before' => 'Package[sensu]'
) }
end

context 'ensure: foo' do
let(:params) { { :ensure => 'foo', :repo => 'main' } }
let(:params) { { :ensure => 'foo' } }
it { should contain_yumrepo('sensu').with(
'enabled' => 'absent',
'before' => 'Package[sensu]'
Expand Down

0 comments on commit 7ab31cc

Please sign in to comment.