2
0
mirror of https://github.com/xcat2/xcat-core.git synced 2025-08-10 21:40:14 +00:00

nodelist table object should not fetch the attribs in groups

This patch intent to fix the undef reference for nodelist temporarily.

partial-issue #1011
This commit is contained in:
chenglch
2016-05-03 22:43:11 -04:00
parent 60a06d04e8
commit 951aa06963

View File

@@ -2564,7 +2564,7 @@ sub getNodeAttribs_nosub_returnany
if(defined{$data}) { #if there was some data for the node, loop through and check it
foreach $result (@results) {
foreach $attrib (keys %attribsToDo) {
if (defined($result) && defined($result->{$attrib})
if (defined($result) && defined($result->{$attrib}) && $self->{tabname} ne 'nodelist'
&& @hierarchy_attrs && grep (/^$attrib$/, @hierarchy_attrs) ) {
$result->{$attrib} .= ',+=NEXTRECORD';
}
@@ -2580,6 +2580,16 @@ sub getNodeAttribs_nosub_returnany
return @results;
}
if ($self->{tabname} eq 'nodelist') {
return @results;
}
# As self->nodelist is a weak reference, if error haddpens, log it.
if (!defined($self->{nodelist})) {
xCAT::MsgUtils->message("S","xcat Table: Unexpected error, nodelist object is undef.");
return undef;
}
#find the groups for this node
my ($nodeghash) = $self->{nodelist}->getAttribs({node => $node}, 'groups');