]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr/cephadm: clean-up NFS rgw keyring
authorMichael Fritch <mfritch@suse.com>
Wed, 7 Oct 2020 19:53:01 +0000 (13:53 -0600)
committerSebastian Wagner <sebastian.wagner@suse.com>
Wed, 18 Nov 2020 10:52:40 +0000 (11:52 +0100)
remove RGW keyring during NFS daemon `post_remove`

Fixes: https://tracker.ceph.com/issues/43686
Signed-off-by: Michael Fritch <mfritch@suse.com>
(cherry picked from commit 219c0c3d1b7f21b9bf1969b3311d313844bdd1e3)

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

index bdf4205d9b154d1b2f248b34069d96dcd105eb0b..21011e1e443af1d196fff3d5c88d869659a68bf3 100644 (file)
@@ -153,3 +153,17 @@ class NFSService(CephService):
         })
 
         return keyring
+
+    def remove_rgw_keyring(self, daemon: DaemonDescription) -> None:
+        daemon_id: str = daemon.daemon_id
+        entity: AuthEntity = self.get_auth_entity(f'{daemon_id}-rgw')
+
+        logger.info(f'Remove keyring: {entity}')
+        ret, out, err = self.mgr.check_mon_command({
+            'prefix': 'auth rm',
+            'entity': entity,
+        })
+
+    def post_remove(self, daemon: DaemonDescription) -> None:
+        super().post_remove(daemon)
+        self.remove_rgw_keyring(daemon)