tripleo-common/healthcheck/cron
Sorin Sbarnea 26a3d7e6d0 Fix bashate and flake8 errors
This change fixes few linting errors which are discovered by newer
linters.

- bashate: consistent 4 chars identation
- python unamed Exceptions
- python space around operators
- python space after # comments
- python unused imports
- python unknown escapes (errors after py36)
- python double newline before methods

Change-Id: I5d2f37d1c820b1983355be60c09de581a72e08e0
Needed-By: https://review.opendev.org/#/c/665445/
2019-06-14 19:23:53 +01:00

11 lines
191 B
Bash
Executable File

#!/bin/bash
file="${1:-root}"
if [ -f /var/spool/cron/${file} ]; then
nb_lines=$(grep -cEv '^#' /var/spool/cron/${file})
if [ $nb_lines -ge 2 ]; then
exit 0
fi
fi
exit 1