diff --git a/manifests/install.pp b/manifests/install.pp index 6d3cb7e3..972d646f 100644 --- a/manifests/install.pp +++ b/manifests/install.pp @@ -213,6 +213,9 @@ if $::python::version =~ /^3/ { $pip_category = undef $pip_package = 'python3-pip' + } elsif ($::osfamily == 'RedHat') and (versioncmp($::operatingsystemmajrelease, '7') >= 0) { + $pip_category = undef + $pip_package = 'python2-pip' } elsif $::osfamily == 'Gentoo' { $pip_category = 'dev-python' $pip_package = 'pip' diff --git a/spec/classes/python_spec.rb b/spec/classes/python_spec.rb index 9448fa6c..727447c6 100644 --- a/spec/classes/python_spec.rb +++ b/spec/classes/python_spec.rb @@ -138,6 +138,7 @@ it { is_expected.to contain_package("python") } it { is_expected.to contain_package("python-dev").with_name("python-devel") } it { is_expected.to contain_package("pip") } + it { is_expected.to contain_package("pip").with_name('python-pip') } # Basic python packages (from pip) it { is_expected.to contain_package("virtualenv")} @@ -217,6 +218,38 @@ end end + context "on a Redhat 6 OS" do + let :facts do + { + :id => 'root', + :kernel => 'Linux', + :osfamily => 'RedHat', + :operatingsystem => 'RedHat', + :operatingsystemmajrelease => '6', + :concat_basedir => '/dne', + :path => '/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin', + } + end + it { is_expected.to contain_class("python::install") } + it { is_expected.to contain_package("pip").with_name('python-pip') } + end + + context "on a Redhat 7 OS" do + let :facts do + { + :id => 'root', + :kernel => 'Linux', + :osfamily => 'RedHat', + :operatingsystem => 'RedHat', + :operatingsystemmajrelease => '7', + :concat_basedir => '/dne', + :path => '/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin', + } + end + it { is_expected.to contain_class("python::install") } + it { is_expected.to contain_package("pip").with_name('python2-pip') } + end + context "on a SLES 11 SP3" do let :facts do {