From 5c17670c9eaec0c2847a1ab06ad4190ba82cf6f6 Mon Sep 17 00:00:00 2001 From: XuWei Date: Thu, 22 Sep 2016 03:07:10 -0400 Subject: [PATCH 1/3] fix issue 1504 & 1854, modified discovery messages --- xCAT-server/lib/xcat/plugins/blade.pm | 4 ++-- xCAT-server/lib/xcat/plugins/hpblade.pm | 4 ++-- xCAT-server/lib/xcat/plugins/nodediscover.pm | 13 ++++++------- xCAT-server/lib/xcat/plugins/seqdiscovery.pm | 4 ++-- xCAT-server/lib/xcat/plugins/switch.pm | 4 ++-- xCAT-server/lib/xcat/plugins/typemtms.pm | 6 +++--- 6 files changed, 17 insertions(+), 18 deletions(-) diff --git a/xCAT-server/lib/xcat/plugins/blade.pm b/xCAT-server/lib/xcat/plugins/blade.pm index 7ff063a48..f5c042d5b 100644 --- a/xCAT-server/lib/xcat/plugins/blade.pm +++ b/xCAT-server/lib/xcat/plugins/blade.pm @@ -4546,7 +4546,7 @@ sub process_request { } } unless ($node) { - xCAT::MsgUtils->message("S", "xcat.discovery.blade: ($request->{_xcat_clientmac}->[0]) Warning: Could not find any nodes using blade-based discovery"); + xCAT::MsgUtils->message("S", "xcat.discovery.blade: ($request->{_xcat_clientmac}->[0]) Warning: Could not find any node matching using blade-based discovery"); return 1; #failure } if ($request->{mtm} and $request->{mtm} =~ /^(\w{4})/) { @@ -4562,7 +4562,7 @@ sub process_request { undef $mactab; } - xCAT::MsgUtils->message("S", "xcat.discovery.blade: ($request->{_xcat_clientmac}->[0]) Found node: $node"); + xCAT::MsgUtils->message("S", "xcat.discovery.blade: ($request->{_xcat_clientmac}->[0]) Found node: $node matching for discovery request"); #my %request = ( # command => ['makedhcp'], diff --git a/xCAT-server/lib/xcat/plugins/hpblade.pm b/xCAT-server/lib/xcat/plugins/hpblade.pm index edab62629..4a5bba6e7 100755 --- a/xCAT-server/lib/xcat/plugins/hpblade.pm +++ b/xCAT-server/lib/xcat/plugins/hpblade.pm @@ -749,7 +749,7 @@ sub process_request { } } unless ($macmap{$mac}) { - xCAT::MsgUtils->message("S", "xcat.discovery.hpblade: ($request->{_xcat_clientmac}->[0]) Warning: Could not find any nodes using hpblade-based discovery"); + xCAT::MsgUtils->message("S", "xcat.discovery.hpblade: ($request->{_xcat_clientmac}->[0]) Warning: Could not find any node matching using hpblade-based discovery"); return 1; #failure } @@ -762,7 +762,7 @@ sub process_request { # node => [$macmap{$mac}] # ); #$doreq->(\%request); - xCAT::MsgUtils->message("S", "xcat.discovery.hpblade: ($request->{_xcat_clientmac}->[0]) Found node: $macmap{$mac}"); + xCAT::MsgUtils->message("S", "xcat.discovery.hpblade: ($request->{_xcat_clientmac}->[0]) Found node: $macmap{$mac} matching for discovery request"); my $req = {%$request}; $req->{command} = ['discovered']; $req->{noderange} = [ $macmap{$mac} ]; diff --git a/xCAT-server/lib/xcat/plugins/nodediscover.pm b/xCAT-server/lib/xcat/plugins/nodediscover.pm index 197591743..12d96ce43 100644 --- a/xCAT-server/lib/xcat/plugins/nodediscover.pm +++ b/xCAT-server/lib/xcat/plugins/nodediscover.pm @@ -420,23 +420,22 @@ sub process_request { return; } if (defined($request->{bmcinband})) { - 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", "Found node corresponding to BMC=$bmc_node, removing it..."); + xCAT::MsgUtils->message("S", "xcat.discovery.nodediscover: Removing discovered node definition: $bmc_node..."); my $rmcmd = "rmdef $bmc_node"; xCAT::Utils->runcmd($rmcmd, 0); if ($::RUNCMD_RC != 0) { - syslog("local4|info", "Failed to remove $bmc_node from xCAT"); + xCAT::MsgUtils->message("S", "xcat.discovery.nodediscover: Failed to remove $bmc_node from xCAT"); } else { - syslog("local4|info", "$bmc_node definition removed from xCAT"); + xCAT::MsgUtils->message("S", "xcat.discovery.nodediscover: $bmc_node definition removed from xCAT"); } } } else { # Only BMC that doesn't support in-band configuration need to run rspconfig out-of-band, such as S822L running in OPAL model - syslog("local4|info", "No bmcinband specified, need to configure BMC out-of-band"); + xCAT::MsgUtils->message("S", "No bmcinband specified, need to configure BMC out-of-band"); xCAT::Utils->cleanup_for_powerLE_hardware_discovery($request, $doreq); } @@ -453,7 +452,7 @@ sub process_request { Timeout => '1', Proto => 'tcp' ); - unless ($sock) { syslog("local4|err", "Failed to notify $clientip that it's actually $node."); return; } #Give up if the node won't hear of it. + unless ($sock) { xCAT::MsgUtils->message("S", "Failed to notify $clientip that it's actually $node."); return; } print $sock $restartstring; close($sock); @@ -463,7 +462,7 @@ sub process_request { #Update the discoverydata table to indicate the successful discovery xCAT::DiscoveryUtils->update_discovery_data($request); - syslog("local4|info", "$node has been discovered"); + xCAT::MsgUtils->message("S", "xcat.discovery.nodediscover: $node has been discovered so we can correlate the discovered definition to the pre-defined definition."); } 1; diff --git a/xCAT-server/lib/xcat/plugins/seqdiscovery.pm b/xCAT-server/lib/xcat/plugins/seqdiscovery.pm index fc668a0af..a3e4e4ef4 100755 --- a/xCAT-server/lib/xcat/plugins/seqdiscovery.pm +++ b/xCAT-server/lib/xcat/plugins/seqdiscovery.pm @@ -384,7 +384,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]) Found node: $node"); + xCAT::MsgUtils->message("S", "xcat.discovery.seqdiscovery: ($request->{_xcat_clientmac}->[0]) Found node: $node matching for discovery request"); $request->{discoverymethod} = ['sequential']; my $req = {%$request}; $req->{command} = ['discovered']; @@ -397,7 +397,7 @@ sub findme { undef $mactab; } else { nodediscoverstop($callback, undef, "node names"); - xCAT::MsgUtils->message("S", "xcat.discovery.seqdiscovery: ($request->{_xcat_clientmac}->[0]) Warning: Could not find any nodes using sequential-based discovery"); + xCAT::MsgUtils->message("S", "xcat.discovery.seqdiscovery: ($request->{_xcat_clientmac}->[0]) Warning: Could not find any node matching using sequential-based discovery"); return; } diff --git a/xCAT-server/lib/xcat/plugins/switch.pm b/xCAT-server/lib/xcat/plugins/switch.pm index ba3d1281f..c10121856 100644 --- a/xCAT-server/lib/xcat/plugins/switch.pm +++ b/xCAT-server/lib/xcat/plugins/switch.pm @@ -318,7 +318,7 @@ sub process_request { } if ($node) { - xCAT::MsgUtils->message("S", "xcat.discovery.switch: ($req->{_xcat_clientmac}->[0]) Found node: $node"); + xCAT::MsgUtils->message("S", "xcat.discovery.switch: ($req->{_xcat_clientmac}->[0]) Found node: $node matching for discovery request"); # No need to write mac table here, 'discovered' command will write # my $mactab = xCAT::Table->new('mac',-create=>1); @@ -338,7 +338,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]) Warning: Could not find any nodes using switch-based discovery"); + xCAT::MsgUtils->message("S", "xcat.discovery.switch: ($req->{_xcat_clientmac}->[0]) Warning: Could not find any node matching using switch-based discovery"); } } } diff --git a/xCAT-server/lib/xcat/plugins/typemtms.pm b/xCAT-server/lib/xcat/plugins/typemtms.pm index ad3a95303..76296a14c 100644 --- a/xCAT-server/lib/xcat/plugins/typemtms.pm +++ b/xCAT-server/lib/xcat/plugins/typemtms.pm @@ -36,14 +36,14 @@ sub findme { } my $nodenum = $#nodes; if ($nodenum < 0) { - xCAT::MsgUtils->message("S", "xcat.discovery.mtms: ($request->{_xcat_clientmac}->[0]) Warning: Could not find any nodes using mtms-based discovery"); + xCAT::MsgUtils->message("S", "xcat.discovery.mtms: ($request->{_xcat_clientmac}->[0]) Warning: Could not find any node matching 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"); + xCAT::MsgUtils->message("S", "xcat.discovery.mtms: ($request->{_xcat_clientmac}->[0]) Error: More than one node for $mtms were found"); return; } { - xCAT::MsgUtils->message("S", "xcat.discovery.mtms: ($request->{_xcat_clientmac}->[0]) Found node: $nodes[0]"); + xCAT::MsgUtils->message("S", "xcat.discovery.mtms: ($request->{_xcat_clientmac}->[0]) Found node: $nodes[0] matching for discovery request"); $request->{discoverymethod}->[0] = 'mtms'; my $req = {%$request}; $req->{command} = ['discovered']; From e03a0477174b9b75d88ecf20089a7496e8451690 Mon Sep 17 00:00:00 2001 From: XuWei Date: Tue, 27 Sep 2016 02:32:19 -0400 Subject: [PATCH 2/3] modified depending on comments --- xCAT-server/lib/xcat/plugins/blade.pm | 4 ++-- xCAT-server/lib/xcat/plugins/hpblade.pm | 4 ++-- xCAT-server/lib/xcat/plugins/nodediscover.pm | 2 +- xCAT-server/lib/xcat/plugins/seqdiscovery.pm | 4 ++-- xCAT-server/lib/xcat/plugins/switch.pm | 4 ++-- xCAT-server/lib/xcat/plugins/typemtms.pm | 6 +++--- 6 files changed, 12 insertions(+), 12 deletions(-) diff --git a/xCAT-server/lib/xcat/plugins/blade.pm b/xCAT-server/lib/xcat/plugins/blade.pm index f5c042d5b..7ff063a48 100644 --- a/xCAT-server/lib/xcat/plugins/blade.pm +++ b/xCAT-server/lib/xcat/plugins/blade.pm @@ -4546,7 +4546,7 @@ sub process_request { } } unless ($node) { - xCAT::MsgUtils->message("S", "xcat.discovery.blade: ($request->{_xcat_clientmac}->[0]) Warning: Could not find any node matching using blade-based discovery"); + 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})/) { @@ -4562,7 +4562,7 @@ sub process_request { undef $mactab; } - xCAT::MsgUtils->message("S", "xcat.discovery.blade: ($request->{_xcat_clientmac}->[0]) Found node: $node matching for discovery request"); + xCAT::MsgUtils->message("S", "xcat.discovery.blade: ($request->{_xcat_clientmac}->[0]) Found node: $node"); #my %request = ( # command => ['makedhcp'], diff --git a/xCAT-server/lib/xcat/plugins/hpblade.pm b/xCAT-server/lib/xcat/plugins/hpblade.pm index 4a5bba6e7..edab62629 100755 --- a/xCAT-server/lib/xcat/plugins/hpblade.pm +++ b/xCAT-server/lib/xcat/plugins/hpblade.pm @@ -749,7 +749,7 @@ sub process_request { } } unless ($macmap{$mac}) { - xCAT::MsgUtils->message("S", "xcat.discovery.hpblade: ($request->{_xcat_clientmac}->[0]) Warning: Could not find any node matching using hpblade-based discovery"); + xCAT::MsgUtils->message("S", "xcat.discovery.hpblade: ($request->{_xcat_clientmac}->[0]) Warning: Could not find any nodes using hpblade-based discovery"); return 1; #failure } @@ -762,7 +762,7 @@ sub process_request { # node => [$macmap{$mac}] # ); #$doreq->(\%request); - xCAT::MsgUtils->message("S", "xcat.discovery.hpblade: ($request->{_xcat_clientmac}->[0]) Found node: $macmap{$mac} matching for 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} ]; diff --git a/xCAT-server/lib/xcat/plugins/nodediscover.pm b/xCAT-server/lib/xcat/plugins/nodediscover.pm index 12d96ce43..d9b9ada43 100644 --- a/xCAT-server/lib/xcat/plugins/nodediscover.pm +++ b/xCAT-server/lib/xcat/plugins/nodediscover.pm @@ -462,7 +462,7 @@ sub process_request { #Update the discoverydata table to indicate the successful discovery xCAT::DiscoveryUtils->update_discovery_data($request); - xCAT::MsgUtils->message("S", "xcat.discovery.nodediscover: $node has been discovered so we can correlate the discovered definition to the pre-defined definition."); + xCAT::MsgUtils->message("S", "xcat.discovery.nodediscover: $node has been discovered"); } 1; diff --git a/xCAT-server/lib/xcat/plugins/seqdiscovery.pm b/xCAT-server/lib/xcat/plugins/seqdiscovery.pm index a3e4e4ef4..fc668a0af 100755 --- a/xCAT-server/lib/xcat/plugins/seqdiscovery.pm +++ b/xCAT-server/lib/xcat/plugins/seqdiscovery.pm @@ -384,7 +384,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]) Found node: $node matching for 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']; @@ -397,7 +397,7 @@ sub findme { undef $mactab; } else { nodediscoverstop($callback, undef, "node names"); - xCAT::MsgUtils->message("S", "xcat.discovery.seqdiscovery: ($request->{_xcat_clientmac}->[0]) Warning: Could not find any node matching using sequential-based discovery"); + xCAT::MsgUtils->message("S", "xcat.discovery.seqdiscovery: ($request->{_xcat_clientmac}->[0]) Warning: Could not find any nodes using sequential-based discovery"); return; } diff --git a/xCAT-server/lib/xcat/plugins/switch.pm b/xCAT-server/lib/xcat/plugins/switch.pm index c10121856..ba3d1281f 100644 --- a/xCAT-server/lib/xcat/plugins/switch.pm +++ b/xCAT-server/lib/xcat/plugins/switch.pm @@ -318,7 +318,7 @@ sub process_request { } if ($node) { - xCAT::MsgUtils->message("S", "xcat.discovery.switch: ($req->{_xcat_clientmac}->[0]) Found node: $node matching for 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); @@ -338,7 +338,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]) Warning: Could not find any node matching using switch-based discovery"); + xCAT::MsgUtils->message("S", "xcat.discovery.switch: ($req->{_xcat_clientmac}->[0]) Warning: Could not find any nodes using switch-based discovery"); } } } diff --git a/xCAT-server/lib/xcat/plugins/typemtms.pm b/xCAT-server/lib/xcat/plugins/typemtms.pm index 76296a14c..6a35e31e9 100644 --- a/xCAT-server/lib/xcat/plugins/typemtms.pm +++ b/xCAT-server/lib/xcat/plugins/typemtms.pm @@ -36,14 +36,14 @@ sub findme { } my $nodenum = $#nodes; if ($nodenum < 0) { - xCAT::MsgUtils->message("S", "xcat.discovery.mtms: ($request->{_xcat_clientmac}->[0]) Warning: Could not find any node matching using mtms-based discovery"); + xCAT::MsgUtils->message("S", "xcat.discovery.mtms: ($request->{_xcat_clientmac}->[0]) Warning: Could not find any node for $mtms matching using mtms-based discovery"); return; } elsif ($nodenum > 0) { - xCAT::MsgUtils->message("S", "xcat.discovery.mtms: ($request->{_xcat_clientmac}->[0]) Error: More than one node for $mtms were found"); + xCAT::MsgUtils->message("S", "xcat.discovery.mtms: ($request->{_xcat_clientmac}->[0]) Error: More than one node for $mtms was found"); return; } { - xCAT::MsgUtils->message("S", "xcat.discovery.mtms: ($request->{_xcat_clientmac}->[0]) Found node: $nodes[0] matching for 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']; From 46404e7ad675de64b86893dffa97164722c8ba06 Mon Sep 17 00:00:00 2001 From: XuWei Date: Tue, 27 Sep 2016 05:11:48 -0400 Subject: [PATCH 3/3] modified error --- xCAT-server/lib/xcat/plugins/typemtms.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xCAT-server/lib/xcat/plugins/typemtms.pm b/xCAT-server/lib/xcat/plugins/typemtms.pm index 6a35e31e9..bd30c9503 100644 --- a/xCAT-server/lib/xcat/plugins/typemtms.pm +++ b/xCAT-server/lib/xcat/plugins/typemtms.pm @@ -36,7 +36,7 @@ sub findme { } my $nodenum = $#nodes; if ($nodenum < 0) { - xCAT::MsgUtils->message("S", "xcat.discovery.mtms: ($request->{_xcat_clientmac}->[0]) Warning: Could not find any node for $mtms matching using mtms-based discovery"); + xCAT::MsgUtils->message("S", "xcat.discovery.mtms: ($request->{_xcat_clientmac}->[0]) Warning: Could not find any node for $mtms using mtms-based discovery"); return; } elsif ($nodenum > 0) { xCAT::MsgUtils->message("S", "xcat.discovery.mtms: ($request->{_xcat_clientmac}->[0]) Error: More than one node for $mtms was found");