2
0
mirror of https://github.com/xcat2/xcat-core.git synced 2025-05-30 17:46:38 +00:00

Merge pull request #7311 from gurevichmark/osdeploy_probe_dups

Eliminate some duplicate output lines from xcatprobe osdeploy
This commit is contained in:
besawn 2023-01-17 11:06:02 -05:00 committed by GitHub
commit da156a6853
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -812,15 +812,28 @@ Start capturing every message during OS provision process....
my @hdls;
my $starttime = time();
my @candidate_mn_hostname_in_log = $log_parse->obtain_candidate_mn_hostname_in_log();
my $log_content_ref_last;
#read log realtimely, then handle each log
# Loop forever, reading each log file
for (; ;) {
if (@hdls = $select->can_read(0)) {
foreach my $hdl (@hdls) {
my $line = "";
chomp($line = <$hdl>);
my $log_content_ref = $log_parse->obtain_log_content($fd_filetype_map{$hdl}, $line);
dispatch_log_to_handler($log_content_ref, \@candidate_mn_hostname_in_log, \%node_state);
if ($log_content_ref->{label} == $::LOGLABEL_XCAT) {
# If reading computes or cluster log files, try to eliminate duplicated lines
unless (($log_content_ref_last->{time_record} eq $log_content_ref->{time_record}) &&
($log_content_ref_last->{sender} eq $log_content_ref->{sender}) &&
($log_content_ref_last->{msg} eq $log_content_ref->{msg})) {
dispatch_log_to_handler($log_content_ref, \@candidate_mn_hostname_in_log, \%node_state);
}
# Save messages details for later duplicate detection
$log_content_ref_last = { %$log_content_ref };
}
else {
dispatch_log_to_handler($log_content_ref, \@candidate_mn_hostname_in_log, \%node_state);
}
}
}