]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
cephadm: change ceph & exporter to customize_container_mounts method
authorJohn Mulligan <jmulligan@redhat.com>
Sat, 4 Nov 2023 23:41:25 +0000 (19:41 -0400)
committerJohn Mulligan <jmulligan@redhat.com>
Sat, 11 Nov 2023 13:10:49 +0000 (08:10 -0500)
Unlike the other types Ceph and CephExporter share the underlying
method. There was no other use of get_container_mounts on the class
so it could be converted to be customize_container_mounts.
Because there's an extra arg that passes from get_container_mounts
top-level function to Ceph.get_ceph_mounts, that function was not
changed.

Signed-off-by: John Mulligan <jmulligan@redhat.com>
src/cephadm/cephadm.py

index 7bfbbeedb0a4eac5470b6c09f00a5a5c085213b5..2bf31527fbfd9b98e972140a0a9be95813339712 100755 (executable)
@@ -341,12 +341,15 @@ class Ceph(ContainerDaemonForm):
             )
         return mounts
 
-    def get_container_mounts(self) -> Dict[str, str]:
-        return self.get_ceph_mounts(
-            self.ctx,
+    def customize_container_mounts(
+        self, ctx: CephadmContext, mounts: Dict[str, str]
+    ) -> None:
+        cm = self.get_ceph_mounts(
+            ctx,
             self.identity,
             no_config=self.ctx.config and self.user_supplied_config,
         )
+        mounts.update(cm)
 
 ##################################
 
@@ -1496,8 +1499,11 @@ class CephExporter(ContainerDaemonForm):
     ) -> Tuple[Optional[str], Optional[str]]:
         return get_config_and_keyring(ctx)
 
-    def get_container_mounts(self) -> Dict[str, str]:
-        return Ceph.get_ceph_mounts(self.ctx, self.identity)
+    def customize_container_mounts(
+        self, ctx: CephadmContext, mounts: Dict[str, str]
+    ) -> None:
+        cm = Ceph.get_ceph_mounts(ctx, self.identity)
+        mounts.update(cm)
 
 
 ##################################