]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
cephadm: convert nvmeof type to a ContainerDaemonForm
authorJohn Mulligan <jmulligan@redhat.com>
Wed, 27 Sep 2023 22:12:48 +0000 (18:12 -0400)
committerJohn Mulligan <jmulligan@redhat.com>
Thu, 5 Oct 2023 21:05:33 +0000 (17:05 -0400)
Signed-off-by: John Mulligan <jmulligan@redhat.com>
src/cephadm/cephadm.py

index 5582e1ef692ff40f327971b7804443cef8f8d7dc..7511b4cf17c27976ad945661fc186146ca76d0be 100755 (executable)
@@ -928,7 +928,7 @@ done
 
 
 @register_daemon_form
-class CephNvmeof(DaemonForm):
+class CephNvmeof(ContainerDaemonForm):
     """Defines a Ceph-Nvmeof container"""
 
     daemon_type = 'nvmeof'
@@ -1061,6 +1061,17 @@ class CephNvmeof(DaemonForm):
             'vm.nr_hugepages = 4096',
         ]
 
+    def container(self, ctx: CephadmContext) -> CephContainer:
+        return get_deployment_container(ctx, self.identity)
+
+    def uid_gid(self, ctx: CephadmContext) -> Tuple[int, int]:
+        return 167, 167  # TODO: need to get properly the uid/gid
+
+    def config_and_keyring(
+        self, ctx: CephadmContext
+    ) -> Tuple[Optional[str], Optional[str]]:
+        return get_config_and_keyring(ctx)
+
 
 ##################################
 
@@ -5209,21 +5220,6 @@ def _dispatch_deploy(
             deployment_type=deployment_type,
             endpoints=daemon_endpoints
         )
-    elif daemon_type == CephNvmeof.daemon_type:
-        config, keyring = get_config_and_keyring(ctx)
-        uid, gid = 167, 167  # TODO: need to get properly the uid/gid
-        c = get_deployment_container(ctx, ident)
-        deploy_daemon(
-            ctx,
-            ident,
-            c,
-            uid,
-            gid,
-            config=config,
-            keyring=keyring,
-            deployment_type=deployment_type,
-            endpoints=daemon_endpoints,
-        )
 
     elif daemon_type == CephadmAgent.daemon_type:
         # get current user gid and uid