Allow netdisco-do show to run when no func is available to handle request

This commit is contained in:
Oliver Gorwits
2018-02-02 14:50:55 +00:00
parent dc78d08e06
commit f4623c47bf
2 changed files with 6 additions and 1 deletions

View File

@@ -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]

View File

@@ -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);