Browse Source

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
changes/80/527280/2
Jeremy Stanley 1 year ago
parent
commit
e02cfe94a3
1 changed files with 3 additions and 2 deletions
  1. 3
    2
      manifests/init.pp

+ 3
- 2
manifests/init.pp View File

@@ -38,7 +38,8 @@ class subunit2sql (
38 38
   }
39 39
 
40 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 43
     # This checks the current installed subunit2sql version with pip list and
43 44
     # the latest version of subunit2sql on pypi with pip search and if they are
44 45
     # different then we know we need to upgrade to reconcile the local version
@@ -49,7 +50,7 @@ class subunit2sql (
49 50
     # deps we've preinstalled from system packages because they lack wheels on
50 51
     # PyPI and must be otherwise rebuilt from sdist instead (specifically
51 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 54
     require => [
54 55
       Class['pip'],
55 56
       Package['python-mysqldb'],

Loading…
Cancel
Save