From 3ee85383abced85e67793ea38c12e029965d3428 Mon Sep 17 00:00:00 2001 From: Oliver Gorwits Date: Tue, 5 Sep 2017 19:25:41 +0100 Subject: [PATCH] skip worker when action is per-device but no creds --- lib/App/Netdisco/Worker/Plugin.pm | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/App/Netdisco/Worker/Plugin.pm b/lib/App/Netdisco/Worker/Plugin.pm index 2d1ead95..5ac4eeb2 100644 --- a/lib/App/Netdisco/Worker/Plugin.pm +++ b/lib/App/Netdisco/Worker/Plugin.pm @@ -50,6 +50,10 @@ register 'register_worker' => sub { push @newuserconf, $stanza; } + # per-device action but no device creds available + return Status->error('skipped with no device creds') + if ref $job->device and 0 == scalar @newuserconf; + # back up and restore device_auth my $guard = guard { set(device_auth => \@userconf) }; set(device_auth => \@newuserconf);