Skip to content

Commit

Permalink
Allow rh-python36-python as a version
Browse files Browse the repository at this point in the history
  • Loading branch information
bodgit committed Apr 9, 2019
1 parent b83aa36 commit 5f6f76f
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 4 deletions.
4 changes: 2 additions & 2 deletions manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
# @example install python3 from scl repo
# class { 'python' :
# ensure => 'present',
# version => 'rh-python36',
# version => 'rh-python36-python',
# dev => 'present',
# virtualenv => 'present',
# }
Expand Down Expand Up @@ -64,7 +64,7 @@
}

unless $version =~ Pattern[/\A(python)?[0-9](\.[0-9])+/,
/\Apypy\Z/, /\Asystem\Z/, /\Arh-python[0-9]{2}\Z/] {
/\Apypy\Z/, /\Asystem\Z/, /\Arh-python[0-9]{2}(?:-python)?\Z/] {
fail("version needs to be pypy, system or a version string like '3.5' or 'python3.5)")
}

Expand Down
14 changes: 12 additions & 2 deletions spec/classes/python_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -249,9 +249,14 @@
describe 'with python::provider' do
context 'scl' do
describe 'with version' do
context '3.6 SCL package' do
context '3.6 SCL meta package' do
let(:params) { { version: 'rh-python36' } }

it { is_expected.to compile.with_all_deps }
end
context '3.6 SCL python package' do
let(:params) { { version: 'rh-python36-python' } }

it { is_expected.to compile.with_all_deps }
end
end
Expand Down Expand Up @@ -282,9 +287,14 @@
describe 'with python::provider' do
context 'scl' do
describe 'with version' do
context '3.6 SCL package' do
context '3.6 SCL meta package' do
let(:params) { { version: 'rh-python36' } }

it { is_expected.to compile.with_all_deps }
end
context '3.6 SCL python package' do
let(:params) { { version: 'rh-python36-python' } }

it { is_expected.to compile.with_all_deps }
end
end
Expand Down

0 comments on commit 5f6f76f

Please sign in to comment.