File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -49,6 +49,12 @@ matrix:
4949 env : PUPPET_INSTALL_TYPE=agent BEAKER_IS_PE=no BEAKER_PUPPET_COLLECTION=puppet5 BEAKER_debug=true BEAKER_setfile=debian9-64{hypervisor=docker} CHECK=beaker
5050 services : docker
5151 sudo : required
52+ - rvm : 2.5.1
53+ bundler_args : --without development release
54+ dist : trusty
55+ env : PUPPET_INSTALL_TYPE=agent BEAKER_IS_PE=no BEAKER_PUPPET_COLLECTION=puppet5 BEAKER_debug=true BEAKER_setfile=centos7-64{hypervisor=docker} CHECK=beaker
56+ services : docker
57+ sudo : required
5258branches :
5359 only :
5460 - master
Original file line number Diff line number Diff line change 2828 ' Gentoo' => undef ,
2929 }
3030
31- $dev_ensure = $python::dev ? {
32- true => ' present' ,
33- false => ' absent' ,
34- default => $python::dev ,
35- }
36-
3731 $pip_ensure = $python::pip ? {
3832 true => ' present' ,
3933 false => ' absent' ,
4640 default => $python::virtualenv ,
4741 }
4842
43+ if ($venv_ensure == ' present' ) {
44+ $dev_ensure = ' present'
45+ if ! $python::dev {
46+ # Error: python2-devel is needed by (installed) python-virtualenv-15.1.0-2.el7.noarch
47+ # Python dev is required for virtual environment, but python environment is not required for python dev.
48+ notify { 'Python virtual environment is dependent on python dev' : }
49+ }
50+ } else {
51+ $dev_ensure = $python::dev ? {
52+ true => ' present' ,
53+ false => ' absent' ,
54+ default => $python::dev ,
55+ }
56+ }
57+
4958 package { 'python' :
5059 ensure => $python::ensure ,
5160 name => $python ,
96105 Package <| title == ' virtualenv' |> {
97106 name => ' virtualenv' ,
98107 provider => ' pip' ,
108+ require => Package[' python-dev' ]
99109 }
100110 }
101111 ' scl' : {
Original file line number Diff line number Diff line change 3131 end
3232 end
3333
34+ describe 'with python::virtualenv, without python::dev' do
35+ context 'true' do
36+ let ( :params ) { { dev : 'absent' , virtualenv : 'present' } }
37+ it { is_expected . to contain_package ( 'python-dev' ) . with_ensure ( 'present' ) }
38+ end
39+ context 'empty/default' do
40+ it { is_expected . to contain_package ( 'python-dev' ) . with_ensure ( 'absent' ) }
41+ end
42+ end
43+
3444 describe 'with manage_gunicorn' do
3545 context 'true' do
3646 let ( :params ) { { manage_gunicorn : true } }
You can’t perform that action at this time.
0 commit comments