Total failure to reach a management module is now reported correctly instead of segfaulting

git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@683 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd
This commit is contained in:
jbjohnso 2008-03-05 17:35:14 +00:00
parent eb7dadcc95
commit df464707e0

View File

@ -1126,7 +1126,13 @@ sub dompa {
Timeout=>1300000, #Beacon, for one, takes a bit over a second to return
PrivPass => $mpahash->{$mpa}->{password});
if ($session->{ErrorStr}) { return 1,$session->{ErrorStr}; }
unless ($session) {
unless ($session and keys %$session) {
my %err=(node=>[]);
foreach (keys %{$mpahash{$mpa}->{nodes}}) {
push (@{$err{node}},{name=>[$_],error=>["Cannot communicate with $mpa"],errorcode=>[1]});
}
print $out freeze([\%err]);
print $out "\nENDOFFREEZE6sK4ci\n";
return 1,"General error establishing SNMP communication";
}
my $tmp = $session->get([$mmprimoid.".1"]);