From: John Mulligan Date: Sat, 4 Nov 2023 23:33:07 +0000 (-0400) Subject: cephadm: add customize_container_mounts method to monitoring class X-Git-Tag: v19.0.0~92^2~2 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=44c8e55b5cb3b00bbb70ef780ba08ff97aee9076;p=ceph-ci.git cephadm: add customize_container_mounts method to monitoring class Signed-off-by: John Mulligan --- 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)