Showing with 37 additions and 1 deletion.
  1. +3 −0 manifests/install.pp
  2. +1 −1 metadata.json
  3. +33 −0 spec/classes/python_spec.rb
3 changes: 3 additions & 0 deletions manifests/install.pp
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down
2 changes: 1 addition & 1 deletion metadata.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "stankevich-python",
"version": "1.18.1",
"version": "1.18.2",
"author": "stankevich",
"summary": "Python Module",
"license": "Apache-2.0",
Expand Down
33 changes: 33 additions & 0 deletions spec/classes/python_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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")}

Expand Down Expand Up @@ -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
{
Expand Down