Skip to content

Commit

Permalink
Set default python to 3
Browse files Browse the repository at this point in the history
  • Loading branch information
bastelfreak committed Dec 15, 2020
1 parent c0e9c26 commit da2b6b5
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 13 deletions.
2 changes: 1 addition & 1 deletion REFERENCE.md
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ Allowed values:
- 3/3.3/... means you are going to install the python3/python3.3/...
package, if available on your osfamily.

Default value: `$python::params::version`
Default value: `'3'`

##### `pip`

Expand Down
2 changes: 1 addition & 1 deletion manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
#
class python (
Python::Package::Ensure $ensure = $python::params::ensure,
Python::Version $version = $python::params::version,
Python::Version $version = '3',
Python::Package::Ensure $pip = $python::params::pip,
Python::Package::Ensure $dev = $python::params::dev,
Python::Package::Ensure $gunicorn = $python::params::gunicorn,
Expand Down
8 changes: 0 additions & 8 deletions manifests/params.pp
Original file line number Diff line number Diff line change
Expand Up @@ -45,12 +45,4 @@
'RedHat' => 'python-gunicorn',
default => 'gunicorn',
}

if $facts['os']['family'] == 'RedHat' and $facts['os']['release']['major'] == '8' {
$version = '3'
} elsif $facts['os']['release']['major'] == '20.04' {
$version = '3'
} else {
$version = 'system'
}
}
2 changes: 1 addition & 1 deletion spec/acceptance/pyvenv_spec.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
require 'spec_helper_acceptance'

describe 'python::pyvenv defined resource' do
describe 'python::pyvenv defined resource with python 3' do
context 'minimal parameters' do
# Using puppet_apply as a helper
it 'works with no errors' do
Expand Down
4 changes: 2 additions & 2 deletions spec/classes/python_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -216,8 +216,8 @@
it { is_expected.to contain_class('python::install') }
# Base Suse packages.
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('python-dev').with_alias('python-devel') }
it { is_expected.to contain_package('python-dev').with_name('python3-devel') }
it { is_expected.to contain_package('python-dev').with_alias('python3-devel') }
it { is_expected.to contain_package('pip') }

describe 'with python::dev' do
Expand Down

0 comments on commit da2b6b5

Please sign in to comment.