]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
Merge pull request #26325 from jtlayton/wip-jlayton-dashboard-orch
authorLenz Grimmer <lenz@grimmer.com>
Wed, 13 Feb 2019 16:08:23 +0000 (17:08 +0100)
committerGitHub <noreply@github.com>
Wed, 13 Feb 2019 16:08:23 +0000 (17:08 +0100)
mgr/dashboard: use the orchestrator_cli backend setting

Reviewed-by: Ricardo Dias <rdias@suse.com>
Reviewed-by: Sebastian Wagner <swagner@suse.com>
Reviewed-by: Sage Weil <sage@redhat.com>
Reviewed-by: Volker Theile <vtheile@suse.com>
1  2 
doc/mgr/orchestrator_cli.rst
src/mon/MgrMonitor.cc
src/pybind/mgr/orchestrator.py
src/pybind/mgr/orchestrator_cli/module.py

Simple merge
Simple merge
Simple merge
index 77b7db461eeea0fdf9ce530ba58cf497716342ca,462586d42e61e2357145fe2c1e429fefda095fca..37a8dcd4966b34eacc6be37d01495fb11a7bddcb
@@@ -36,47 -30,15 +30,43 @@@ class OrchestratorCli(orchestrator.Orch
      ]
  
      def _select_orchestrator(self):
-         o = self.get_module_option("orchestrator")
-         if o is None:
-             raise NoOrchestrator()
-         return o
+         return self.get_module_option("orchestrator")
  
 +    @CLIWriteCommand('orchestrator host add',
 +                     "name=host,type=CephString,req=true",
 +                     'Add a host')
 +    @handle_exceptions
 +    def _add_host(self, host):
 +        completion = self.add_host(host)
 +        self._orchestrator_wait([completion])
 +        return HandleCommandResult(stdout=str(completion.result))
 +
 +    @CLIWriteCommand('orchestrator host rm',
 +                     "name=host,type=CephString,req=true",
 +                     'Remove a host')
 +    @handle_exceptions
 +    def _remove_host(self, host):
 +        completion = self.remove_host(host)
 +        self._orchestrator_wait([completion])
 +        return HandleCommandResult(stdout=str(completion.result))
 +
 +    @CLIReadCommand('orchestrator host ls',
 +                    desc='List hosts')
 +    @handle_exceptions
 +    def _get_hosts(self):
 +        completion = self.get_hosts()
 +        self._orchestrator_wait([completion])
 +        result = "\n".join(map(lambda node: node.name, completion.result))
 +        return HandleCommandResult(stdout=result)
 +
      @CLIReadCommand('orchestrator device ls',
                      "name=host,type=CephString,n=N,req=false "
 -                    "name=format,type=CephChoices,strings=json|plain,req=false",
 +                    "name=format,type=CephChoices,strings=json|plain,req=false "
 +                    "name=refresh,type=CephBool,req=false",
                      'List devices on a node')
      @handle_exceptions
 -    def _list_devices(self, host=None, format='plain'):
 -        # type: (List[str], str) -> HandleCommandResult
 +    def _list_devices(self, host=None, format='plain', refresh=False):
 +        # type: (List[str], str, bool) -> HandleCommandResult
          """
          Provide information about storage devices present in cluster hosts