From 882073bc46c888289ae76fdc817995ced6169e02 Mon Sep 17 00:00:00 2001 From: John Mulligan Date: Sun, 5 Nov 2023 11:12:54 -0500 Subject: [PATCH] cephadm: add methods to ceph daemon type class Add unused methods to the ceph class in order to prepare for moving the logic for setting up the various ceph deaemon types to be handled by the class. Signed-off-by: John Mulligan --- src/cephadm/cephadm.py | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/src/cephadm/cephadm.py b/src/cephadm/cephadm.py index b704e50c9c49c..3ea41e47c9d7b 100755 --- a/src/cephadm/cephadm.py +++ b/src/cephadm/cephadm.py @@ -351,6 +351,34 @@ class Ceph(ContainerDaemonForm): ) mounts.update(cm) + def customize_process_args( + self, ctx: CephadmContext, args: List[str] + ) -> None: + ident = self.identity + if ident.daemon_type == 'rgw': + name = 'client.rgw.%s' % ident.daemon_id + elif ident.daemon_type == 'rbd-mirror': + name = 'client.rbd-mirror.%s' % ident.daemon_id + elif ident.daemon_type == 'cephfs-mirror': + name = 'client.cephfs-mirror.%s' % ident.daemon_id + elif ident.daemon_type == 'crash': + name = 'client.crash.%s' % ident.daemon_id + elif ident.daemon_type in ['mon', 'mgr', 'mds', 'osd']: + name = ident.daemon_name + else: + raise ValueError(ident) + args.extend(['-n', name, '-f']) + args.extend(self.get_daemon_args()) + + def default_entrypoint(self) -> str: + ep = { + 'rgw': '/usr/bin/radosgw', + 'rbd-mirror': '/usr/bin/rbd-mirror', + 'cephfs-mirror': '/usr/bin/cephfs-mirror', + } + daemon_type = self.identity.daemon_type + return ep.get(daemon_type) or f'/usr/bin/ceph-{daemon_type}' + ################################## -- 2.39.5