From 00265a9323e3d15a5ee3b28a2ab5b3972cdd4ffb Mon Sep 17 00:00:00 2001 From: Oliver Gorwits Date: Sun, 10 Mar 2013 18:41:40 +0000 Subject: [PATCH] report error on failure to load a plugin --- Netdisco/lib/App/Netdisco/Web.pm | 1 + Netdisco/lib/App/Netdisco/Web/Plugin.pm | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/Netdisco/lib/App/Netdisco/Web.pm b/Netdisco/lib/App/Netdisco/Web.pm index b0f2c868..59af5f3d 100644 --- a/Netdisco/lib/App/Netdisco/Web.pm +++ b/Netdisco/lib/App/Netdisco/Web.pm @@ -25,6 +25,7 @@ sub _load_web_plugins { debug "loading Netdisco plugin $plugin"; eval "require $plugin"; + error $@ if $@; } } diff --git a/Netdisco/lib/App/Netdisco/Web/Plugin.pm b/Netdisco/lib/App/Netdisco/Web/Plugin.pm index 04d4638d..b78c6654 100644 --- a/Netdisco/lib/App/Netdisco/Web/Plugin.pm +++ b/Netdisco/lib/App/Netdisco/Web/Plugin.pm @@ -84,7 +84,7 @@ register 'register_report' => sub { my @categories = @{ setting('report_order') }; if (!length $config->{category} - or !length $config->{path} + or !length $config->{tag} or !length $config->{label} or 0 == scalar grep {$config->{category} eq $_} @categories) { @@ -93,7 +93,7 @@ register 'register_report' => sub { } foreach my $item (@{setting('reports')->{ $config->{category} }}) { - if ($item->{label} eq $config->{label}) { + if ($item->{tag} eq $config->{tag}) { $item = $config; return; }