2
0
mirror of https://github.com/xcat2/xcat-core.git synced 2025-06-21 13:35:32 +00:00

fix issue 1650, help to resolve errors

This commit is contained in:
XuWei
2016-11-07 02:43:09 -05:00
parent 6450ef2ab6
commit 74dca9c43e
2 changed files with 10 additions and 2 deletions

View File

@ -343,7 +343,9 @@ sub dump_mac_info {
}
elsif (defined($self->{macinfo}->{$switch}->{ErrorStr})) {
$ret{$switch}->{ErrorStr} = $self->{macinfo}->{$switch}->{ErrorStr};
if ($ret{$switch}->{ErrorStr} =~ /Unknown user name/) {
$ret{$switch}->{ErrorStr} = "Unknown snmp user name";
}
# To show the error message that the username/password related error is for SNMP only
if ($ret{$switch}->{ErrorStr} =~ /username|password/i) {
$ret{$switch}->{ErrorStr} .= " through SNMP";

View File

@ -94,7 +94,7 @@ if (-f $error_file) {
my $fd;
open($fd, "<", "$normal_file");
my @fails = ();
my @error_nodes = ();
# There is 2 kinds of error message:
# 1. Error: The nodetype is not 'switch' for nodes: switch1
# Error: No switch configuration info find for switch-10-5-23-1
@ -104,6 +104,8 @@ foreach (<$fd>) {
if (/Error:/) {
if (/^(\S*):\s*Error:\s*(.*)/) {
push @fails, "$1 - $2";
} elsif (/^Error:\s*The nodetype is not 'switch' for nodes: (.+)/) {
push @error_nodes, "$1";
} elsif (/^Error:\s*(.*)/) {
push @fails, $1;
} else {
@ -124,6 +126,10 @@ if (-f $normal_file) {
if (-f $error_file) {
unlink($error_file);
}
if (@error_nodes) {
my $error_node = join(",", @error_nodes);
probe_utils->send_msg("$output", "d", "[$error_node] : Error, switch-macmap can only be run against xCAT objects that have 'nodetype=switch'");
}
foreach (@fails) {
probe_utils->send_msg("$output", "f", "$_");
}