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
This commit is contained in:
daniceexi 2011-12-08 13:54:20 +00:00
parent 4da151fcd9
commit 2ff2f03674
2 changed files with 2 additions and 28 deletions

View File

@ -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};
}

View File

@ -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
{