can pass device instance to check_*
This commit is contained in:
@@ -35,8 +35,8 @@ register 'register_worker' => sub {
|
|||||||
# reduce device_auth by driver, worker's only/no
|
# reduce device_auth by driver, worker's only/no
|
||||||
foreach my $stanza (@userconf) {
|
foreach my $stanza (@userconf) {
|
||||||
if (ref $job->device) {
|
if (ref $job->device) {
|
||||||
next if $no and check_acl_no($job->device->ip, $no);
|
next if $no and check_acl_no($job->device, $no);
|
||||||
next if $only and not check_acl_only($job->device->ip, $only);
|
next if $only and not check_acl_only($job->device, $only);
|
||||||
}
|
}
|
||||||
next if exists $stanza->{driver} and exists $workerconf->{driver}
|
next if exists $stanza->{driver} and exists $workerconf->{driver}
|
||||||
and (($stanza->{driver} || '') ne ($workerconf->{driver} || ''));
|
and (($stanza->{driver} || '') ne ($workerconf->{driver} || ''));
|
||||||
|
|||||||
@@ -45,8 +45,8 @@ sub run {
|
|||||||
my $no = (exists $stanza->{no} ? $stanza->{no} : undef);
|
my $no = (exists $stanza->{no} ? $stanza->{no} : undef);
|
||||||
my $only = (exists $stanza->{only} ? $stanza->{only} : undef);
|
my $only = (exists $stanza->{only} ? $stanza->{only} : undef);
|
||||||
|
|
||||||
next if $no and check_acl_no($job->device->ip, $no);
|
next if $no and check_acl_no($job->device, $no);
|
||||||
next if $only and not check_acl_only($job->device->ip, $only);
|
next if $only and not check_acl_only($job->device, $only);
|
||||||
|
|
||||||
push @newuserconf, $stanza;
|
push @newuserconf, $stanza;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user