From 692489cc50c8025ede1646627a7a583a4feb3798 Mon Sep 17 00:00:00 2001 From: yayogev Date: Thu, 31 Aug 2017 16:45:23 +0300 Subject: 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 --- app/discover/scan.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'app/discover/scan.py') 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__': -- cgit 1.2.3-korg