From: Adam King Date: Thu, 28 Sep 2023 18:39:53 +0000 (-0400) Subject: cephadm: remove get_unit_name_by_instance func X-Git-Tag: v19.0.0~374^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F53724%2Fhead;p=ceph.git cephadm: remove get_unit_name_by_instance func As it is one line, quite simple, and only had a single caller, it was decided we'd remove this function as part of the cephadm refactor. Signed-off-by: Adam King --- diff --git a/src/cephadm/cephadm.py b/src/cephadm/cephadm.py index 30a824f2983a..32e2c80c9f14 100755 --- a/src/cephadm/cephadm.py +++ b/src/cephadm/cephadm.py @@ -1863,13 +1863,6 @@ def get_unit_name( return DaemonIdentity(fsid, daemon_type, daemon_id).unit_name -def get_unit_name_by_instance(fsid: str, instance: str) -> str: - """Return the name of the systemd unit given an fsid and the name - of the instance (the stuff after the @-sign and before the file extension). - """ - return 'ceph-%s@%s' % (fsid, instance) - - def get_unit_name_by_daemon_name(ctx: CephadmContext, fsid: str, name: str) -> str: daemon = get_daemon_description(ctx, fsid, name) try: @@ -6863,7 +6856,7 @@ def _rm_cluster(ctx: CephadmContext, keep_logs: bool, zap_osds: bool) -> None: continue if d['style'] != 'cephadm:v1': continue - disable_systemd_service(get_unit_name_by_instance(ctx.fsid, d['name'])) + disable_systemd_service('ceph-%s@%s' % (ctx.fsid, d['name'])) # cluster units for unit_name in ['ceph-%s.target' % ctx.fsid]: