From 50928d56dd83b60526124abc37de8d7adf9cfe94 Mon Sep 17 00:00:00 2001 From: John Mulligan Date: Sat, 18 Nov 2023 13:07:57 -0500 Subject: [PATCH] cephadm: replace some calls to rm with fs function calls This should be a little cleaner, perhaps a tiny performance improvement, and most importantly work better with the virtual-fs provided for the unit tests and make this function more testable in the future. Signed-off-by: John Mulligan --- src/cephadm/cephadm.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/cephadm/cephadm.py b/src/cephadm/cephadm.py index c44dfbecbde..99791a2de67 100755 --- a/src/cephadm/cephadm.py +++ b/src/cephadm/cephadm.py @@ -4178,7 +4178,7 @@ def command_rm_daemon(ctx): os.rename(data_dir, os.path.join(backup_dir, dirname)) else: - call_throws(ctx, ['rm', '-rf', data_dir]) + shutil.rmtree(data_dir, ignore_errors=True) endpoints = fetch_endpoints(ctx) ports: List[int] = [e.port for e in endpoints] -- 2.39.5