Skip to content

Commit

Permalink
Merge pull request #1710 from hu-weihua/probebugs
Browse files Browse the repository at this point in the history
Fix bug 1017: xcatprobe osdeploy -n node -r 24h could not get right deploy messages
  • Loading branch information
zet809 authored Aug 16, 2016
2 parents 1ff6ec7 + 91bd846 commit 9298b5f
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions xCAT-probe/subcmds/osdeploy
Original file line number Diff line number Diff line change
Expand Up @@ -570,6 +570,11 @@ sub dump_history {
print "\t$line\n";
}
}
my $statelist = "";
for (my $i = 0 ; $i < scalar(@{ $rawdata{$node}{statehistory} }) ; $i++) {
$statelist .= "$state_set_reverse{$rawdata{$node}{statehistory}[$i]} ";
}
probe_utils->send_msg("$output", "d", "[$node] state history: $statelist");
}

my @tmpnodestatehistory = @{ $rawdata{$node}{statehistory} };
Expand Down Expand Up @@ -817,7 +822,6 @@ sub get_valid_logs {
my $year = shift;
my $epoch_seconds_of_now = shift;
my $bthistory_ref = shift;
my $nics = "eth0";
my @orglogfilelist = ("/var/log/xcat/cluster.log",
"/var/log/messages",
"/var/log/xcat/computes.log");
Expand Down Expand Up @@ -851,7 +855,7 @@ sub get_valid_logs {
my $fd;
my $filetype = `file $file 2>&1`;
chomp($filetype);
if ($filetype =~ /ASCII text/) {
if ($filetype =~ /ASCII/) {
if (!open($fd, "$file")) {
print "open $files failed\n";
next;
Expand Down Expand Up @@ -926,7 +930,7 @@ sub get_valid_logs {
$timestampepoch = probe_utils->convert_to_epoch_seconds($timestamp, $year, $epoch_seconds_of_now);
}

if (($splitline[4] =~ /dhcpd:/i && $_ =~ /$nics/)
if (($splitline[4] =~ /dhcpd:/i && $_ =~ /$installnic/)
|| ($splitline[4] =~ /in.tftpd/i)
|| (($splitline[4] =~ /^xcat/i) || ($splitline[5] =~ /^xcat/i))
|| ($splitline[5] =~ /GET/ && $splitline[7] =~ /HTTP/)) {
Expand Down Expand Up @@ -965,7 +969,7 @@ sub do_replay {
foreach my $line (@bthistory) {
$line =~ s/(\d+) (.+)/$2/g;
my @tmp = split(/\s+/, $line);
if ($tmp[4] =~ /dhcpd:/i && $line =~ /$nics/) {
if ($tmp[4] =~ /dhcpd:/i && $line =~ /$installnic/) {
handle_dhcp_msg("$line");
} elsif ($tmp[4] =~ /in.tftpd/i) {
handle_tftp_msg("$line");
Expand Down

0 comments on commit 9298b5f

Please sign in to comment.