fix the error of the command mkhwconn frame -s

git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/branches/2.7@12258 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd
This commit is contained in:
jjhua 2012-04-18 00:51:33 +00:00
parent 28ffd3d30d
commit fed8cd7685

View File

@ -839,6 +839,31 @@ sub preprocess_nodes {
#my $hcp = $hcps_will->{$node};
#@$d[3] = $hcp;
my $mtms = @$d[2];
if( $request->{command} =~ /^(mkhwconn|lshwconn|rmhwconn)$/ && grep (/^-s$/, @{$request->{arg}})) {
my $sfp;
unless ( $request->{sfp} ) {
my $ppctab = xCAT::Table->new('ppc');
if ( $ppctab ) {
my $ent = $ppctab->getNodeAttribs( $node, [qw(sfp)]);
if( $request->{command} =~ /^(lshwconn|rmhwconn)$/ && !defined($ent)) {
send_msg( $request, 1, "$node: No sfp defined in the ppc table.");
next;
}
$sfp = $ent->{sfp};
}
} else {
$sfp = $request->{sfp};
}
if( $request->{command} =~ /^(mkhwconn)$/ && !defined($sfp)) {
send_msg( $request, 1, "$node: Please specify the sfp in the commands or in the ppc table.");
next;
}
$request->{fsp_api} = 0;
$request->{hwtype} = "hmc";
$hcp = $sfp;
}
######################################
# Special case for mkhwconn