From 6e33661fc05788cb286c507a1fc0c98abb0e0c89 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:20:49 -0300 Subject: [PATCH] fix(nodech): handle comma-delimited values in the ,= operator nodech's ,= operator appended the whole right-hand side as one value, so "nodech n1 groups,=a,b" added the literal "a,b" and its duplicate check only compared against that combined string. Split the value on commas and add each piece individually, skipping any already present. Recovered from the unmerged lenovobuild branch (original 086b0c0d). 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 2cfa931c8..6254c0513 100644 --- a/xCAT-server/lib/xcat/plugins/tabutils.pm +++ b/xCAT-server/lib/xcat/plugins/tabutils.pm @@ -1742,11 +1742,14 @@ sub nodech if ($cent) { $curval = $cent->{$key}; } } if ($curval) { - my @vals = split(/,/, $curval); - unless (grep /^$val$/, @vals) { - unshift @vals, $val; - my $newval = join(',', @vals); - $uhsh{$key} = $newval; + foreach my $subval (split /,/, $val) { + my @vals = split(/,/, $curval); + unless (grep /^$subval$/, @vals) { + unshift @vals, $subval; + my $newval = join(',', @vals); + $uhsh{$key} = $newval; + $curval = $newval; + } } } else { $uhsh{$key} = $val;