mirror of
https://github.com/xcat2/xcat-core.git
synced 2026-08-03 16:06:59 +00:00
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 (original086b0c0d). Co-authored-by: Jarrod Johnson <10814490+jjohnson42@users.noreply.github.com> (cherry picked from commit6e33661fc0)
This commit is contained in:
committed by
github-actions[bot]
parent
36823339b3
commit
24f95a98b2
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user