From 1c2aca510f495834a9b39a78a99018a761669b20 Mon Sep 17 00:00:00 2001 From: "James E. Blair" Date: Wed, 31 May 2017 14:17:57 -0700 Subject: [PATCH] Add initial py3 support (with pip3) Support using pip3 binary to install python applications under python3. Change-Id: I943e5cbcc55a09edb9431298e3f0a17e2aef5acf Signed-off-by: Paul Belanger --- manifests/init.pp | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/manifests/init.pp b/manifests/init.pp index ff6636e..7f2aae5 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -64,10 +64,20 @@ class zuul ( $sites = [], $nodes = [], $connections = [], + $python_version = 2, ) { include ::httpd include ::pip + if ($python_version == 3) { + include ::pip::python3 + $pip_provider = pip3 + $pip_command = 'pip3' + } else { + $pip_provider = openstack_pip + $pip_command = 'pip' + } + $packages = [ 'python-paste', 'python-webob', @@ -86,7 +96,7 @@ class zuul ( package { 'yappi': ensure => present, - provider => openstack_pip, + provider => $pip_provider, require => Class['pip'], } @@ -145,7 +155,7 @@ class zuul ( } exec { 'install_zuul' : - command => 'pip install -U /opt/zuul', + command => "${pip_command} install -U /opt/zuul", path => '/usr/local/bin:/usr/bin:/bin/', refreshonly => true, subscribe => Vcsrepo['/opt/zuul'],