From 44c8e55b5cb3b00bbb70ef780ba08ff97aee9076 Mon Sep 17 00:00:00 2001 From: John Mulligan Date: Sat, 4 Nov 2023 19:33:07 -0400 Subject: [PATCH] cephadm: add customize_container_mounts method to monitoring class Signed-off-by: John Mulligan --- src/cephadm/cephadm.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/cephadm/cephadm.py b/src/cephadm/cephadm.py index 48c50e779b8..7bfbbeedb0a 100755 --- a/src/cephadm/cephadm.py +++ b/src/cephadm/cephadm.py @@ -810,7 +810,7 @@ class Monitoring(ContainerDaemonForm): '--path.rootfs=/rootfs'] return r - def get_container_mounts(self, data_dir: str) -> Dict[str, str]: + def _get_container_mounts(self, data_dir: str) -> Dict[str, str]: ctx = self.ctx daemon_type = self.identity.daemon_type mounts: Dict[str, str] = {} @@ -853,6 +853,12 @@ class Monitoring(ContainerDaemonForm): ] = '/etc/alertmanager:Z' return mounts + def customize_container_mounts( + self, ctx: CephadmContext, mounts: Dict[str, str] + ) -> None: + data_dir = self.identity.data_dir(ctx.data_dir) + mounts.update(self._get_container_mounts(data_dir)) + ################################## @@ -2700,9 +2706,8 @@ def get_container_mounts( mounts = Ceph.get_ceph_mounts(ctx, ident, no_config=no_config) if daemon_type in Monitoring.components: - data_dir = ident.data_dir(ctx.data_dir) monitoring = Monitoring.create(ctx, ident) - mounts.update(monitoring.get_container_mounts(data_dir)) + monitoring.customize_container_mounts(ctx, mounts) if daemon_type == NFSGanesha.daemon_type: nfs_ganesha = NFSGanesha.create(ctx, ident) -- 2.39.5