]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr/ssh: implement 'rgw update'
authorSage Weil <sage@redhat.com>
Thu, 31 Oct 2019 19:22:39 +0000 (14:22 -0500)
committerSage Weil <sage@redhat.com>
Tue, 5 Nov 2019 14:46:01 +0000 (08:46 -0600)
Signed-off-by: Sage Weil <sage@redhat.com>
doc/mgr/orchestrator_cli.rst
src/pybind/mgr/ssh/module.py

index 503944706b0af17ca79eec891ddcd55d621b0b01..c6f9b420126a1da9c757a6e35b5eb650253a7205 100644 (file)
@@ -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                          â\9aª         â\9aª       â\9aª         â\9aª
+ rgw update                          â\9aª         â\9aª       â\9aª         â\9c\94
 =================================== ========= ====== ========= =====
 
 where
index a5e7d39732d6882dfb60eb6964d1d0969a6f7b9d..bd9c637a0a637d7196140a277283f02c1dea4c0f 100644 (file)
@@ -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)