]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
cephadm/tests: fix _dist_info function logic error
authorKefu Chai <k.chai@proxmox.com>
Mon, 10 Nov 2025 04:10:46 +0000 (12:10 +0800)
committerKefu Chai <k.chai@proxmox.com>
Wed, 12 Nov 2025 03:59:14 +0000 (11:59 +0800)
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 <k.chai@proxmox.com>
src/cephadm/tests/build/test_cephadm_build.py

index 724a025a6e5a213628d50503320d49d0c96a9061..a07e0a1bb3803bfe9986a654610aa5f2b5b95969 100644 (file)
@@ -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'))