From: John Mulligan Date: Sat, 4 Nov 2023 22:03:40 +0000 (-0400) Subject: cephadm: covert iscsi type to provide a customize_container_binds method X-Git-Tag: v19.0.0~110^2~5 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=21563528d1071654b8b77af0a65585915e73843f;p=ceph.git 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 --- diff --git a/src/cephadm/cephadm.py b/src/cephadm/cephadm.py index db075949f803..9e2f8dab1ee2 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: