From 1843231d8b9ef46610fb1e69a99225df317516b6 Mon Sep 17 00:00:00 2001 From: Ewoud Kohl van Wijngaarden Date: Wed, 12 Dec 2018 17:56:55 +0100 Subject: [PATCH] Simplify package name handling f614db22fdb78f67b2e778f1729512683de4a251 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. --- manifests/params.pp | 23 +++++------------------ spec/classes/katello_spec.rb | 16 ---------------- 2 files changed, 5 insertions(+), 34 deletions(-) diff --git a/manifests/params.pp b/manifests/params.pp index c32d0ded..cdf5872d 100644 --- a/manifests/params.pp +++ b/manifests/params.pp @@ -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' diff --git a/spec/classes/katello_spec.rb b/spec/classes/katello_spec.rb index 51c219e6..e42b0e41 100644 --- a/spec/classes/katello_spec.rb +++ b/spec/classes/katello_spec.rb @@ -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