Skip to content

Uppercase Device Type Model slug causes duplicate key value error #52

@Vaultpls

Description

@Vaultpls

Environment

  • Python version: 3.7.2
  • NetBox version: 2.8.5
  • ntc-netbox-plugin-onboarding version: 1.1.0

Steps to Reproduce

  1. Create a Device Type with a Model Slug that is in ALL CAPITALS(also had the main name of the device as the same)
  2. Onboard the device

Expected Behavior

Successful onboarding of device, no new addition of the Device Type.

Observed Behavior

Platform is successfully populated but after that it fails.

Seems it was trying to recreate the Device Type even if I set it to not create if not found.

Onboarding Tasks states the following:

fail-general: duplicate key value violates unique constraint "dcim_devicetype_manufacturer_id_model_17948c0c_uniq" DETAIL: Key (manufacturer_id, model)=(2, WS-C2960C-8TC-L) already exists.

Workaround

Go to device type -> model slug and turn the UPPERCASE into lowercase. Did not modify the device model name

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions