From 21563528d1071654b8b77af0a65585915e73843f Mon Sep 17 00:00:00 2001 From: John Mulligan Date: Sat, 4 Nov 2023 18:03:40 -0400 Subject: [PATCH] cephadm: covert iscsi type to provide a customize_container_binds method Convert the CephIscsi 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 | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/src/cephadm/cephadm.py b/src/cephadm/cephadm.py index db075949f80..9e2f8dab1ee 100755 --- a/src/cephadm/cephadm.py +++ b/src/cephadm/cephadm.py @@ -1087,16 +1087,16 @@ class CephIscsi(ContainerDaemonForm): mounts['/dev'] = '/dev' 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, container_id): @@ -2554,10 +2554,11 @@ def _write_custom_conf_files( def get_container_binds( ctx: CephadmContext, ident: 'DaemonIdentity' ) -> List[List[str]]: - binds = list() + binds: List[List[str]] = list() if ident.daemon_type == CephIscsi.daemon_type: - binds.extend(CephIscsi.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()) elif ident.daemon_type == CustomContainer.daemon_type: -- 2.39.5