]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
cephadm: add daemon_name property to DaemonIdentity
authorJohn Mulligan <jmulligan@redhat.com>
Wed, 26 Jul 2023 23:25:07 +0000 (19:25 -0400)
committerJohn Mulligan <jmulligan@redhat.com>
Mon, 11 Sep 2023 19:23:04 +0000 (15:23 -0400)
Add a convenience property to DaemonIdentity and DaemonSubIdentity that
produces a name in the ceph daemon naming convention: <type>.<id>.

Signed-off-by: John Mulligan <jmulligan@redhat.com>
src/cephadm/cephadmlib/daemon_identity.py

index eced0edc85c29a792dfbf43f925583a10ae1a830..3e79e8f9f6a2599ea13c62f44fc727ea6895def7 100644 (file)
@@ -33,6 +33,10 @@ class DaemonIdentity:
     def daemon_id(self) -> str:
         return self._daemon_id
 
+    @property
+    def daemon_name(self) -> str:
+        return f'{self.daemon_type}.{self.daemon_id}'
+
     @property
     def legacy_container_name(self) -> str:
         return 'ceph-%s-%s.%s' % (self.fsid, self.daemon_type, self.daemon_id)
@@ -75,6 +79,10 @@ class DaemonSubIdentity(DaemonIdentity):
     def subcomponent(self) -> str:
         return self._subcomponent
 
+    @property
+    def daemon_name(self) -> str:
+        return f'{self.daemon_type}.{self.daemon_id}.{self.subcomponent}'
+
     @property
     def container_name(self) -> str:
         name = f'ceph-{self.fsid}-{self.daemon_type}-{self.daemon_id}-{self.subcomponent}'