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:
parent
4da151fcd9
commit
2ff2f03674
@ -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};
|
||||
}
|
||||
|
@ -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
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user