From d3f315fba6490b8b72d72df97c99730765d427b3 Mon Sep 17 00:00:00 2001 From: Michael Konietzny Date: Thu, 8 Sep 2016 17:32:45 +0200 Subject: [PATCH] init.pp * fixed bug with puppet 3.8.7/--parser future by using a qualified path name for scl Error: Validation of Exec[python_requirements_initial_install_...] failed: 'scl enable rh-python34 -- ...' is not qualified and no path was specified. Please qualify the command or specify a path. at /tmp/vagrant-puppet/.../python/manifests/virtualenv.pp:173 install.pp * added virtualenv specific package for rhscl virtualenv.pp * fixed version not prepended with "python" - will fail for rhscl (version = "rh-python34" for example) --- manifests/init.pp | 4 ++-- manifests/install.pp | 20 +++++++++++--------- manifests/virtualenv.pp | 2 +- 3 files changed, 14 insertions(+), 12 deletions(-) diff --git a/manifests/init.pp b/manifests/init.pp index 26826a4b..c0aa6f23 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -91,8 +91,8 @@ } $exec_prefix = $provider ? { - 'scl' => "scl enable ${version} -- ", - 'rhscl' => "scl enable ${version} -- ", + 'scl' => "/usr/bin/scl enable ${version} -- ", + 'rhscl' => "/usr/bin/scl enable ${version} -- ", default => '', } diff --git a/manifests/install.pp b/manifests/install.pp index 2cd3df45..1e144b0c 100644 --- a/manifests/install.pp +++ b/manifests/install.pp @@ -50,7 +50,7 @@ name => $python, } - package { 'virtualenv': + package { "virtualenv": ensure => $venv_ensure, require => Package['python'], } @@ -140,9 +140,14 @@ provider => 'rpm', tag => 'python-scl-repo', } - Package <| title == 'python' |> { + } + + Package <| title == 'python' |> { tag => 'python-scl-package', } + + Package <| title == 'virtualenv' |> { + name => "${python}-python-virtualenv", } package { "${python}-scldevel": @@ -150,12 +155,9 @@ tag => 'python-scl-package', } - if $pip_ensure != 'absent' { - exec { 'python-scl-pip-install': - command => "${python::exec_prefix}easy_install pip", - path => ['/usr/bin', '/bin'], - creates => "/opt/rh/${python::version}/root/usr/bin/pip", - } + package { "${python}-python-pip": + ensure => $pip_ensure, + tag => 'python-pip-package', } if $::python::rhscl_use_public_repository { @@ -164,7 +166,7 @@ } Package <| tag == 'python-scl-package' |> -> - Exec['python-scl-pip-install'] + Package <| tag == 'python-pip-package' |> } default: { diff --git a/manifests/virtualenv.pp b/manifests/virtualenv.pp index 459b3399..dc12dec3 100644 --- a/manifests/virtualenv.pp +++ b/manifests/virtualenv.pp @@ -93,7 +93,7 @@ $python = $version ? { 'system' => 'python', 'pypy' => 'pypy', - default => "python${version}", + default => "${version}", } if $virtualenv == undef {