From f4c9be64648848eb7ec94e165ddcbb2df7ef8e25 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michael=20La=C3=9F?= Date: Tue, 2 Jan 2024 14:25:34 +0100 Subject: bcfg2-lint: correctly parse threshold option We need to convert from str to float before doing the comparison. --- src/lib/Bcfg2/Server/Lint/MergeFiles.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/lib/Bcfg2/Server/Lint') diff --git a/src/lib/Bcfg2/Server/Lint/MergeFiles.py b/src/lib/Bcfg2/Server/Lint/MergeFiles.py index 3a6251594..3b89e507a 100644 --- a/src/lib/Bcfg2/Server/Lint/MergeFiles.py +++ b/src/lib/Bcfg2/Server/Lint/MergeFiles.py @@ -121,9 +121,9 @@ class MergeFiles(Bcfg2.Server.Lint.ServerPlugin): if seqmatch.real_quick_ratio() == 1.0: identical.add(cname) elif ( - seqmatch.real_quick_ratio() > Bcfg2.Options.setup.threshold and - seqmatch.quick_ratio() > Bcfg2.Options.setup.threshold and - seqmatch.ratio() > Bcfg2.Options.setup.threshold): + seqmatch.real_quick_ratio() > threshold(Bcfg2.Options.setup.threshold) and + seqmatch.quick_ratio() > threshold(Bcfg2.Options.setup.threshold) and + seqmatch.ratio() > threshold(Bcfg2.Options.setup.threshold)): similar.add(cname) if similar: similar.add(fname) -- cgit v1.2.3-1-g7c22