From c35db383c461bdbb280934d08d24fc6ddf1e9ef5 Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Wed, 23 Oct 2019 16:13:26 -0500 Subject: [PATCH] mgr/orchestrator: add count, hosts args to 'mds add' Rook already uses the count; the hosts hint is not relevant. Signed-off-by: Sage Weil --- src/pybind/mgr/orchestrator.py | 5 +++-- src/pybind/mgr/orchestrator_cli/module.py | 11 ++++++++--- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/src/pybind/mgr/orchestrator.py b/src/pybind/mgr/orchestrator.py index 79764720cb2..86d375046d8 100644 --- a/src/pybind/mgr/orchestrator.py +++ b/src/pybind/mgr/orchestrator.py @@ -564,8 +564,9 @@ class PlacementSpec(object): """ For APIs that need to specify a node subset """ - def __init__(self): - self.label = None + def __init__(self, label=None, nodes=[]): + self.label = label + self.nodes = nodes def handle_type_error(method): diff --git a/src/pybind/mgr/orchestrator_cli/module.py b/src/pybind/mgr/orchestrator_cli/module.py index a73ba2a8363..d65cfbf7a62 100644 --- a/src/pybind/mgr/orchestrator_cli/module.py +++ b/src/pybind/mgr/orchestrator_cli/module.py @@ -237,10 +237,15 @@ Usage: return HandleCommandResult(stdout=completion.result_str()) @_write_cli('orchestrator mds add', - "name=svc_arg,type=CephString", + "name=svc_arg,type=CephString " + "name=num,type=CephInt,req=false " + "name=hosts,type=CephString,n=N,req=false", 'Create an MDS service') - def _mds_add(self, svc_arg): - spec = orchestrator.StatelessServiceSpec(svc_arg) + def _mds_add(self, svc_arg, num, hosts): + spec = orchestrator.StatelessServiceSpec( + svc_arg, + placement=orchestrator.PlacementSpec(nodes=hosts), + count=num or 1) completion = self.add_mds(spec) self._orchestrator_wait([completion]) orchestrator.raise_if_exception(completion) -- 2.39.5