fixes because Dancer docs are a mess!

This commit is contained in:
Oliver Gorwits
2017-07-23 13:46:27 +01:00
parent f65ef90b86
commit c31030ef70
2 changed files with 5 additions and 4 deletions

View File

@@ -2,12 +2,12 @@ package App::Netdisco::Core::Plugin;
use Dancer ':syntax'; use Dancer ':syntax';
use Dancer::Plugin; use Dancer::Plugin;
use Dancer::Hook; use Dancer::Factory::Hook;
use App::Netdisco::Util::Permission qw/check_acl_no check_acl_only/; use App::Netdisco::Util::Permission qw/check_acl_no check_acl_only/;
use Try::Tiny; use Try::Tiny;
Dancer::Hook->instance->register_hooks_name( Dancer::Factory::Hook->instance->install_hooks(
map {("before_$_", $_, "after_$_")} map {("before_$_", $_, "after_$_")}
@{ setting('core_phases') } @{ setting('core_phases') }
); );
@@ -24,7 +24,7 @@ register 'register_core_action' => sub {
return error "bad param to register_core_action" return error "bad param to register_core_action"
unless ref sub {} eq ref $code and ref {} eq ref $args unless ref sub {} eq ref $code and ref {} eq ref $args
and exists $args->{action} and exists $args->{action}
and Dancer::Hook->hook_is_registered($args->{action}); and Dancer::Factory::Hook->instance->hook_is_registered($args->{action});
my $no = $args->{no}; my $no = $args->{no};
my $only = $args->{only}; my $only = $args->{only};
@@ -44,6 +44,7 @@ register 'register_core_action' => sub {
return ($happy ? ($args->{final} ? 1 : 0) : -1); return ($happy ? ($args->{final} ? 1 : 0) : -1);
}; };
# NOTE: using Dancer::Factory::Hook internals
if ($args->{final} and $args->{action} !~ m/^(?:before|after)_/) { if ($args->{final} and $args->{action} !~ m/^(?:before|after)_/) {
unshift @{$store->hooks->{ $args->{action} }}, $hook; unshift @{$store->hooks->{ $args->{action} }}, $hook;
} }

View File

@@ -801,7 +801,7 @@ transport or driver documentation pages for further details. For example:
community: public community: public
- tag: sshcollector - tag: sshcollector
only: 'group:sshcollectordevices' only: 'group:sshcollectordevices'
driver: cli driver: cli
method: arpnip_nodes method: arpnip_nodes
username: foo username: foo
password: bar password: bar