From fed8cd768568b64237a7e712aa259188edb808cf Mon Sep 17 00:00:00 2001 From: jjhua Date: Wed, 18 Apr 2012 00:51:33 +0000 Subject: [PATCH] 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 --- xCAT-server/lib/perl/xCAT/PPC.pm | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/xCAT-server/lib/perl/xCAT/PPC.pm b/xCAT-server/lib/perl/xCAT/PPC.pm index a909fe58b..040121845 100644 --- a/xCAT-server/lib/perl/xCAT/PPC.pm +++ b/xCAT-server/lib/perl/xCAT/PPC.pm @@ -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