change the way of getting node type

git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@9752 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd
This commit is contained in:
yinle 2011-06-07 08:25:56 +00:00
parent e56933c733
commit 076c9aaabc

View File

@ -160,19 +160,22 @@ sub parse_args {
}
# Check whether the hardware type of nodes are fsp or cec
my $nodetype_tb = xCAT::Table->new('nodetype');
unless ($nodetype_tb) {
return ([undef, "Error: Cannot open the nodetype table"]);
}
#my $nodetype_tb = xCAT::Table->new('nodetype');
#unless ($nodetype_tb) {
# return ([undef, "Error: Cannot open the nodetype table"]);
#}
my $nodetype_v = $nodetype_tb->getNodesAttribs($nodes, ['nodetype']);
#my $nodetype_v = $nodetype_tb->getNodesAttribs($nodes, ['nodetype']);
my $nodetyperef = xCAT::DBobjUtils->getnodetype($nodes);
my $i = 0;
foreach my $node (@{$nodes}) {
if ($nodetype_v->{$node}->[0]->{'nodetype'} ne 'fsp' &&
$nodetype_v->{$node}->[0]->{'nodetype'} ne 'cec') {
if (@$nodetyperef[$i] ne 'fsp' &&
@$nodetyperef[$i] ne 'cec') {
push @notfspnodes, $node;
}
$i++;
}
$nodetype_tb->close();
#$nodetype_tb->close();
if (@notfspnodes) {
return ([undef, "Error: The hardware type of following nodes are not fsp or cec: ".join(',', @notfspnodes)]);