]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr/cephadm: rgw: clean up config and config-key values on removal
authorSage Weil <sage@newdream.net>
Tue, 16 Mar 2021 16:58:52 +0000 (12:58 -0400)
committerSage Weil <sage@newdream.net>
Fri, 19 Mar 2021 13:59:58 +0000 (08:59 -0500)
Signed-off-by: Sage Weil <sage@newdream.net>
(cherry picked from commit 4841093c7643c907934c684800a44e85ce873990)

src/pybind/mgr/cephadm/services/cephadmservice.py

index 1812ebc3817618cd996321cd82c5ba769573e5b8..ea48c5321f7586f1795e231fb82d3138e6455141 100644 (file)
@@ -800,6 +800,30 @@ class RgwService(CephService):
                                               'osd', 'allow rwx tag rgw *=*'])
         return keyring
 
+    def purge(self, service_name: str) -> None:
+        self.mgr.check_mon_command({
+            'prefix': 'config rm',
+            'who': utils.name_to_config_section(service_name),
+            'name': 'rgw_realm',
+        })
+        self.mgr.check_mon_command({
+            'prefix': 'config rm',
+            'who': utils.name_to_config_section(service_name),
+            'name': 'rgw_zone',
+        })
+        self.mgr.check_mon_command({
+            'prefix': 'config-key rm',
+            'key': f'rgw/cert/{service_name}',
+        })
+
+    def post_remove(self, daemon: DaemonDescription) -> None:
+        super().post_remove(daemon)
+        self.mgr.check_mon_command({
+            'prefix': 'config rm',
+            'who': utils.name_to_config_section(daemon.name()),
+            'name': 'rgw_frontends',
+        })
+
     def ok_to_stop(
             self,
             daemon_ids: List[str],