fixed bug 2865553
git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@4224 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd
This commit is contained in:
parent
556cffa903
commit
dcf192a350
@ -981,6 +981,7 @@ sub setobjdefs
|
||||
|
||||
my @setattrlist=();
|
||||
my @checkedattrs;
|
||||
my $invalidattr;
|
||||
|
||||
foreach my $this_attr (@{$datatype->{'attrs'}})
|
||||
{
|
||||
@ -1042,18 +1043,26 @@ sub setobjdefs
|
||||
}
|
||||
xCAT::MsgUtils->message("I", $rsp, $::callback);
|
||||
push(@checkedattrs, $attr_name);
|
||||
if ( $invalidattr->{$attr_name}->{valid} ne 1 ) {
|
||||
$invalidattr->{$attr_name}->{valid} = 0;
|
||||
$invalidattr->{$attr_name}->{condition} = "\'$check_attr=$check_value\'";
|
||||
}
|
||||
|
||||
next;
|
||||
}
|
||||
|
||||
if ( !($objhash{$objname}{$check_attr} =~ /\b$check_value\b/) && !($DBattrvals{$objname}{$check_attr} =~ /\b$check_value\b/) )
|
||||
{
|
||||
my $rsp;
|
||||
push @{$rsp->{data}}, "Cannot set the \'$attr_name\' attribute unless \'$check_attr=$check_value\'.\n";
|
||||
xCAT::MsgUtils->message("E", $rsp, $::callback);
|
||||
next;
|
||||
if ( $invalidattr->{$attr_name}->{valid} ne 1 ) {
|
||||
$invalidattr->{$attr_name}->{valid} = 0;
|
||||
$invalidattr->{$attr_name}->{condition} = "\'$check_attr=$check_value\'";
|
||||
|
||||
}
|
||||
|
||||
next;
|
||||
}
|
||||
}
|
||||
$invalidattr->{$attr_name}->{valid} = 1;
|
||||
|
||||
# get the info needed to write to the DB table
|
||||
#
|
||||
@ -1173,6 +1182,15 @@ sub setobjdefs
|
||||
|
||||
} # end - foreach attribute
|
||||
|
||||
my $rsp;
|
||||
foreach my $att (keys %$invalidattr) {
|
||||
if ( $invalidattr->{$att}->{valid} ne 1) {
|
||||
my $tt = $invalidattr->{$att}->{valid};
|
||||
push @{$rsp->{data}}, "Cannot set the attr=\'$att\' attribute unless $invalidattr->{$att}->{condition}.\n";
|
||||
xCAT::MsgUtils->message("E", $rsp, $::callback);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
# TODO - need to get back to this
|
||||
if (0) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user