From f71ddef6ba050bf8413f27f5fdb4472ce4cf5c05 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vin=C3=ADcius=20Ferr=C3=A3o?= <2031761+viniciusferrao@users.noreply.github.com> Date: Wed, 22 Jul 2026 19:21:08 -0300 Subject: [PATCH] fix(nodech): support multiple groups in the ^= operator nodech's ^= operator removed only a single literal value, so "nodech n1 groups^=a,b" tried to strip the combined string "a,b" and left the individual groups in place. Split the value on commas and remove each piece. Recovered from the unmerged lenovobuild branch (original 95c78b33). Co-authored-by: Jarrod Johnson <10814490+jjohnson42@users.noreply.github.com> --- xCAT-server/lib/xcat/plugins/tabutils.pm | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/xCAT-server/lib/xcat/plugins/tabutils.pm b/xCAT-server/lib/xcat/plugins/tabutils.pm index 6254c0513..b77c6c464 100644 --- a/xCAT-server/lib/xcat/plugins/tabutils.pm +++ b/xCAT-server/lib/xcat/plugins/tabutils.pm @@ -1765,11 +1765,14 @@ sub nodech if ($cent) { $curval = $cent->{$key}; } } if ($curval) { - my @vals = split(/,/, $curval); - if (grep /^$val$/, @vals) { #only bother if there - @vals = grep(!/^$val$/, @vals); - my $newval = join(',', @vals); - $uhsh{$key} = $newval; + foreach my $subval (split /,/, $val) { + my @vals = split(/,/, $curval); + if (grep /^$subval$/, @vals) { #only bother if there + @vals = grep(!/^$subval$/, @vals); + my $newval = join(',', @vals); + $uhsh{$key} = $newval; + $curval = $newval; + } } } #else, what they asked for is the case alredy }