summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIan Wienand <iwienand@redhat.com>2017-09-29 10:16:47 +1000
committerMatt Riedemann <mriedem.os@gmail.com>2017-10-02 11:10:35 -0400
commit386aefe441cdcdedb566dc014c6abd5f7dd16c97 (patch)
tree5f528103d93c55a6630bf9ca724ff32e6abbd646
parentd577fd5bd5be9f4fcda66b5e607efb788ef1c290 (diff)
Use "pip list" in check_libs_from_gitstable/newton
As described in the change, "pip freeze" has issues with the way zuulv3 clones repos without a remote. This is an attempt to use "pip list" to check for local install Change-Id: I33d25f86b6afcadb4b190a0f6c53311111c64521 (cherry picked from commit ae9c6ab759d9dc1c7e72159092539444ca03cf33) (cherry picked from commit 4358418d7d20a18667801105eb246199036e9d57) (cherry picked from commit 8cb43d098ca88ce57ec216423c009cccd07f1299)
Notes
Notes (review): Code-Review+2: Sean Dague <sean@dague.net> Workflow+1: Sean Dague <sean@dague.net> Verified+1: IBM PowerKVM CI <kvmpower@linux.vnet.ibm.com> Verified+1: Zuul Verified+2: Jenkins Submitted-by: Jenkins Submitted-at: Thu, 05 Oct 2017 02:57:26 +0000 Reviewed-on: https://review.openstack.org/508908 Project: openstack-dev/devstack Branch: refs/heads/stable/newton
-rw-r--r--inc/python15
1 files changed, 14 insertions, 1 deletions
diff --git a/inc/python b/inc/python
index 1f2d3df..3222a03 100644
--- a/inc/python
+++ b/inc/python
@@ -203,7 +203,20 @@ function use_library_from_git {
203# determine if a package was installed from git 203# determine if a package was installed from git
204function lib_installed_from_git { 204function lib_installed_from_git {
205 local name=$1 205 local name=$1
206 pip freeze 2>/dev/null | grep -- "$name" | grep -q -- '-e git' 206 # Note "pip freeze" doesn't always work here, because it tries to
207 # be smart about finding the remote of the git repo the package
208 # was installed from. This doesn't work with zuul which clones
209 # repos with no remote.
210 #
211 # The best option seems to be to use "pip list" which will tell
212 # you the path an editable install was installed from; for example
213 # in response to something like
214 # pip install -e 'git+http://git.openstack.org/openstack-dev/bashate#egg=bashate'
215 # pip list shows
216 # bashate (0.5.2.dev19, /tmp/env/src/bashate)
217 # Thus we look for "path after a comma" to indicate we were
218 # installed from some local place
219 pip list 2>/dev/null | grep -- "$name" | grep -q -- ', .*)$'
207} 220}
208 221
209# check that everything that's in LIBS_FROM_GIT was actually installed 222# check that everything that's in LIBS_FROM_GIT was actually installed