diff --git a/perl-xCAT/xCAT/Table.pm b/perl-xCAT/xCAT/Table.pm index 51a603671..3ca312882 100644 --- a/perl-xCAT/xCAT/Table.pm +++ b/perl-xCAT/xCAT/Table.pm @@ -917,7 +917,8 @@ sub getNodesAttribs { } my $rethash; foreach (@$nodelist) { - $rethash->{$_} = $self->getNodeAttribs($_,\@attribs); + my @nodeentries=$self->getNodeAttribs($_,\@attribs); + $rethash->{$_} = \@nodeentries; #$self->getNodeAttribs($_,\@attribs); } $self->{_use_cache} = 0; $self->{nodelist}->{_use_cache} = 0; diff --git a/xCAT-server/lib/xcat/plugins/blade.pm b/xCAT-server/lib/xcat/plugins/blade.pm index d6157c22c..42b3c3d7a 100644 --- a/xCAT-server/lib/xcat/plugins/blade.pm +++ b/xCAT-server/lib/xcat/plugins/blade.pm @@ -1296,7 +1296,7 @@ sub build_depend { my $delay = 0; my $dep; - my @ent = $depset->{$node}; #$depstab->getNodeAttribs($node,[qw(nodedep msdelay cmd)]); + my @ent = @{$depset->{$node}}; #$depstab->getNodeAttribs($node,[qw(nodedep msdelay cmd)]); foreach my $h ( @ent ) { if ( grep(/^@$exargs[0]$/, split /,/, $h->{cmd} )) { if (exists($h->{nodedep})) { $dep=$h->{nodedep}; } @@ -1329,7 +1329,7 @@ sub build_depend { my @namelist = keys %dp; my $mphash = $mptab->getNodesAttribs(\@namelist,['mpa','id']); while(my ($name,$h) = each(%dp) ) { - my $ent=$mphash->{$name}; #$mptab->getNodeAttribs($name,['mpa', 'id']); + my $ent=$mphash->{$name}->[0]; #$mptab->getNodeAttribs($name,['mpa', 'id']); if (!defined($ent->{mpa})) { return("no mpa defined for node $name"); } @@ -1341,7 +1341,7 @@ sub build_depend { my $mpsubhash = $mptab->getNodesAttribs(\@namelist,['mpa','id']); foreach ( keys %$h ) { if ( $h->{$_} =~ /(^\d+$)/ ) { - my $ent=$mpsubhash->{$_}; #$mptab->getNodeAttribs($_,['mpa', 'id']); + my $ent=$mpsubhash->{$_}->[0]; #$mptab->getNodeAttribs($_,['mpa', 'id']); if (!defined($ent->{mpa})) { return("no mpa defined for node $_"); } @@ -1397,7 +1397,7 @@ sub preprocess_request { my %mpa_hash=(); my $mptabhash = $mptab->getNodesAttribs($noderange,['mpa','id']); foreach my $node (@$noderange) { - my $ent=$mptabhash->{$node}; #$mptab->getNodeAttribs($node,['mpa', 'id']); + my $ent=$mptabhash->{$node}->[0]; #$mptab->getNodeAttribs($node,['mpa', 'id']); if (defined($ent->{mpa})) { push @{$mpa_hash{$ent->{mpa}}{nodes}}, $node;} else { $callback->({data=>["no mpa defined for node $node"]}); @@ -1448,7 +1448,7 @@ sub build_more_info{ my %mpa_hash=(); my $mptabhash = $mptab->getNodesAttribs($noderange,['mpa','id']); foreach my $node (@$noderange) { - my $ent=$mptabhash->{$node}; #$mptab->getNodeAttribs($node,['mpa', 'id']); + my $ent=$mptabhash->{$node}->[0]; #$mptab->getNodeAttribs($node,['mpa', 'id']); if (defined($ent->{mpa})) { push @{$mpa_hash{$ent->{mpa}}{nodes}}, $node;} else { $callback->({data=>["no mpa defined for node $node"]}); diff --git a/xCAT-server/sbin/xcatd b/xCAT-server/sbin/xcatd index 4ffbb5ed8..38c6adac9 100755 --- a/xCAT-server/sbin/xcatd +++ b/xCAT-server/sbin/xcatd @@ -633,7 +633,7 @@ sub plugin_command { } my $hdlrcache = $hdlrtable->getNodesAttribs(\@nodes,\@columns); foreach $node (@nodes) { - my $attribs = $hdlrcache->{$node}; #$hdlrtable->getNodeAttribs($node,\@columns); + my $attribs = $hdlrcache->{$node}->[0]; #$hdlrtable->getNodeAttribs($node,\@columns); unless (defined($attribs)) { next; } #TODO: This really ought to craft an unsupported response for this request foreach (@columns) { my $col=$_;