From 34ef3f7554345ca1054ff8e1d9c8383a639b5b84 Mon Sep 17 00:00:00 2001 From: John Mulligan Date: Sat, 4 Nov 2023 18:08:34 -0400 Subject: [PATCH] cephadm: covert nvmeof type to provide a customize_container_binds method Convert the CephNvmeof type's get_container_binds to customize_container_binds and use it in the generic method. Signed-off-by: John Mulligan --- src/cephadm/cephadm.py | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/src/cephadm/cephadm.py b/src/cephadm/cephadm.py index 9e2f8dab1ee..d01619cb5af 100755 --- a/src/cephadm/cephadm.py +++ b/src/cephadm/cephadm.py @@ -1298,16 +1298,16 @@ class CephNvmeof(ContainerDaemonForm): mounts['/dev/vfio/vfio'] = '/dev/vfio/vfio' return mounts - @staticmethod - def get_container_binds(): - # type: () -> List[List[str]] - binds = [] - lib_modules = ['type=bind', - 'source=/lib/modules', - 'destination=/lib/modules', - 'ro=true'] + def customize_container_binds( + self, ctx: CephadmContext, binds: List[List[str]] + ) -> None: + lib_modules = [ + 'type=bind', + 'source=/lib/modules', + 'destination=/lib/modules', + 'ro=true', + ] binds.append(lib_modules) - return binds @staticmethod def get_version(ctx: CephadmContext, container_id: str) -> Optional[str]: @@ -2560,7 +2560,8 @@ def get_container_binds( iscsi = CephIscsi.create(ctx, ident) iscsi.customize_container_binds(ctx, binds) if ident.daemon_type == CephNvmeof.daemon_type: - binds.extend(CephNvmeof.get_container_binds()) + nvmeof = CephNvmeof.create(ctx, ident) + nvmeof.customize_container_binds(ctx, binds) elif ident.daemon_type == CustomContainer.daemon_type: cc = CustomContainer.init(ctx, ident.fsid, ident.daemon_id) data_dir = ident.data_dir(ctx.data_dir) -- 2.39.5