From: Kefu Chai Date: Mon, 10 Nov 2025 04:10:46 +0000 (+0800) Subject: cephadm/tests: fix _dist_info function logic error X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=2fadd34104652940844eb914ff3b0b53cb5ff190;p=ceph.git cephadm/tests: fix _dist_info function logic error The _dist_info helper function had a logic error where it was checking if 'entry.startswith(entry)' instead of 'entry.startswith(name)'. This caused the function to always evaluate incorrectly when checking for .dist-info or .egg-info entries in the zipapp. This bug was preventing the test assertions from properly validating that package metadata directories are included in the built cephadm zipapp. Fixes a bug introduced in commit 31c8010faa4. Signed-off-by: Kefu Chai --- diff --git a/src/cephadm/tests/build/test_cephadm_build.py b/src/cephadm/tests/build/test_cephadm_build.py index 724a025a6e5a2..a07e0a1bb3803 100644 --- a/src/cephadm/tests/build/test_cephadm_build.py +++ b/src/cephadm/tests/build/test_cephadm_build.py @@ -195,5 +195,5 @@ def test_cephadm_build_from_rpms(env, source_dir, tmp_path): def _dist_info(entry, name): return ( - entry.startswith(entry) or entry.startswith(entry.lower()) + entry.startswith(name) or entry.startswith(name.lower()) ) and (entry.endswith('.dist-info') or entry.endswith('.egg-info'))