From 95c78b333cccbbb988286b3eafae4f522102e944 Mon Sep 17 00:00:00 2001 From: Jarrod Johnson Date: Tue, 2 Oct 2018 15:03:05 -0400 Subject: [PATCH] Support multiple groups in nodech ^= --- xCAT-server/lib/xcat/plugins/tabutils.pm | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/xCAT-server/lib/xcat/plugins/tabutils.pm b/xCAT-server/lib/xcat/plugins/tabutils.pm index c850a5814..0eb17bc45 100644 --- a/xCAT-server/lib/xcat/plugins/tabutils.pm +++ b/xCAT-server/lib/xcat/plugins/tabutils.pm @@ -1749,14 +1749,17 @@ sub nodech my $cent = $tabhdl->getNodeAttribs($entity, [$key]); 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; - } - } #else, what they asked for is the case alredy + foreach my $subval (split/,/, $val) { + if ($curval) { + 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 + } } } # end of while @valoppairs } # end of foreach column specified for this table