From: Sage Weil Date: Thu, 31 Oct 2019 19:22:39 +0000 (-0500) Subject: mgr/ssh: implement 'rgw update' X-Git-Tag: v15.1.0~1031^2~4 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=f59a40186be9eb555da018c71ea7b2298412e1dc;p=ceph.git mgr/ssh: implement 'rgw update' Signed-off-by: Sage Weil --- diff --git a/doc/mgr/orchestrator_cli.rst b/doc/mgr/orchestrator_cli.rst index 503944706b0a..c6f9b420126a 100644 --- a/doc/mgr/orchestrator_cli.rst +++ b/doc/mgr/orchestrator_cli.rst @@ -312,7 +312,7 @@ This is an overview of the current implementation status of the orchestrators. rbd-mirror update ⚪ ⚪ ⚪ ⚪ rgw add ✔ ✔ ⚪ ✔ rgw rm ✔ ✔ ⚪ ✔ - rgw update ⚪ ⚪ ⚪ ⚪ + rgw update ⚪ ⚪ ⚪ ✔ =================================== ========= ====== ========= ===== where diff --git a/src/pybind/mgr/ssh/module.py b/src/pybind/mgr/ssh/module.py index a5e7d39732d6..bd9c637a0a63 100644 --- a/src/pybind/mgr/ssh/module.py +++ b/src/pybind/mgr/ssh/module.py @@ -1022,3 +1022,18 @@ class SSHOrchestrator(MgrModule, orchestrator.Orchestrator): ['--name', name]) self.log.debug('remove_rgw code %s out %s' % (code, out)) return "Removed {} from host '{}'".format(name, host) + + def update_rgw(self, spec): + daemons = self._get_services('rgw', service_name=spec.name) + results = [] + if len(daemons) > spec.count: + # remove some + to_remove = len(daemons) - spec.count + for d in daemons[0:to_remove]: + results.append(self._worker_pool.apply_async( + self._remove_rgw, (d.service_instance, d.nodename))) + elif len(daemons) < spec.count: + # add some + spec.count -= len(daemons) + return self.add_rgw(spec) + return SSHWriteCompletion(results)