From 7e1b001ea4a827740602d9e47e901a2f4297a34c Mon Sep 17 00:00:00 2001 From: John Simpson Date: Mon, 28 Oct 2013 16:00:56 -0400 Subject: [PATCH] configfpc updated to exit when a MAC address cannot be resolved to an FPC node definition --- xCAT-server/lib/xcat/plugins/configfpc.pm | 31 ++++++++++------------- 1 file changed, 14 insertions(+), 17 deletions(-) diff --git a/xCAT-server/lib/xcat/plugins/configfpc.pm b/xCAT-server/lib/xcat/plugins/configfpc.pm index de1ed3692..e74f78d7d 100644 --- a/xCAT-server/lib/xcat/plugins/configfpc.pm +++ b/xCAT-server/lib/xcat/plugins/configfpc.pm @@ -43,6 +43,7 @@ sub process_request { 'help|h|?' => \$::opt_h, 'i|I=s' => \$::opt_I, 'verbose|V' => \$::opt_V, + 'version|v' => \$::opt_v, ); # Option -h for Help @@ -93,9 +94,9 @@ sub configfpc_usage { push @{ $rsp->{data} }, "\nUsage: configfpc - Configure the NeXtScale FPCs.i This command requires the -i option to give specify which network adapter to use to look for the FPCs.\n"; push @{ $rsp->{data} }, - " configfpc -i interface \n "; + " configfpc -i interface_adapter \n "; push @{ $rsp->{data} }, - " configfpc [-V|--verbose] -i interface \n "; + " configfpc [-V|--verbose] -i adapter_interface \n "; push @{ $rsp->{data} }, " configfpc [-h|--help|-?] \n"; xCAT::MsgUtils->message( "I", $rsp, $::CALLBACK ); return 0; @@ -217,8 +218,7 @@ sub configfpc { } else { my %rsp; push@{ $rsp{data} }, "No FPC found that is associated with MAC address $fpcmac.\nCheck to see if the switch and switch table contain the information needed to locate this FPC MAC"; - xCAT::MsgUtils->message( "E", \%rsp, $callback ); - $foundfpc = 0; + xCAT::MsgUtils->message( "I", \%rsp, $callback ); } # @@ -231,19 +231,16 @@ sub configfpc { } my $arpout = `arp -d $fpcip`; - if ( ($foundfpc==1) ) { # if the last FPC was found and processed - - # check for another FPC - $res = `LANG=C ping -c 1 -w 5 $fpcip 2>&1`; - if ( ($res =~ /100% packet loss/g) && ($foundfpc==1) ) { - my %rsp; - push@{ $rsp{data} }, "There are no more FPCs with the default IP address to process"; - xCAT::MsgUtils->message( "I", \%rsp, $callback ); - $foundfpc = 0; - } - else { - $foundfpc = 1; - } + # check for another FPC + $res = `LANG=C ping -c 1 -w 5 $fpcip 2>&1`; + if ( $res =~ /100% packet loss/g) { + my %rsp; + push@{ $rsp{data} }, "There are no more FPCs with the default IP address to process"; + xCAT::MsgUtils->message( "I", \%rsp, $callback ); + $foundfpc = 0; + } + else { + $foundfpc = 1; } }