add get_check_by_id to base registry
+import importlib
import logging
-import sys
import os
-import importlib
+import sys
from abc import abstractmethod
@@ -18,6 +18,14 @@ class BaseCheckRegistry(object):
self.checks[entity] = []
self.checks[entity].append(check)
+ def get_check_by_id(self, check_id):
+ for resource_type in self.checks.keys():
+ resource_type_checks = self.checks[resource_type]
+ for check in resource_type_checks:
+ if check_id == check.id:
+ return check
+ return None
+
def get_checks(self, entity):
if entity in self.checks.keys():
return self.checks[entity]
