mirror of
https://github.com/ceph/ceph
synced 2025-02-23 11:07:35 +00:00
cephadm: add daemon_name property to DaemonIdentity
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>
This commit is contained in:
parent
a7458053a4
commit
04423ccd2d
@ -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}'
|
||||
|
Loading…
Reference in New Issue
Block a user