mirror of
				https://github.com/xcat2/xcat-core.git
				synced 2025-10-26 08:55:24 +00:00 
			
		
		
		
	Merge pull request #1558 from whowutwut/discovery_logs
Fix some wording in the log messages generated during HW discovery
This commit is contained in:
		| @@ -42,7 +42,7 @@ sub process_request { | ||||
| 	    } | ||||
| 	} | ||||
|  | ||||
|         xCAT::MsgUtils->message("S", "xcat.discovery.aaadiscovery: ($mac) Get a discover request"); | ||||
|         xCAT::MsgUtils->message("S", "xcat.discovery.aaadiscovery: ($mac) Got a discovery request, attempting to discover the node..."); | ||||
|         $req->{discoverymethod}->[0] = 'undef'; | ||||
|         $req->{_xcat_clientmac}->[0] = $mac; | ||||
|         xCAT::DiscoveryUtils->update_discovery_data($req); | ||||
|   | ||||
| @@ -4374,7 +4374,6 @@ sub process_request { | ||||
|         return; | ||||
|     } | ||||
|  | ||||
|     xCAT::MsgUtils->message("S", "xcat.discovery.blade: ($request->{_xcat_clientmac}->[0]) Processing discovery request"); | ||||
|     my $mptab = xCAT::Table->new("mp"); | ||||
|     unless ($mptab) { return 2; } | ||||
|     my @bladents = $mptab->getAllNodeAttribs([qw(node)]); | ||||
| @@ -4453,7 +4452,7 @@ sub process_request { | ||||
|        } | ||||
|     } | ||||
|     unless ($node) { | ||||
|       xCAT::MsgUtils->message("S", "xcat.discovery.blade: ($request->{_xcat_clientmac}->[0]) Error: Could not find any node"); | ||||
|       xCAT::MsgUtils->message("S", "xcat.discovery.blade: ($request->{_xcat_clientmac}->[0]) Warning: Could not find any nodes using blade-based discovery"); | ||||
|       return 1; #failure | ||||
|     } | ||||
|     if ($request->{mtm} and $request->{mtm} =~ /^(\w{4})/) { | ||||
| @@ -4469,7 +4468,7 @@ sub process_request { | ||||
|        undef $mactab; | ||||
|     } | ||||
|  | ||||
|     xCAT::MsgUtils->message("S", "xcat.discovery.blade: ($request->{_xcat_clientmac}->[0]) Find node $node for the discovery request"); | ||||
|     xCAT::MsgUtils->message("S", "xcat.discovery.blade: ($request->{_xcat_clientmac}->[0]) Found node: $node"); | ||||
|     #my %request = ( | ||||
|     #  command => ['makedhcp'], | ||||
|     #  node => [$macmap{$mac}] | ||||
|   | ||||
| @@ -689,7 +689,6 @@ sub process_request { | ||||
|                     # The findme request had been processed by other module, just return | ||||
|                     return; | ||||
|                 } | ||||
|                 xCAT::MsgUtils->message("S", "xcat.discovery.hpblade: ($request->{_xcat_clientmac}->[0]) Processing discovery request"); | ||||
| 		my $mptab = xCAT::Table->new("mp"); | ||||
| 		unless ($mptab) { return 2; } | ||||
| 		my @bladents = $mptab->getAllNodeAttribs([qw(node)]); | ||||
| @@ -733,7 +732,7 @@ sub process_request { | ||||
| 			} | ||||
| 		} | ||||
| 		unless ($macmap{$mac}) {  | ||||
|                         xCAT::MsgUtils->message("S", "xcat.discovery.hpblade: ($request->{_xcat_clientmac}->[0]) Error: Could not find any node"); | ||||
|                         xCAT::MsgUtils->message("S", "xcat.discovery.hpblade: ($request->{_xcat_clientmac}->[0]) Warning: Could not find any nodes using hpblade-based discovery"); | ||||
| 			return 1; #failure | ||||
| 		} | ||||
|                 # The discovered command will update mac table, no need to update here | ||||
| @@ -745,7 +744,7 @@ sub process_request { | ||||
| 		#  node => [$macmap{$mac}] | ||||
| 		#  ); | ||||
| 		#$doreq->(\%request); | ||||
|                 xCAT::MsgUtils->message("S", "xcat.discovery.hpblade: ($request->{_xcat_clientmac}->[0]) Find node:$macmap{$mac} for the discovery request"); | ||||
|                 xCAT::MsgUtils->message("S", "xcat.discovery.hpblade: ($request->{_xcat_clientmac}->[0]) Found node: $macmap{$mac}"); | ||||
|                 my $req={%$request}; | ||||
| 		$req->{command}=['discovered']; | ||||
| 		$req->{noderange} = [$macmap{$mac}]; | ||||
|   | ||||
| @@ -375,7 +375,7 @@ sub process_request { | ||||
|         syslog("local4|info", "The attribute bmcinband is specified, just remove the temp BMC node if there is"); | ||||
|         if (defined($request->{bmc_node}) and defined($request->{bmc_node}->[0]))  { | ||||
|             my $bmc_node = $request->{bmc_node}->[0]; | ||||
|             syslog("local4|info", "Find BMC $bmc_node, so remove it"); | ||||
|             syslog("local4|info", "Found node corresponding to BMC=$bmc_node, removing it..."); | ||||
|             $doreq->({ command => ['rmdef'], arg => [$bmc_node]}); | ||||
|         } | ||||
|     } else { | ||||
|   | ||||
| @@ -62,9 +62,6 @@ sub findme { | ||||
|         return; | ||||
|     } | ||||
|  | ||||
|     # do the sequential discovery | ||||
|     xCAT::MsgUtils->message("S", "xcat.discovery.seqdiscovery: ($request->{_xcat_clientmac}->[0]) Processing discovery request"); | ||||
|  | ||||
|     # Get the parameters for the sequential discovery | ||||
|     my %param; | ||||
|     my @params = split (',', $SEQdiscover[0]); | ||||
| @@ -373,7 +370,7 @@ sub findme { | ||||
|  | ||||
|         # call the discovered command to update the discovery request to a node | ||||
|           | ||||
|         xCAT::MsgUtils->message("S", "xcat.discovery.seqdiscovery: ($request->{_xcat_clientmac}->[0]) Find node:$node for the discovery request"); | ||||
|         xCAT::MsgUtils->message("S", "xcat.discovery.seqdiscovery: ($request->{_xcat_clientmac}->[0]) Found node: $node"); | ||||
|         $request->{discoverymethod} = ['sequential']; | ||||
|         my $req = {%$request}; | ||||
|         $req->{command}=['discovered']; | ||||
| @@ -386,7 +383,7 @@ sub findme { | ||||
|         undef $mactab; | ||||
|     } else { | ||||
|         nodediscoverstop($callback, undef, "node names"); | ||||
|         xCAT::MsgUtils->message("S", "xcat.discovery.seqdiscovery: ($request->{_xcat_clientmac}->[0]) Error: Could not find any node"); | ||||
|         xCAT::MsgUtils->message("S", "xcat.discovery.seqdiscovery: ($request->{_xcat_clientmac}->[0]) Warning: Could not find any nodes using sequential-based discovery"); | ||||
|         return; | ||||
|     } | ||||
|  | ||||
|   | ||||
| @@ -278,7 +278,6 @@ sub process_request { | ||||
|             return; | ||||
|         } | ||||
|         $mac = $req->{_xcat_clientmac}->[0]; | ||||
|         xCAT::MsgUtils->message("S", "xcat.discovery.switch: ($mac) Processing discovery request"); | ||||
| 	if (defined $req->{nodetype} and $req->{nodetype}->[0] eq 'virtual') { | ||||
| 	    #Don't attempt switch discovery of a  VM Guest | ||||
| 	    #TODO: in this case, we could/should find the host system  | ||||
| @@ -313,7 +312,7 @@ sub process_request { | ||||
|         } | ||||
| 	  | ||||
| 	if ($node) { | ||||
|             xCAT::MsgUtils->message("S", "xcat.discovery.switch: ($req->{_xcat_clientmac}->[0]) Find node:$node for the discovery request"); | ||||
|             xCAT::MsgUtils->message("S", "xcat.discovery.switch: ($req->{_xcat_clientmac}->[0]) Found node: $node"); | ||||
|             # No need to write mac table here, 'discovered' command will write | ||||
| 	    # my $mactab = xCAT::Table->new('mac',-create=>1); | ||||
| 	    # $mactab->setNodeAttribs($node,{mac=>$mac}); | ||||
| @@ -332,7 +331,7 @@ sub process_request { | ||||
| 	    %{$request}=();#Clear req structure, it's done.. | ||||
| 	    undef $mactab; | ||||
| 	} else {  | ||||
|             xCAT::MsgUtils->message("S", "xcat.discovery.switch: ($req->{_xcat_clientmac}->[0]) Error: Could not find any node"); | ||||
|             xCAT::MsgUtils->message("S", "xcat.discovery.switch: ($req->{_xcat_clientmac}->[0]) Warning: Could not find any nodes using switch-based discovery"); | ||||
| 	} | ||||
|     } | ||||
| } | ||||
|   | ||||
| @@ -22,7 +22,6 @@ sub findme { | ||||
|     } | ||||
|     my @attr_array = (); | ||||
|     my $mtms = $request->{'mtm'}->[0]."*".$request->{'serial'}->[0];  | ||||
|     xCAT::MsgUtils->message("S", "xcat.discovery.mtms: ($request->{_xcat_clientmac}->[0]) Processing discovery request"); | ||||
|     my $tmp_nodes = $::XCATVPDHASH{$mtms}; | ||||
|     my @nodes = (); | ||||
|     my $bmc_node; | ||||
| @@ -35,14 +34,14 @@ sub findme { | ||||
|     } | ||||
|     my $nodenum = $#nodes; | ||||
|     if ($nodenum < 0) { | ||||
|         xCAT::MsgUtils->message("S", "xcat.discovery.mtms: ($request->{_xcat_clientmac}->[0]) Error: Could not find any node"); | ||||
|         xCAT::MsgUtils->message("S", "xcat.discovery.mtms: ($request->{_xcat_clientmac}->[0]) Warning: Could not find any nodes using mtms-based discovery"); | ||||
|         return; | ||||
|     } elsif ($nodenum > 0) { | ||||
|         xCAT::MsgUtils->message("S", "xcat.discovery.mtms: ($request->{_xcat_clientmac}->[0]) Error: More than one node were found"); | ||||
|         return; | ||||
|     } | ||||
|     { | ||||
|         xCAT::MsgUtils->message("S", "xcat.discovery.mtms: ($request->{_xcat_clientmac}->[0]) Find node:$nodes[0] for the discovery request"); | ||||
|         xCAT::MsgUtils->message("S", "xcat.discovery.mtms: ($request->{_xcat_clientmac}->[0]) Found node: $nodes[0]"); | ||||
|         $request->{discoverymethod}->[0] = 'mtms'; | ||||
|         my $req = {%$request}; | ||||
|         $req->{command} = ['discovered']; | ||||
|   | ||||
| @@ -17,15 +17,14 @@ sub process_request { | ||||
|     my $cb = shift; | ||||
|     my $doreq = shift; | ||||
|     if ($req->{command}->[0] eq 'findme') { | ||||
|         xCAT::MsgUtils->message("S", "xcat.discovery.zzzdiscovery: ($req->{_xcat_clientmac}->[0]) Finish to process the discovery request"); | ||||
|         if (!defined($req->{discoverymethod}) or !defined($req->{discoverymethod}->[0]) or ($req->{discoverymethod}->[0] eq 'undef'))  { | ||||
|             my $rsp = {}; | ||||
|             $rsp->{error}->[0] = "The discovery request can not be processed"; | ||||
|             $cb->($rsp); | ||||
|             xCAT::MsgUtils->message("S", "xcat.discovery.zzzdiscovery: ($req->{_xcat_clientmac}->[0]) Failed to be processed"); | ||||
|             xCAT::MsgUtils->message("S", "xcat.discovery.zzzdiscovery: ($req->{_xcat_clientmac}->[0]) Failed to discover the node."); | ||||
|             return; | ||||
|         } | ||||
|         xCAT::MsgUtils->message("S", "xcat.discovery.zzzdiscovery: ($req->{_xcat_clientmac}->[0]) Successfully processed by $req->{discoverymethod}->[0] method"); | ||||
|         xCAT::MsgUtils->message("S", "xcat.discovery.zzzdiscovery: ($req->{_xcat_clientmac}->[0]) Successfully discovered the node using $req->{discoverymethod}->[0] discovery method."); | ||||
|         return; | ||||
|     } | ||||
| } | ||||
|   | ||||
		Reference in New Issue
	
	Block a user