Skip to content

Device (Type) Import is missing component data type validation #20670

@m-hau

Description

@m-hau

NetBox Edition

NetBox Community

NetBox Version

v4.4.4 (and main Branch)

Python Version

3.12

Steps to Reproduce

  1. Open the WebUI
  2. Create a Manufacturer named M
  3. Open the "Device Type Bulk Import" aka /dcim/device-types/import/
  4. Insert the following Data, and Submit

4a.

---
manufacturer: M
model: DT1
slug: dt1
u_height: 1
console-ports: con0

4b.

---
manufacturer: M
model: DT2
slug: dt2
u_height: 1
console-ports:
  - con0

Expected Behavior

You get a proper validation error, stating what the problem is

4a: console-ports: Must be a list
4b: console-ports[0]: Must be a dictionary

Observed Behavior

You get an error page with a traceback.

AttributeError at /dcim/device-types/import/
'str' object has no attribute 'update'

Originally found while working on #20042. Fix can also already be found in commits bb8f5ee and 16e284f. Would like to create a PR for this.

Metadata

Metadata

Assignees

Labels

severity: lowDoes not significantly disrupt application functionality, or a workaround is availablestatus: acceptedThis issue has been accepted for implementationtype: bugA confirmed report of unexpected behavior in the application

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions