2
0
mirror of https://github.com/xcat2/xcat-core.git synced 2025-09-07 02:38:15 +00:00

Support multiple groups in nodech ^=

This commit is contained in:
Jarrod Johnson
2018-10-02 15:03:05 -04:00
parent c0952404d5
commit 95c78b333c

View File

@@ -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