From 2ff2f036746c1284e071e3cd3c98d4f73d17bd47 Mon Sep 17 00:00:00 2001 From: daniceexi Date: Thu, 8 Dec 2011 13:54:20 +0000 Subject: [PATCH] replace the getAttribs with getNodeAttribs for regular expression support git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@11187 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- xCAT-server/lib/xcat/plugins/blade.pm | 2 +- xCAT-server/lib/xcat/plugins/litetree.pm | 28 +----------------------- 2 files changed, 2 insertions(+), 28 deletions(-) diff --git a/xCAT-server/lib/xcat/plugins/blade.pm b/xCAT-server/lib/xcat/plugins/blade.pm index f8c5e2909..61b6400c1 100644 --- a/xCAT-server/lib/xcat/plugins/blade.pm +++ b/xCAT-server/lib/xcat/plugins/blade.pm @@ -3757,7 +3757,7 @@ sub network { my $hosttab = xCAT::Table->new( 'hosts' ); if ($hosttab) { - my ($ent) = $hosttab->getAttribs({node=>$mpa},'ip'); + my ($ent) = $hosttab->getNodeAttribs($mpa,['ip']); if (defined($ent)) { $ip = $ent->{ip}; } diff --git a/xCAT-server/lib/xcat/plugins/litetree.pm b/xCAT-server/lib/xcat/plugins/litetree.pm index b306d7839..0f5e5f5d8 100644 --- a/xCAT-server/lib/xcat/plugins/litetree.pm +++ b/xCAT-server/lib/xcat/plugins/litetree.pm @@ -319,33 +319,7 @@ sub getNodeData { if ($type eq "location") { # get locations with specific nodes - push @imageInfo, $tab->getAttribs({node => $node}, @attrs); - - if (!defined $imageInfo[0]) - { - # maybe node belongs to nodegroup - # try to find it in groups - my @tmpnodes = join(',', $node); - - # group info in nodelist tab - my $nltab = xCAT::Table->new('nodelist'); - my $nltabdata = $nltab->getNodesAttribs(\@tmpnodes, ['node', 'groups']); - - my $data = $nltabdata->{$node}->[0]; - my @grps = split(',', $data->{groups}); - foreach my $g (@grps) - { - chomp $g; - my $info = $tab->getAttribs({node => $g}, @attrs); - if(defined $info) - { - push @imageInfo, $info; - } - - # return once get one record - last if (defined $imageInfo[1]); - } - } + push @imageInfo, $tab->getNodeAttribs($node, @attrs); } else {