From: Adam King Date: Wed, 31 Jan 2024 18:37:40 +0000 (-0500) Subject: mgr/cephadm: add systemd unit to stored info about daemons X-Git-Tag: testing/wip-pdonnell-testing-20240920.212106-debug~32^2~1 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=c939c95265cf17e7ab5ad60f95b5bbaabfd32ef1;p=ceph-ci.git mgr/cephadm: add systemd unit to stored info about daemons We already collect this in `cephadm ls` but don't store it currently. Storing it will allow us to expose it to users who want that information. Signed-off-by: Adam King --- diff --git a/src/pybind/mgr/cephadm/module.py b/src/pybind/mgr/cephadm/module.py index 0bca599961e..4a01307a484 100644 --- a/src/pybind/mgr/cephadm/module.py +++ b/src/pybind/mgr/cephadm/module.py @@ -1103,6 +1103,7 @@ class CephadmOrchestrator(orchestrator.Orchestrator, MgrModule, ports=d.get('ports'), ip=d.get('ip'), deployed_by=d.get('deployed_by'), + systemd_unit=d.get('systemd_unit'), rank=rank, rank_generation=rank_generation, extra_container_args=d.get('extra_container_args'), diff --git a/src/pybind/mgr/orchestrator/_interface.py b/src/pybind/mgr/orchestrator/_interface.py index c33f38cfdd4..53fa7542109 100644 --- a/src/pybind/mgr/orchestrator/_interface.py +++ b/src/pybind/mgr/orchestrator/_interface.py @@ -1100,6 +1100,7 @@ class DaemonDescription(object): ports: Optional[List[int]] = None, ip: Optional[str] = None, deployed_by: Optional[List[str]] = None, + systemd_unit: Optional[str] = None, rank: Optional[int] = None, rank_generation: Optional[int] = None, extra_container_args: Optional[GeneralArgList] = None, @@ -1166,6 +1167,8 @@ class DaemonDescription(object): self.deployed_by = deployed_by + self.systemd_unit = systemd_unit + self.is_active = is_active self.extra_container_args: Optional[ArgumentList] = None @@ -1329,6 +1332,7 @@ class DaemonDescription(object): out['ip'] = self.ip out['rank'] = self.rank out['rank_generation'] = self.rank_generation + out['systemd_unit'] = self.systemd_unit for k in ['last_refresh', 'created', 'started', 'last_deployed', 'last_configured']: @@ -1365,6 +1369,7 @@ class DaemonDescription(object): out['is_active'] = self.is_active out['ports'] = self.ports out['ip'] = self.ip + out['systemd_unit'] = self.systemd_unit for k in ['last_refresh', 'created', 'started', 'last_deployed', 'last_configured']: