]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
cephadm: add parent_identity function
authorJohn Mulligan <jmulligan@redhat.com>
Fri, 23 Jan 2026 19:00:19 +0000 (14:00 -0500)
committerJohn Mulligan <jmulligan@redhat.com>
Fri, 13 Feb 2026 16:38:11 +0000 (11:38 -0500)
Add a new parent_identity function that a sub-identity type can use to
reconstruct a precise parent identity.

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

index bfe1a855186dad68f456fd05493f633818ed0d72..ea8913b1cd3ae10e36c8ce08881cf304d45881dc 100644 (file)
@@ -166,6 +166,12 @@ class DaemonSubIdentity(DaemonIdentity):
             'legacy_container_name not valid for DaemonSubIdentity'
         )
 
+    def parent_identity(self) -> DaemonIdentity:
+        """Return a new DaemonIdentity object based on the current values of this
+        DaemonSubIdentity.
+        """
+        return DaemonIdentity(self.fsid, self.daemon_type, self.daemon_id)
+
     @classmethod
     def from_parent(
         cls, parent: 'DaemonIdentity', subcomponent: str