Skip to content

Commit d576620

Browse files
Zuulopenstack-gerrit
authored andcommitted
Merge "Convert to safe name in lib_installed_from_git"
2 parents b3a7125 + 007f588 commit d576620

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

inc/python

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -406,6 +406,9 @@ function use_library_from_git {
406406
# determine if a package was installed from git
407407
function lib_installed_from_git {
408408
local name=$1
409+
local safe_name
410+
safe_name=$(python -c "from pkg_resources import safe_name; \
411+
print(safe_name('${name}'))")
409412
# Note "pip freeze" doesn't always work here, because it tries to
410413
# be smart about finding the remote of the git repo the package
411414
# was installed from. This doesn't work with zuul which clones
@@ -419,7 +422,7 @@ function lib_installed_from_git {
419422
# bashate 0.5.2.dev19 /tmp/env/src/bashate
420423
# Thus we check the third column to see if we're installed from
421424
# some local place.
422-
[[ -n $(pip list --format=columns 2>/dev/null | awk "/^$name/ {print \$3}") ]]
425+
[[ -n $(pip list --format=columns 2>/dev/null | awk "/^$safe_name/ {print \$3}") ]]
423426
}
424427

425428
# check that everything that's in LIBS_FROM_GIT was actually installed

0 commit comments

Comments
 (0)