mirror of
				https://github.com/xcat2/xcat-core.git
				synced 2025-10-31 19:32:31 +00:00 
			
		
		
		
	configfpc updated to exit when a MAC address cannot be resolved to an FPC node definition
This commit is contained in:
		| @@ -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; | ||||
| 		} | ||||
| 	} | ||||
|  | ||||
|   | ||||
		Reference in New Issue
	
	Block a user