From 34fa171ff3fcc7c938aca7f5f7ddb6253607f0d5 Mon Sep 17 00:00:00 2001 From: Adam King Date: Thu, 28 Sep 2023 14:39:53 -0400 Subject: [PATCH] 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 --- src/cephadm/cephadm.py | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) 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]: -- 2.47.3