« blib/lib/App/Netdisco/Worker/Plugin/Internal/SNMPFastDiscover.pm
↑ Summary
blib/lib/App/Netdisco/Worker/Plugin/LoadMIBs.pm »
| 1 | package App::Netdisco::Worker::Plugin::Linter; | ||
| 2 | |||
| 3 | use Dancer ':syntax'; | ||
| 4 | use App::Netdisco::Worker::Plugin; | ||
| 5 | |||
| 6 | # demonstrator that we can put something in vars | ||
| 7 | # and wrap/augment a python worker with some other stuff | ||
| 8 | |||
| 9 | register_worker({ phase => 'early' }, sub { | ||
| 10 | my ($job, $workerconf) = @_; | ||
| 11 | my $file = $job->extra and return; | ||
| 12 | |||
| 13 | vars->{'file_to_lint'} ||= | ||
| 14 | Path::Class::Dir->new( $ENV{DANCER_ENVDIR} ) | ||
| 15 | ->file( $ENV{DANCER_ENVIRONMENT} .'.yml' )->stringify; | ||
| 16 | }); | ||
| 17 | |||
| 18 | true; |