Move Audit-template management in DefaultStrategyContext
This aim of this patchset is to move the management of the Audit-Template into StrategyContext in order to prepare to pass parameters to strategies but also to prepare to add more dynamic Actions management Partially implements: blueprint glossary-related-refactoring Change-Id: I13ee063da947113ce349855aa331a22f40567051
This commit is contained in:
@@ -21,8 +21,6 @@ from concurrent.futures import ThreadPoolExecutor
|
||||
from oslo_log import log
|
||||
|
||||
from watcher.decision_engine.audit.default import DefaultAuditHandler
|
||||
from watcher.metrics_engine.cluster_model_collector.manager import \
|
||||
CollectorManager
|
||||
|
||||
LOG = log.getLogger(__name__)
|
||||
|
||||
@@ -30,13 +28,8 @@ LOG = log.getLogger(__name__)
|
||||
class AuditEndpoint(object):
|
||||
def __init__(self, messaging, max_workers):
|
||||
self._messaging = messaging
|
||||
self._collector_manager = CollectorManager()
|
||||
self._executor = ThreadPoolExecutor(max_workers=max_workers)
|
||||
|
||||
@property
|
||||
def collector_manager(self):
|
||||
return self._collector_manager
|
||||
|
||||
@property
|
||||
def executor(self):
|
||||
return self._executor
|
||||
@@ -46,9 +39,7 @@ class AuditEndpoint(object):
|
||||
return self._messaging
|
||||
|
||||
def do_trigger_audit(self, context, audit_uuid):
|
||||
model_collector = self.collector_manager.get_cluster_model_collector()
|
||||
|
||||
audit = DefaultAuditHandler(self.messaging, model_collector)
|
||||
audit = DefaultAuditHandler(self.messaging)
|
||||
audit.execute(audit_uuid, context)
|
||||
|
||||
def trigger_audit(self, context, audit_uuid):
|
||||
|
||||
Reference in New Issue
Block a user