diff options
author | Michael Boelen <michael.boelen@cisofy.com> | 2017-08-17 21:10:51 +0300 |
---|---|---|
committer | Michael Boelen <michael.boelen@cisofy.com> | 2017-08-17 21:10:51 +0300 |
commit | c0a6aaf855f5994605d46d8d2b5def5d194bec2b (patch) | |
tree | e438abc9095ae0b992376ca24aae23b5b9381b07 /include/tests_tooling | |
parent | 0caf42bc5163e70bba0c78758697dbba36d70dce (diff) |
[TOOL-5002] performance enhancement to reduce number of dirs/files to check
Diffstat (limited to 'include/tests_tooling')
-rw-r--r-- | include/tests_tooling | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/include/tests_tooling b/include/tests_tooling index 26eee608..64debcde 100644 --- a/include/tests_tooling +++ b/include/tests_tooling @@ -54,10 +54,13 @@ # Ansible FOUND=0 - LIST="~/.ansible ~/.ansible-retry ${ROOTDIR}etc/ansible ${ROOTDIR}root/.ansible ${ROOTDIR}tmp/.ansible" - for ITEM in ${LIST}; do if DirectoryExists ${ITEM}; then FOUND=1; fi; done - LIST="${ROOTDIR}var/log/ansible.log" - for ITEM in ${LIST}; do if FileExists ${ITEM}; then FOUND=1; fi; done + LIST="~/.ansible ${ROOTDIR}etc/ansible ${ROOTDIR}root/.ansible ${ROOTDIR}tmp/.ansible" + for ITEM in ${LIST}; do if DirectoryExists ${ITEM}; then FOUND=1; break; fi; done + # Test for files (only if no match was found) + if [ ${FOUND} -eq 0 ]; then + LIST="${ROOTDIR}var/log/ansible.log ~/.ansible-retry" + for ITEM in ${LIST}; do if FileExists ${ITEM}; then FOUND=1; break; fi; done + fi if [ ${FOUND} -eq 1 ]; then LogText "Result: found a possible trace of Ansible" |