From 086b0c0db7b154da7bcf6c1cb038e509be09851b Mon Sep 17 00:00:00 2001 From: Jarrod Johnson Date: Wed, 3 Oct 2018 08:52:04 -0400 Subject: [PATCH] Fix ,= operator adding duplicate groups if , delimited --- 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 0eb17bc45..2033d898a 100644 --- a/xCAT-server/lib/xcat/plugins/tabutils.pm +++ b/xCAT-server/lib/xcat/plugins/tabutils.pm @@ -1730,11 +1730,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;