From: Lenz Grimmer Date: Wed, 13 Feb 2019 16:08:23 +0000 (+0100) Subject: Merge pull request #26325 from jtlayton/wip-jlayton-dashboard-orch X-Git-Tag: v14.1.0~132 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=681de1a0f1ad2e9c821316cfd8e4cd4047096b28;p=ceph-ci.git Merge pull request #26325 from jtlayton/wip-jlayton-dashboard-orch mgr/dashboard: use the orchestrator_cli backend setting Reviewed-by: Ricardo Dias Reviewed-by: Sebastian Wagner Reviewed-by: Sage Weil Reviewed-by: Volker Theile --- 681de1a0f1ad2e9c821316cfd8e4cd4047096b28 diff --cc src/pybind/mgr/orchestrator_cli/module.py index 77b7db461ee,462586d42e6..37a8dcd4966 --- a/src/pybind/mgr/orchestrator_cli/module.py +++ b/src/pybind/mgr/orchestrator_cli/module.py @@@ -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