From 2a74e0befa7fab51da11655ff96f0e3c620b4693 Mon Sep 17 00:00:00 2001 From: Oliver Gorwits Date: Fri, 29 Sep 2017 07:38:05 +0100 Subject: [PATCH] can pass device instance to check_* --- lib/App/Netdisco/Worker/Plugin.pm | 4 ++-- lib/App/Netdisco/Worker/Runner.pm | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/App/Netdisco/Worker/Plugin.pm b/lib/App/Netdisco/Worker/Plugin.pm index 19cf651d..70967456 100644 --- a/lib/App/Netdisco/Worker/Plugin.pm +++ b/lib/App/Netdisco/Worker/Plugin.pm @@ -35,8 +35,8 @@ register 'register_worker' => sub { # reduce device_auth by driver, worker's only/no foreach my $stanza (@userconf) { if (ref $job->device) { - next if $no and check_acl_no($job->device->ip, $no); - next if $only and not check_acl_only($job->device->ip, $only); + next if $no and check_acl_no($job->device, $no); + next if $only and not check_acl_only($job->device, $only); } next if exists $stanza->{driver} and exists $workerconf->{driver} and (($stanza->{driver} || '') ne ($workerconf->{driver} || '')); diff --git a/lib/App/Netdisco/Worker/Runner.pm b/lib/App/Netdisco/Worker/Runner.pm index 34fca0d8..32f4a0e1 100644 --- a/lib/App/Netdisco/Worker/Runner.pm +++ b/lib/App/Netdisco/Worker/Runner.pm @@ -45,8 +45,8 @@ sub run { my $no = (exists $stanza->{no} ? $stanza->{no} : undef); my $only = (exists $stanza->{only} ? $stanza->{only} : undef); - next if $no and check_acl_no($job->device->ip, $no); - next if $only and not check_acl_only($job->device->ip, $only); + next if $no and check_acl_no($job->device, $no); + next if $only and not check_acl_only($job->device, $only); push @newuserconf, $stanza; }