summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--jjb/ci_gate_security/anteater-report-to-gerrit.sh13
1 files changed, 8 insertions, 5 deletions
diff --git a/jjb/ci_gate_security/anteater-report-to-gerrit.sh b/jjb/ci_gate_security/anteater-report-to-gerrit.sh
index de1fdd745..6710862a7 100644
--- a/jjb/ci_gate_security/anteater-report-to-gerrit.sh
+++ b/jjb/ci_gate_security/anteater-report-to-gerrit.sh
@@ -15,11 +15,14 @@ if [[ -e securityaudit.log ]] ; then
grep 'ERROR' securityaudit.log | awk -F"ERROR - " '{ print $2 }' | tr -d "\'\"" > shortlog
- ssh -p 29418 gerrit.opnfv.org \
- "gerrit review -p $GERRIT_PROJECT \
- -m \"$(cat shortlog)\" \
- $GERRIT_PATCHSET_REVISION \
- --notify NONE"
+ # Only report to Gerrit when there are errors to report.
+ if [[ -s shortlog ]]; then
+ ssh -p 29418 gerrit.opnfv.org \
+ "gerrit review -p $GERRIT_PROJECT \
+ -m \"$(cat shortlog)\" \
+ $GERRIT_PATCHSET_REVISION \
+ --notify NONE"
+ fi
exit $EXITSTATUS
fi