From adf31c30da97c31362f1323ef30f11571094cd89 Mon Sep 17 00:00:00 2001 From: John Mulligan Date: Thu, 19 Oct 2023 16:19:21 -0400 Subject: [PATCH] cephadm: move tracing get_daemon_args logic to class Move the logic used to get deamon args into a method of the Tracing class. This requires an update to save a reference to ctx. Signed-off-by: John Mulligan --- src/cephadm/cephadm.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/cephadm/cephadm.py b/src/cephadm/cephadm.py index c56eaf2f287..088234afb5f 100755 --- a/src/cephadm/cephadm.py +++ b/src/cephadm/cephadm.py @@ -1662,6 +1662,11 @@ class Tracing(ContainerDaemonForm): def uid_gid(self, ctx: CephadmContext) -> Tuple[int, int]: return 65534, 65534 + def get_daemon_args(self) -> List[str]: + return self.components[self.identity.daemon_type].get( + 'daemon_args', [] + ) + ################################## @@ -2324,7 +2329,8 @@ def get_daemon_args(ctx: CephadmContext, ident: 'DaemonIdentity') -> List[str]: monitoring = Monitoring.create(ctx, ident) r += monitoring.get_daemon_args() elif daemon_type == 'jaeger-agent': - r.extend(Tracing.components[daemon_type]['daemon_args']) + tracing = Tracing.create(ctx, ident) + r += tracing.get_daemon_args() elif daemon_type == NFSGanesha.daemon_type: nfs_ganesha = NFSGanesha.init(ctx, ident.fsid, ident.daemon_id) r += nfs_ganesha.get_daemon_args() -- 2.39.5