fix for bug 2790619 chdef add member to the group failed, a regular expression match issue in defch
git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@3367 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd
This commit is contained in:
parent
2e1c6c5599
commit
d133bc2afb
@ -1001,13 +1001,18 @@ sub setobjdefs
|
||||
# add new to existing - at the end - comma separated
|
||||
if (defined($DBattrvals{$objname}{$attr_name}))
|
||||
{
|
||||
# if it's not already in the list!
|
||||
if (!($DBattrvals{$objname}{$attr_name} =~ /\b$objhash{$objname}{$attr_name}\b/) )
|
||||
{
|
||||
$val = "$DBattrvals{$objname}{$attr_name},$objhash{$objname}{$attr_name}";
|
||||
} else {
|
||||
$val = "$DBattrvals{$objname}{$attr_name}";
|
||||
}
|
||||
# add the attr into the list if it's not already in the list!
|
||||
# and avoid the duplicate values
|
||||
my @DBattrarray = split(',', $DBattrvals{$objname}{$attr_name});
|
||||
my @objhasharray = split(',', $objhash{$objname}{$attr_name});
|
||||
foreach my $objattr (@objhasharray)
|
||||
{
|
||||
if (!grep(/^\Q$objattr\E$/, @DBattrarray))
|
||||
{
|
||||
push @DBattrarray, $objattr;
|
||||
}
|
||||
}
|
||||
$val = join(',', @DBattrarray);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user