From f4623c47bf39952c39919fbe5cadf1df3890ea18 Mon Sep 17 00:00:00 2001 From: Oliver Gorwits Date: Fri, 2 Feb 2018 14:50:55 +0000 Subject: [PATCH] Allow netdisco-do show to run when no func is available to handle request --- Changes | 4 ++++ lib/App/Netdisco/Worker/Plugin/Show.pm | 3 ++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/Changes b/Changes index cdf4dbd2..63bb8b61 100644 --- a/Changes +++ b/Changes @@ -8,6 +8,10 @@ [ENHANCEMENTS] * Do not attempt Canonical IP change to non-discoverable IP + * Allow netdisco-do show to run when no func is available to handle request + * Allow netdisco-do show to run when no func is available to handle request + * Allow netdisco-do show to run when no func is available to handle request + * Allow netdisco-do show to run when no func is available to handle request [BUG FIXES] diff --git a/lib/App/Netdisco/Worker/Plugin/Show.pm b/lib/App/Netdisco/Worker/Plugin/Show.pm index c6f93b40..52a2ca55 100644 --- a/lib/App/Netdisco/Worker/Plugin/Show.pm +++ b/lib/App/Netdisco/Worker/Plugin/Show.pm @@ -28,7 +28,8 @@ register_worker({ phase => 'main', driver => 'snmp' }, sub { } my $i = App::Netdisco::Transport::SNMP->reader_for($device, $class); - Data::Printer::p($i->$extra($port)); + my $result = sub { eval { $i->$extra($port) } || undef }; + Data::Printer::p( $result->() ); return Status->done( sprintf "Showed %s response from %s", $extra, $device->ip);