]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr/dashboard: use orchestrator_cli to figure out the backend 26325/head
authorJeff Layton <jlayton@redhat.com>
Thu, 7 Feb 2019 18:00:38 +0000 (13:00 -0500)
committerJeff Layton <jlayton@redhat.com>
Tue, 12 Feb 2019 13:08:18 +0000 (08:08 -0500)
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 <jlayton@redhat.com>
src/pybind/mgr/dashboard/services/orchestrator.py
src/pybind/mgr/dashboard/settings.py

index 551dde9df39ff045771c9aa5d0e3fc9845c37774..d5774f5ff02a169720d1ecb9ef23fec6552eca43 100644 (file)
@@ -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)
index 86a2576d505133983a2e2d56b01a6743c7395391..eeeea64263df97bc0038d8409382dd67baed9e7d 100644 (file)
@@ -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)