From: Jeff Layton Date: Thu, 7 Feb 2019 18:00:38 +0000 (-0500) Subject: mgr/dashboard: use orchestrator_cli to figure out the backend X-Git-Tag: v14.1.0~132^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=2b836601451d67d8da0a10dbe439707bde9402a8;p=ceph.git 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 --- diff --git a/src/pybind/mgr/dashboard/services/orchestrator.py b/src/pybind/mgr/dashboard/services/orchestrator.py index 551dde9df39f..d5774f5ff02a 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 86a2576d5051..eeeea64263df 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)