Fix #704, allow delete without device_auth
* This typically comes up when using a deployment.yml generated from some inventory source, the device disappears and can then no longer be deleted since netdisco-delete unnecessarily insists on needing a valid device_auth
This commit is contained in:
@@ -76,7 +76,7 @@ register 'register_worker' => sub {
|
|||||||
|
|
||||||
# per-device action but no device creds available
|
# per-device action but no device creds available
|
||||||
return $job->add_status( Status->info('skip: driver or action not applicable') )
|
return $job->add_status( Status->info('skip: driver or action not applicable') )
|
||||||
if 0 == scalar @newuserconf;
|
if 0 == scalar @newuserconf && $job->action ne "delete";
|
||||||
}
|
}
|
||||||
|
|
||||||
# back up and restore device_auth
|
# back up and restore device_auth
|
||||||
|
|||||||
@@ -51,7 +51,7 @@ sub run {
|
|||||||
|
|
||||||
# per-device action but no device creds available
|
# per-device action but no device creds available
|
||||||
return $job->add_status( Status->defer('deferred job with no device creds') )
|
return $job->add_status( Status->defer('deferred job with no device creds') )
|
||||||
if 0 == scalar @newuserconf;
|
if 0 == scalar @newuserconf && $job->action ne "delete";
|
||||||
}
|
}
|
||||||
|
|
||||||
# back up and restore device_auth
|
# back up and restore device_auth
|
||||||
|
|||||||
Reference in New Issue
Block a user