summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeremy Stanley <fungi@yuggoth.org>2017-12-12 00:58:20 +0000
committerJeremy Stanley <fungi@yuggoth.org>2017-12-12 17:06:12 +0000
commite02cfe94a364b9aa880d026c8e9089fe4ffb2829 (patch)
treeef9dc9204920b1000ae47573c2a102796d59a12e
parente2743a3529f04f7ee088f41dad75a4994a0be259 (diff)
Don't hardcode the path to pip
In at least some circumstances, our pip is installed into /usr/local/bin to make sure that's added to the environment and switch to dynamic path resolution when calling pip. Change-Id: I4e53ce2aba1b8335025e180bd03a5f5e93461814
Notes
Notes (review): Code-Review+2: Paul Belanger <pabelanger@redhat.com> Code-Review+2: Ian Wienand <iwienand@redhat.com> Workflow+1: Ian Wienand <iwienand@redhat.com> Verified+2: Zuul Submitted-by: Zuul Submitted-at: Tue, 12 Dec 2017 20:48:55 +0000 Reviewed-on: https://review.openstack.org/527280 Project: openstack-infra/puppet-subunit2sql Branch: refs/heads/master
-rw-r--r--manifests/init.pp5
1 files changed, 3 insertions, 2 deletions
diff --git a/manifests/init.pp b/manifests/init.pp
index 50e45f5..fdf2666 100644
--- a/manifests/init.pp
+++ b/manifests/init.pp
@@ -38,7 +38,8 @@ class subunit2sql (
38 } 38 }
39 39
40 exec { 'install-subunit2sql-safely': 40 exec { 'install-subunit2sql-safely':
41 command => '/usr/bin/pip install --upgrade --upgrade-strategy=only-if-needed subunit2sql', 41 command => 'pip install --upgrade --upgrade-strategy=only-if-needed subunit2sql',
42 path => '/usr/local/bin:/usr/bin:/bin/',
42 # This checks the current installed subunit2sql version with pip list and 43 # This checks the current installed subunit2sql version with pip list and
43 # the latest version of subunit2sql on pypi with pip search and if they are 44 # the latest version of subunit2sql on pypi with pip search and if they are
44 # different then we know we need to upgrade to reconcile the local version 45 # different then we know we need to upgrade to reconcile the local version
@@ -49,7 +50,7 @@ class subunit2sql (
49 # deps we've preinstalled from system packages because they lack wheels on 50 # deps we've preinstalled from system packages because they lack wheels on
50 # PyPI and must be otherwise rebuilt from sdist instead (specifically 51 # PyPI and must be otherwise rebuilt from sdist instead (specifically
51 # netifaces). 52 # netifaces).
52 onlyif => '/bin/bash -c "test $(/usr/bin/pip list --format columns | sed -ne \'s/^subunit2sql\s\+\(.*\)$/\1/p\') != $(/usr/bin/pip search \'subunit2sql$\' | sed -ne \'s/^subunit2sql (\(.*\)).*$/\1/p\')"', 53 onlyif => '/bin/bash -c "test $(pip list --format columns | sed -ne \'s/^subunit2sql\s\+\(.*\)$/\1/p\') != $(pip search \'subunit2sql$\' | sed -ne \'s/^subunit2sql (\(.*\)).*$/\1/p\')"',
53 require => [ 54 require => [
54 Class['pip'], 55 Class['pip'],
55 Package['python-mysqldb'], 56 Package['python-mysqldb'],