Merge "Allow for global datasources preference from config"

This commit is contained in:
Zuul
2019-05-10 06:03:59 +00:00
committed by Gerrit Code Review
30 changed files with 234 additions and 126 deletions

View File

@@ -285,8 +285,15 @@ The following code snippet shows how datasource_backend is defined:
@property
def datasource_backend(self):
if not self._datasource_backend:
# Load the global preferred datasources order but override it
# if the strategy has a specific datasources config
datasources = CONF.watcher_datasources
if self.config.datasources:
datasources = self.config
self._datasource_backend = ds_manager.DataSourceManager(
config=self.config,
config=datasources,
osc=self.osc
).get_backend(self.DATASOURCE_METRICS)
return self._datasource_backend