]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commit
cephadm: add DaemonIdentity type
authorJohn Mulligan <jmulligan@redhat.com>
Fri, 23 Jun 2023 15:49:57 +0000 (11:49 -0400)
committerJohn Mulligan <jmulligan@redhat.com>
Wed, 9 Aug 2023 17:48:07 +0000 (13:48 -0400)
commit0aba240abd5f931ce741e84ba5db6e9336f7eede
treeb9d250782c22f6304b53703bfebc854d1c61d682
parent53d3df1f609459076716e915c635b5386ea88dd7
cephadm: add DaemonIdentity type

It's an extremely common pattern in cephadm to need a triple of
(fsid, daemon_type, daemon_id). These triples are used to generate
various names and paths etc. Add a new type, DaemonIdentity, that
can represent these values in a more convient package. It has an
additional optional field "subcomponent" that can represent a
part of a daemon/service.
It is expected to be used in an immutable manner like a namedtuple,
but I didn't end using a namedtuple because cephadm doesn't make
much use of them and the syntax to combine namedtuple and type hints
is awkward.

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