From: Anil Belur Date: Thu, 20 Nov 2025 12:28:41 +0000 (+1000) Subject: Fix: Missing value error in match-ldap-to-info X-Git-Tag: v0.37.16^0 X-Git-Url: https://gerrit.linuxfoundation.org/infra/gitweb?a=commitdiff_plain;ds=inline;p=releng%2Flftools.git Fix: Missing value error in match-ldap-to-info The code unconditionally tried to remove 'lfservices_releng' from the user list, causing ValueError when it doesn't exist in the LDAP group (common in production environments). Now checks if the user exists before attempting removal. This was causing info-merge-master jobs to fail. Fixes: ValueError: list.remove(x): x not in list Issue: RELENG-5882 Change-Id: I3ca95ac1033c4c80e3642e2fcdbe840179134b14 Signed-off-by: Anil Belur --- diff --git a/lftools/lfidapi.py b/lftools/lfidapi.py index bdc7b3ae..f245d0e6 100755 --- a/lftools/lfidapi.py +++ b/lftools/lfidapi.py @@ -178,7 +178,8 @@ def helper_match_ldap_to_info(info_file, group, githuborg, noop): all_users = ldap_committers + info_committers if not githuborg: - all_users.remove("lfservices_releng") + if "lfservices_releng" in all_users: + all_users.remove("lfservices_releng") log.info("All users in org group") all_users = sorted(set(all_users)) diff --git a/releasenotes/notes/fix-match-ldap-lfservices-releng-8cdcb98e50ab12ba.yaml b/releasenotes/notes/fix-match-ldap-lfservices-releng-8cdcb98e50ab12ba.yaml new file mode 100644 index 00000000..98908334 --- /dev/null +++ b/releasenotes/notes/fix-match-ldap-lfservices-releng-8cdcb98e50ab12ba.yaml @@ -0,0 +1,12 @@ +--- +fixes: + - | + Fix ValueError in match-ldap-to-info when lfservices_releng missing. + + The code unconditionally tried to remove 'lfservices_releng' from + the user list, causing a ValueError when it doesn't exist in the + LDAP group (common in production environments). + + This was causing info-merge-master jobs to fail. + + Now checks if the user exists before attempting removal.