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 <abelur@linuxfoundation.org>
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))
--- /dev/null
+---
+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.