]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
cephadm: covert nvmeof type to provide a customize_container_binds method
authorJohn Mulligan <jmulligan@redhat.com>
Sat, 4 Nov 2023 22:08:34 +0000 (18:08 -0400)
committerJohn Mulligan <jmulligan@redhat.com>
Thu, 9 Nov 2023 19:50:46 +0000 (14:50 -0500)
Convert the CephNvmeof 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 9e2f8dab1ee28f8c14e95b3e90e11ea764903b13..d01619cb5aff29d67b40c911326ed1c8ddaa8955 100755 (executable)
@@ -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)