From 99099737a82cdf63ca7392cc03f9f19123d8c01b Mon Sep 17 00:00:00 2001 From: Anil Belur Date: Thu, 20 Nov 2025 22:28:41 +1000 Subject: [PATCH] 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 --- lftools/lfidapi.py | 3 ++- .../fix-match-ldap-lfservices-releng-8cdcb98e50ab12ba.yaml | 12 ++++++++++++ 2 files changed, 14 insertions(+), 1 deletion(-) create mode 100644 releasenotes/notes/fix-match-ldap-lfservices-releng-8cdcb98e50ab12ba.yaml 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. -- 2.16.6