From 101dbb2f01e220406ef364efaf922fd50301bc1e Mon Sep 17 00:00:00 2001 From: John Mulligan Date: Sun, 5 Nov 2023 13:20:26 -0500 Subject: [PATCH] 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 --- src/cephadm/cephadm.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/cephadm/cephadm.py b/src/cephadm/cephadm.py index 5238e33e9c50..ad3a46faad9b 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) -- 2.47.3