Skip to content

Commit 0192bfe

Browse files
author
Graham Whaley
committed
metrics: report: fix subdir check in makereport
An early change slide in a stderr re-direct that broke the check in the good case as well. Fix that by moving the stderr redirect. Also, drop the chdir as it is not needed, and can fail in itself. Whilst here, improve the error message for when we do fail the dir check. Fixes: clearcontainers#776 Signed-off-by: Graham Whaley <graham.whaley@intel.com>
1 parent 6d3520f commit 0192bfe

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

metrics/report/makereport.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,9 @@ GUESTOUTPUTDIR="/outputdir/"
2424

2525
setup() {
2626
echo "Checking subdirectories"
27-
check_subdir="$(cd ${HOSTINPUTDIR}; ls -dx */ > /dev/null 2>&1 | wc -l)"
27+
check_subdir="$(ls -dx ${HOSTINPUTDIR}/*/ 2> /dev/null | wc -l)"
2828
if [ $check_subdir -eq 0 ]; then
29-
die "Subdirectory not found at metrics/results to store JSON results"
29+
die "No subdirs in [${HOSTINPUTDIR}] to read results from."
3030
fi
3131

3232
echo "Checking Dockerfile"

0 commit comments

Comments
 (0)