summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMonty Taylor <mordred@inaugust.com>2019-01-21 17:16:53 +0000
committerMonty Taylor <mordred@inaugust.com>2019-01-21 17:24:51 +0000
commit3b9e295a377a0e0c704803aedb18c6caedb2b4e6 (patch)
tree18d4d935a655dad25eeb5456ff20af126b1821de
parentf711df69789ca239260c80e506ef57eeccbf4b60 (diff)
Use find instead of ls for determining dir emptiness
ls foo/* isn't a great way to do this - but find, as is usually the case, solves all problems. Change-Id: Ic30b36ccee41e9b74e187eb3cdab0359f659a1c9
Notes
Notes (review): Code-Review+2: Clark Boylan <cboylan@sapwetik.org> Code-Review+2: Andreas Jaeger <jaegerandi@gmail.com> Workflow+1: Andreas Jaeger <jaegerandi@gmail.com> Code-Review+2: James E. Blair <corvus@inaugust.com> Code-Review+2: Jeremy Stanley <fungi@yuggoth.org> Verified+2: Monty Taylor <mordred@inaugust.com> Submitted-by: Monty Taylor <mordred@inaugust.com> Submitted-at: Mon, 21 Jan 2019 17:33:07 +0000 Reviewed-on: https://review.openstack.org/632136 Project: openstack-infra/zuul-jobs Branch: refs/heads/master
-rw-r--r--roles/merge-output-to-logs/tasks/main.yaml2
1 files changed, 1 insertions, 1 deletions
diff --git a/roles/merge-output-to-logs/tasks/main.yaml b/roles/merge-output-to-logs/tasks/main.yaml
index a4fe8eb..504c87a 100644
--- a/roles/merge-output-to-logs/tasks/main.yaml
+++ b/roles/merge-output-to-logs/tasks/main.yaml
@@ -2,7 +2,7 @@
2 when: zuul.change is defined 2 when: zuul.change is defined
3 delegate_to: localhost 3 delegate_to: localhost
4 shell: | 4 shell: |
5 if [ -n $(ls {{ zuul.executor.work_root }}/{{ item }}) ] ; then 5 if [ -n "$(find {{ zuul.executor.work_root }}/{{ item }} -mindepth 1)" ] ; then
6 # Only create target directory if it is needed. 6 # Only create target directory if it is needed.
7 # Do not fail if it is already there. 7 # Do not fail if it is already there.
8 mkdir -p {{ zuul.executor.log_root }}/{{ item }} 8 mkdir -p {{ zuul.executor.log_root }}/{{ item }}