From 2b836601451d67d8da0a10dbe439707bde9402a8 Mon Sep 17 00:00:00 2001 From: Jeff Layton Date: Thu, 7 Feb 2019 13:00:38 -0500 Subject: [PATCH] mgr/dashboard: use orchestrator_cli to figure out the backend Currently the dashboard has its own setting for the orchestrator backend, which means that one has to set it in both the dashboard and the orchestrator_cli module if you intend to use both. Change the dashboard code to use the setting in the orchestrator_cli module, and eliminate the dashboard-specific setting. Signed-off-by: Jeff Layton --- src/pybind/mgr/dashboard/services/orchestrator.py | 10 +++++----- src/pybind/mgr/dashboard/settings.py | 3 --- 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/src/pybind/mgr/dashboard/services/orchestrator.py b/src/pybind/mgr/dashboard/services/orchestrator.py index 551dde9df39..d5774f5ff02 100644 --- a/src/pybind/mgr/dashboard/services/orchestrator.py +++ b/src/pybind/mgr/dashboard/services/orchestrator.py @@ -4,7 +4,6 @@ from __future__ import absolute_import import time from .. import mgr, logger -from ..settings import Settings class NoOrchesrtatorConfiguredException(Exception): @@ -21,10 +20,10 @@ class OrchClient(object): return cls._instance def _call(self, method, *args, **kwargs): - if not Settings.ORCHESTRATOR_BACKEND: + _backend = mgr.get_module_option_ex("orchestrator_cli", "orchestrator") + if not _backend: raise NoOrchesrtatorConfiguredException() - return mgr.remote(Settings.ORCHESTRATOR_BACKEND, method, *args, - **kwargs) + return mgr.remote(_backend, method, *args, **kwargs) def _wait(self, completions): while not self._call("wait", completions): @@ -39,7 +38,8 @@ class OrchClient(object): return completion.result def available(self): - if not Settings.ORCHESTRATOR_BACKEND: + _backend = mgr.get_module_option_ex("orchestrator_cli", "orchestrator") + if not _backend: return False status, desc = self._call("available") logger.info("[ORCH] is orchestrator available: %s, %s", status, desc) diff --git a/src/pybind/mgr/dashboard/settings.py b/src/pybind/mgr/dashboard/settings.py index 86a2576d505..eeeea64263d 100644 --- a/src/pybind/mgr/dashboard/settings.py +++ b/src/pybind/mgr/dashboard/settings.py @@ -43,9 +43,6 @@ class Options(object): # NFS Ganesha settings GANESHA_CLUSTERS_RADOS_POOL_NAMESPACE = ('', str) - # Orchestrator settings - ORCHESTRATOR_BACKEND = ('', str) - # Prometheus settings PROMETHEUS_API_HOST = ('', str) # Not in use ATM ALERTMANAGER_API_HOST = ('', str) -- 2.47.3