diff options
author | yayogev <yaronyogev@gmail.com> | 2017-08-31 16:45:23 +0300 |
---|---|---|
committer | yayogev <yaronyogev@gmail.com> | 2017-08-31 16:45:23 +0300 |
commit | 692489cc50c8025ede1646627a7a583a4feb3798 (patch) | |
tree | 531a2f2928ba8c9067265fa0c872cc6f016876b8 /app/discover/scan.py | |
parent | bc3767bad9f9f9cfb3f3f2c8871a81603e650df0 (diff) |
US2876 handle SSH errors
ido not stop, but report as 'completed with errors'
if there were any errors in SSH calls
Change-Id: Ice7e6c4324686adc2d9eec27a9b6187f0fe6808f
Signed-off-by: yayogev <yaronyogev@gmail.com>
Diffstat (limited to 'app/discover/scan.py')
-rwxr-xr-x | app/discover/scan.py | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/app/discover/scan.py b/app/discover/scan.py index 72184ec..86ee990 100755 --- a/app/discover/scan.py +++ b/app/discover/scan.py @@ -274,6 +274,7 @@ class ScanController(Fetcher): # generate ScanObject Class and instance. scanner = Scanner() scanner.set_env(env_name) + scanner.found_errors[env_name] = False # decide what scanning operations to do inventory_only = scan_plan.inventory_only @@ -313,7 +314,10 @@ class ScanController(Fetcher): except ScanError as e: return False, "scan error: " + str(e) SshConnection.disconnect_all() - return True, 'ok' + status = 'ok' if not scanner.found_errors.get(env_name, False) \ + else 'errors detected' + self.log.info('Scan completed, status: {}'.format(status)) + return True, status if __name__ == '__main__': |