From: John Mulligan Date: Sun, 5 Nov 2023 18:20:26 +0000 (-0500) Subject: cephadm: handle the case where ctx may not have a config attribute X-Git-Tag: v19.0.0~24^2~15 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=101dbb2f01e220406ef364efaf922fd50301bc1e;p=ceph.git cephadm: handle the case where ctx may not have a config attribute This prevents a test failure in future refactoring changes. Signed-off-by: John Mulligan --- diff --git a/src/cephadm/cephadm.py b/src/cephadm/cephadm.py index 5238e33e9c5..ad3a46faad9 100755 --- a/src/cephadm/cephadm.py +++ b/src/cephadm/cephadm.py @@ -344,10 +344,13 @@ class Ceph(ContainerDaemonForm): def customize_container_mounts( self, ctx: CephadmContext, mounts: Dict[str, str] ) -> None: + no_config = bool( + getattr(ctx, 'config', None) and self.user_supplied_config + ) cm = self.get_ceph_mounts( ctx, self.identity, - no_config=self.ctx.config and self.user_supplied_config, + no_config=no_config, ) mounts.update(cm)