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 <jmulligan@redhat.com>
This commit is contained in:
John Mulligan 2023-11-05 13:20:26 -05:00
parent b58369e916
commit 101dbb2f01

View File

@ -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)