From 831a3b6e04cce737f951a251f44ce4612df10180 Mon Sep 17 00:00:00 2001 From: chenglch Date: Tue, 18 Apr 2017 14:46:45 +0800 Subject: [PATCH] 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 --- perl-xCAT/xCAT/DBobjUtils.pm | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/perl-xCAT/xCAT/DBobjUtils.pm b/perl-xCAT/xCAT/DBobjUtils.pm index 31bc6c14a..5c9679688 100755 --- a/perl-xCAT/xCAT/DBobjUtils.pm +++ b/perl-xCAT/xCAT/DBobjUtils.pm @@ -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)";