Skip to content

Commit

Permalink
Fix Issue #93
Browse files Browse the repository at this point in the history
  • Loading branch information
mzbroch committed Mar 6, 2021
1 parent 35912e8 commit c9be59b
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions netbox_onboarding/worker.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,10 @@ def onboard_device(task_id, credentials): # pylint: disable=too-many-statements
ot.save()
onboarding_status = False

finally:
if onboarded_device and not OnboardingDevice.objects.filter(device=onboarded_device):
OnboardingDevice.objects.create(device=onboarded_device)

onboardingtask_results_counter.labels(status=ot.status).inc()

return dict(ok=onboarding_status)

0 comments on commit c9be59b

Please sign in to comment.