]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
cephadm: covert iscsi type to provide a customize_container_binds method
authorJohn Mulligan <jmulligan@redhat.com>
Sat, 4 Nov 2023 22:03:40 +0000 (18:03 -0400)
committerJohn Mulligan <jmulligan@redhat.com>
Thu, 9 Nov 2023 19:50:46 +0000 (14:50 -0500)
Convert the CephIscsi type's get_container_binds to
customize_container_binds and use it in the generic method.

Signed-off-by: John Mulligan <jmulligan@redhat.com>
src/cephadm/cephadm.py

index db075949f80382fef1e0ea4b16fcb8c7613cda29..9e2f8dab1ee28f8c14e95b3e90e11ea764903b13 100755 (executable)
@@ -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: