finish refactor to new desired behaviour (buggy?)

This commit is contained in:
Oliver Gorwits
2017-11-07 22:30:55 +00:00
parent 7edfe88f25
commit 1eeaba441d
6 changed files with 60 additions and 37 deletions

View File

@@ -43,7 +43,7 @@ register 'register_worker' => sub {
my $no = (exists $workerconf->{no} ? $workerconf->{no} : undef);
my $only = (exists $workerconf->{only} ? $workerconf->{only} : undef);
return $job->defer('worker is not applicable to this device')
return $job->add_status( Status->defer('worker is not applicable to this device') )
if ($no and check_acl_no($job->device, $no))
or ($only and not check_acl_only($job->device, $only));
@@ -59,7 +59,7 @@ register 'register_worker' => sub {
}
# per-device action but no device creds available
return $job->defer('deferred job with no device creds')
return $job->add_status( Status->defer('deferred job with no device creds') )
if 0 == scalar @newuserconf;
}