]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
mgr/orchestrator: add count, hosts args to 'mds add'
authorSage Weil <sage@redhat.com>
Wed, 23 Oct 2019 21:13:26 +0000 (16:13 -0500)
committerSage Weil <sage@redhat.com>
Mon, 28 Oct 2019 15:42:22 +0000 (10:42 -0500)
Rook already uses the count; the hosts hint is not relevant.

Signed-off-by: Sage Weil <sage@redhat.com>
src/pybind/mgr/orchestrator.py
src/pybind/mgr/orchestrator_cli/module.py

index 79764720cb2a37e061db97b61ceda7958cc7737c..86d375046d8ad21ac421ffd0bb98a5e0d137730c 100644 (file)
@@ -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):
index a73ba2a836389deb4afac7d047198b741d08254b..d65cfbf7a6292b5b3b682c0dd3468334bed19a1b 100644 (file)
@@ -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)