Skip to content

Commit

Permalink
Simplify package name handling
Browse files Browse the repository at this point in the history
f614db2 removed the use of
$rubygem_katello_ostree variable, but not its definition.

We also don't want to hard fail because we sometimes want to compile on
other distros. The most common use case is CI testing our installer by
running it with --help. Since that happens on Travis (which is Ubuntu)
it hard fails.
  • Loading branch information
ekohl committed Dec 14, 2018
1 parent a903e44 commit 1843231
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 34 deletions.
23 changes: 5 additions & 18 deletions manifests/params.pp
Original file line number Diff line number Diff line change
@@ -1,25 +1,12 @@
# Katello Default Params
class katello::params {

case $::osfamily {
'RedHat': {
case $::operatingsystem {
'Fedora': {
$rubygem_katello = 'rubygem-katello'
$rubygem_katello_ostree ='rubygem-katello_ostree'
}
default: {
$rubygem_katello = 'tfm-rubygem-katello'
$rubygem_katello_ostree ='tfm-rubygem-katello_ostree'
}
}

$package_names = ['katello', $rubygem_katello]
}
default: {
fail("${::hostname}: This module does not support osfamily ${::osfamily}")
}
if $::operatingsystem == 'Fedora' {
$rubygem_katello = 'rubygem-katello'
} else {
$rubygem_katello = 'tfm-rubygem-katello'
}
$package_names = ['katello', $rubygem_katello]

$deployment_url = '/katello'

Expand Down
16 changes: 0 additions & 16 deletions spec/classes/katello_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,20 +16,4 @@
it { is_expected.to contain_package('katello').that_requires('Class[candlepin]') }
end
end

context 'on unsupported osfamily' do
let :facts do
{
:concat_basedir => '/tmp',
:hostname => 'localhost',
:operatingsystem => 'UNSUPPORTED OPERATINGSYSTEM',
:operatingsystemmajrelease => '1',
:operatingsystemrelease => '1',
:osfamily => 'UNSUPPORTED OSFAMILY',
:root_home => '/root'
}
end

it { expect { should contain_class('katello') }.to raise_error(Puppet::Error, /#{facts[:hostname]}: This module does not support osfamily #{facts[:osfamily]}/) }
end
end

0 comments on commit 1843231

Please sign in to comment.