Showing with 16 additions and 10 deletions.
  1. +2 −2 manifests/install.pp
  2. +6 −2 manifests/virtualenv.pp
  3. +1 −1 metadata.json
  4. +3 −1 tests/gunicorn.pp
  5. +4 −4 tests/pyvenv.pp
4 changes: 2 additions & 2 deletions manifests/install.pp
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
$python = $::python::version ? {
'system' => 'python',
'pypy' => 'pypy',
default => $python::version,
default => "python${python::version}",
}

$pythondev = $::osfamily ? {
Expand Down Expand Up @@ -71,7 +71,7 @@
# Install pip without pip, see https://pip.pypa.io/en/stable/installing/.
exec { 'bootstrap pip':
command => '/usr/bin/curl https://bootstrap.pypa.io/get-pip.py | python',
unless => '/usr/bin/which pip',
creates => '/usr/local/bin/pip',
require => Package['python'],
}

Expand Down
8 changes: 6 additions & 2 deletions manifests/virtualenv.pp
Original file line number Diff line number Diff line change
Expand Up @@ -116,9 +116,13 @@
# --system-site-packages flag, default off for prior versions
# Prior to version 1.7 the default was equal to --system-site-packages
# and the flag --no-site-packages had to be passed to do the opposite
if (( versioncmp("${::virtualenv_version}",'1.7') > 0 ) and ( $systempkgs == true )) { # lint:ignore:only_variable_string
$_virtualenv_version = getvar('virtualenv_version') ? {
/.*/ => getvar('virtualenv_version'),
default => '',
}
if (( versioncmp($_virtualenv_version,'1.7') > 0 ) and ( $systempkgs == true )) {
$system_pkgs_flag = '--system-site-packages'
} elsif (( versioncmp("${::virtualenv_version}",'1.7') < 0 ) and ( $systempkgs == false )) { # lint:ignore:only_variable_string
} elsif (( versioncmp($_virtualenv_version,'1.7') < 0 ) and ( $systempkgs == false )) {
$system_pkgs_flag = '--no-site-packages'
} else {
$system_pkgs_flag = $systempkgs ? {
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.11.0",
"version": "1.12.0",
"author": "stankevich",
"summary": "Python Module",
"license": "Apache-2.0",
Expand Down
4 changes: 3 additions & 1 deletion tests/gunicorn.pp
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@
bind => 'unix:/tmp/gunicorn.socket',
environment => 'prod',
appmodule => 'app:app',
osenv => { 'DBHOST' => 'dbserver.example.com' },
osenv => {
'DBHOST' => 'dbserver.example.com'
},
timeout => 30,
template => 'python/gunicorn.erb',
}
8 changes: 4 additions & 4 deletions tests/pyvenv.pp
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
version => '3',
}

python::pyvenv { "/opt/uwsgi":
python::pyvenv { '/opt/uwsgi':
}

python::pip { "uwsgi":
ensure => "latest",
virtualenv => "/opt/uwsgi"
python::pip { 'uwsgi':
ensure => 'latest',
virtualenv => '/opt/uwsgi'
}