]> git.apps.os.sepia.ceph.com Git - ceph-build.git/commitdiff
scripts/build_utils: use "test" to test existence of a directory
authorKefu Chai <kchai@redhat.com>
Sat, 31 Jul 2021 06:09:02 +0000 (14:09 +0800)
committerKefu Chai <kchai@redhat.com>
Sat, 31 Jul 2021 06:12:53 +0000 (14:12 +0800)
otherwise we have scaring error message like:

++ ls -A /tmp/venv.flkiJIs23q
ls: cannot access '/tmp/venv.flkiJIs23q': No such file or directory
+

in build log of job of ceph-dev-new-build

Signed-off-by: Kefu Chai <kchai@redhat.com>
scripts/build_utils.sh

index 5b416cd513b19d0376642d519ac44da510795da0..5eb7c51ad21d0179a68b3de2f7edc5574a16b2fb 100644 (file)
@@ -99,7 +99,7 @@ pip_download() {
 
 create_virtualenv () {
     local path=$1
-    if [ "$(ls -A $path)" ]; then
+    if [ -d $path ]; then
         echo "Will reuse existing virtual env: $path"
     else
         if [ $(command -v python3) ]; then