From 6f3cbf4daf4c1d04a9142850508f8ddc647e2294 Mon Sep 17 00:00:00 2001 From: Dobrica Pavlinusic Date: Sat, 29 Aug 2009 00:07:00 +0000 Subject: [PATCH] just warn about unreachable clients, but wrap our soap invocation in eval --- lib/PXElator/amt.pm | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/lib/PXElator/amt.pm b/lib/PXElator/amt.pm index c283072..3324403 100644 --- a/lib/PXElator/amt.pm +++ b/lib/PXElator/amt.pm @@ -21,7 +21,7 @@ sub info { $ip ||= $client_ip; if ( ! ping::host( $ip ) ) { - return "$ip unreachable"; + warn "$ip unreachable"; } warn "amt $ip ", '*' x length($passwd), "\n"; @@ -29,10 +29,13 @@ sub info { $ENV{AMT_HOST} = $ip; $ENV{AMT_PASSWORD} = $passwd; - my $amt = Intel::AMT::NetworkAdministration::network_settings; - $amt->{power_state} = Intel::AMT::RemoteControl::SystemPowerState; - - CouchDB::audit('network', $amt ); + my $amt; + eval { + $amt = Intel::AMT::NetworkAdministration::network_settings; + $amt->{power_state} = Intel::AMT::RemoteControl::SystemPowerState; + CouchDB::audit('network', $amt ); + }; + warn "ERROR amt $@" if $@; my $out; -- 2.20.1