From 3411e10c5ca9b740cd25d02ff0c5c078bf7ce64f Mon Sep 17 00:00:00 2001 From: John Mulligan Date: Sat, 4 Nov 2023 19:41:25 -0400 Subject: [PATCH] cephadm: change ceph & exporter to customize_container_mounts method 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 --- src/cephadm/cephadm.py | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/src/cephadm/cephadm.py b/src/cephadm/cephadm.py index 7bfbbeedb0a..2bf31527fbf 100755 --- a/src/cephadm/cephadm.py +++ b/src/cephadm/cephadm.py @@ -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) ################################## -- 2.39.5