diff --git a/perl-xCAT/xCAT/PPCcfg.pm b/perl-xCAT/xCAT/PPCcfg.pm index 57142a474..45870141d 100644 --- a/perl-xCAT/xCAT/PPCcfg.pm +++ b/perl-xCAT/xCAT/PPCcfg.pm @@ -59,6 +59,8 @@ sub parse_args { "sshcfg" ); my %rsp = ( + cec=> \@fsp, + frame=>\@bpa, fsp => \@fsp, bpa => \@bpa, ivm => \@ppc, @@ -67,39 +69,20 @@ sub parse_args { ############################################# # Get support command list ############################################# - #my $sitetab = xCAT::Table->new( 'nodetype' ); - #my $nodes = $request->{node}; - #foreach (@$nodes) { - # if ( defined( $sitetab )) { - # my ($ent) = $sitetab->getAttribs({ node=>$_},'nodetype'); - # if ( defined($ent) ) { - # $request->{hwtype} = $ent->{nodetype}; - # last; - # } - # - # } - # - #} - my @newnodes = (); + my $sitetab = xCAT::Table->new( 'nodetype' ); my $nodes = $request->{node}; - foreach my $snode(@$nodes) { - my $ntype = xCAT::DBobjUtils->getnodetype($snode); - if ( $ntype =~ /^(cec|frame)$/) { - my $children = xCAT::DBobjUtils->getchildren($snode); - unless( $children ) { - next; + foreach (@$nodes) { + if ( defined( $sitetab )) { + my ($ent) = $sitetab->getAttribs({ node=>$_},'nodetype'); + if ( defined($ent) ) { + $request->{hwtype} = $ent->{nodetype}; + last; } - foreach (@$children) { - push @newnodes, $_; - } - $request->{hwtype} = ($ntype =~ /^cec$/) ? "fsp" : "bpa"; - } else { - push @newnodes, $snode; - $request->{hwtype} = $ntype; + } + } - $request->{node} = \@newnodes; - #$request->{noderange} = \@newnodes; + my $supported = $rsp{$request->{hwtype}}; #############################################