From cd63df32557efd27d6163ac0cc812812784843fb Mon Sep 17 00:00:00 2001 From: Sebastian Wagner Date: Mon, 16 Dec 2019 12:48:31 +0100 Subject: [PATCH] mgr/orchestrator_cli: Fix NFS * `count` was removed from `NFSServiceSpec` * `nodes` was renamed to `hosts` Signed-off-by: Sebastian Wagner --- src/pybind/mgr/orchestrator_cli/module.py | 26 +++++++++++++++++------ 1 file changed, 20 insertions(+), 6 deletions(-) diff --git a/src/pybind/mgr/orchestrator_cli/module.py b/src/pybind/mgr/orchestrator_cli/module.py index 76cdc97a56b..d78be1135f4 100644 --- a/src/pybind/mgr/orchestrator_cli/module.py +++ b/src/pybind/mgr/orchestrator_cli/module.py @@ -528,10 +528,18 @@ Usage: 'orchestrator nfs add', "name=svc_arg,type=CephString " "name=pool,type=CephString " - "name=namespace,type=CephString,req=false", + "name=namespace,type=CephString,req=false " + 'name=num,type=CephInt,req=false ' + 'name=hosts,type=CephString,n=N,req=false ' + 'name=label,type=CephString,req=false', 'Create an NFS service') - def _nfs_add(self, svc_arg, pool, namespace=None): - spec = orchestrator.NFSServiceSpec(svc_arg, pool=pool, namespace=namespace) + def _nfs_add(self, svc_arg, pool, namespace=None, num=None, label=None, hosts=[]): + spec = orchestrator.NFSServiceSpec( + svc_arg, + pool=pool, + namespace=namespace, + placement=orchestrator.PlacementSpec(label=label, hosts=hosts, count=num), + ) spec.validate_add() completion = self.add_nfs(spec) self._orchestrator_wait([completion]) @@ -541,10 +549,16 @@ Usage: @orchestrator._cli_write_command( 'orchestrator nfs update', "name=svc_id,type=CephString " - "name=num,type=CephInt", + 'name=num,type=CephInt,req=false ' + 'name=hosts,type=CephString,n=N,req=false ' + 'name=label,type=CephString,req=false', 'Scale an NFS service') - def _nfs_update(self, svc_id, num): - spec = orchestrator.NFSServiceSpec(svc_id, count=num) + def _nfs_update(self, svc_id, num=None, label=None, hosts=[]): + # type: (str, Optional[int], Optional[str], List[str]) -> HandleCommandResult + spec = orchestrator.NFSServiceSpec( + svc_id, + placement=orchestrator.PlacementSpec(label=label, hosts=hosts, count=num), + ) completion = self.update_nfs(spec) self._orchestrator_wait([completion]) return HandleCommandResult(stdout=completion.result_str()) -- 2.39.5