Fix filehash error handling
@@ -101,11 +101,14 @@ class Module():
# Then we get an aggregation of all md5 alarmed within the last 'interval' time
self.logger.debug('Running query %s' % alarmed_md5_q)
omd5 = rawSearch(alarmed_md5_q, index='rtops-*')
- self.logger.debug(omd5['aggregations'])
already_checked = []
already_alarmed = []
+ # Only if we have results
+ if omd5:
+ self.logger.debug(omd5['aggregations'])
+
# add md5 hashes that have been checked within the 'interval' in 'already_checked'
for h in omd5['aggregations']['interval_filter']['md5_interval']['buckets']:
already_checked.append(h['key'])
