2
0
mirror of https://github.com/xcat2/xcat-core.git synced 2025-05-29 17:23:08 +00:00

Make tables which contain nodecol column inheritable (#2785)

Actually, the subroutine getNodeAttribs already fetch the attributes
related to the groups, but the `defobj` related method ignore these
attributes as it is not node column although nodecol is set. This
patch treat nodecol column as node to make the attributes in these
table inheritable.

fix-issue: #2450
This commit is contained in:
chenglch 2017-04-18 14:46:45 +08:00 committed by yangsong
parent 6f67a66f32
commit 831a3b6e04

View File

@ -488,7 +488,9 @@ sub getobjdefs
foreach my $lookup_attr (keys %{ $tabentry{'lookup_attrs'} }) {
# Check whether the attribute is already in %tabhash
# The %tabhash is for performance considerations
if (($lookup_attr eq 'node') && ($objtype eq 'node')) {
my $tabspec = $xCAT::Schema::tabspec{$lookup_table};
my $nodecol = $tabspec->{'nodecol'} if defined($tabspec->{'nodecol'});
if (($lookup_attr eq 'node' && $objtype eq 'node') || (defined($nodecol) && $objtype eq 'node')) {
if (defined($tabhash{$lookup_table}{$objname}{$tabattr})) {
if ($verbose == 1) {
$objhash{$objname}{$attr} = "$tabhash{$lookup_table}{$objname}{$tabattr}\t(Table:$lookup_table - Key:$lookup_attr - Column:$tabattr)";