summaryrefslogtreecommitdiffstats
path: root/app/discover/scan.py
diff options
context:
space:
mode:
authorKoren Lev <korenlev@gmail.com>2017-10-24 13:35:42 +0300
committerKoren Lev <korenlev@gmail.com>2017-10-24 13:35:42 +0300
commit7cba26258ea17f790028a7005cb9bbbdc3923389 (patch)
tree603f9b7bd2fa6226f99fde9bfa1526f172fef154 /app/discover/scan.py
parente2240ef940939a6c0cc30ca6370aae0d42c5a4af (diff)
several bug fixes for release 1.1
Change-Id: I433d41245107a68959efdcd6b56ce3348c7bbeb5 Signed-off-by: Koren Lev <korenlev@gmail.com>
Diffstat (limited to 'app/discover/scan.py')
-rwxr-xr-xapp/discover/scan.py13
1 files changed, 10 insertions, 3 deletions
diff --git a/app/discover/scan.py b/app/discover/scan.py
index 6c40a7f..49f37ff 100755
--- a/app/discover/scan.py
+++ b/app/discover/scan.py
@@ -319,13 +319,20 @@ class ScanController(Fetcher):
SshConnection.disconnect_all()
status = 'ok' if not scanner.found_errors.get(env_name, False) \
else 'errors detected'
+ if status == 'ok' and scan_plan.object_type == "environment":
+ self.mark_env_scanned(scan_plan.env)
self.log.info('Scan completed, status: {}'.format(status))
return True, status
+ def mark_env_scanned(self, env):
+ environments_collection = self.inv.collection['environments_config']
+ environments_collection \
+ .update_one(filter={'name': env},
+ update={'$set': {'scanned': True}})
if __name__ == '__main__':
- scan_manager = ScanController()
- ret, msg = scan_manager.run()
+ scan_controller = ScanController()
+ ret, msg = scan_controller.run()
if not ret:
- scan_manager.log.error(msg)
+ scan_controller.log.error(msg)
sys.exit(0 if ret else 1)