]> git.apps.os.sepia.ceph.com Git - ceph-build.git/commitdiff
multiple: Use --no-run-if-empty flag with `xargs dirname` 1520/head
authorDavid Galloway <dgallowa@redhat.com>
Tue, 10 Mar 2020 19:27:23 +0000 (15:27 -0400)
committerDavid Galloway <dgallowa@redhat.com>
Tue, 10 Mar 2020 19:27:23 +0000 (15:27 -0400)
I was seeing `dirname: missing operand` when there was no output from the `find | grep`

We want the output to just be empty instead of throwing an error

Signed-off-by: David Galloway <dgallowa@redhat.com>
ceph-ansible-prs/build/build
ceph-container-nighlity/build/teardown
ceph-container-prs/build/teardown
ceph-volume-nightly/build/teardown
scripts/build_utils.sh

index a2745e4bba6fae5626c338188fe10570a6086829..6086d586edec9b73ecdc8df64a7f424a4d5ae3dc 100644 (file)
@@ -18,7 +18,7 @@ update_vagrant_boxes
 # crashes before teardown is executed, it means we keep leftofver from previous build.
 # We ensure before the test is launched that no fetch directory from previous build is present.
 pushd $WORKSPACE/tests
-scenarios=$(find . -name Vagrantfile | xargs dirname)
+scenarios=$(find . -name Vagrantfile | xargs -r dirname)
 for scenario in $scenarios; do
   pushd $scenario
   rm -rf fetch/
index 5790664af45ac7df20337be27b611f143e45a609..7fcc4e7c41d3351c8cf6eb9006663182455be62c 100644 (file)
@@ -4,7 +4,7 @@
 
 cd $WORKSPACE/ceph-ansible/tests/functional
 
-scenarios=$(find . | grep Vagrantfile | xargs dirname)
+scenarios=$(find . | grep Vagrantfile | xargs -r dirname)
 
 for scenario in $scenarios; do
     cd $scenario
index 5790664af45ac7df20337be27b611f143e45a609..7fcc4e7c41d3351c8cf6eb9006663182455be62c 100644 (file)
@@ -4,7 +4,7 @@
 
 cd $WORKSPACE/ceph-ansible/tests/functional
 
-scenarios=$(find . | grep Vagrantfile | xargs dirname)
+scenarios=$(find . | grep Vagrantfile | xargs -r dirname)
 
 for scenario in $scenarios; do
     cd $scenario
index ce026872d4ecd140f4549482a11948f476beb69d..d4518338b745ada571a4c1c208975c25b7bf645d 100644 (file)
@@ -5,7 +5,7 @@
 
 cd $WORKSPACE/src/ceph-volume/ceph_volume/tests/functional
 
-scenarios=$(find . | grep vagrant_ssh_config | xargs dirname)
+scenarios=$(find . | grep vagrant_ssh_config | xargs -r dirname)
 
 # the method exists in scripts/build_utils.sh
 teardown_vagrant_tests
index e4d80c4768db66600a4626edbcdee944e3ece39a..e631757f35d4d554c2a61e2a86419a85b48fff2b 100644 (file)
@@ -985,7 +985,7 @@ collect_ceph_logs() {
 teardown_vagrant_tests() {
     # collect ceph logs and teardown any running vagrant vms
     # this also cleans up any lingering livirt networks
-    scenarios=$(find . | grep vagrant_ssh_config | xargs dirname)
+    scenarios=$(find . | grep vagrant_ssh_config | xargs -r dirname)
 
     for scenario in $scenarios; do
         cd $scenario