Import of Device Type strips comments #3722

Closed
opened 2025-12-29 18:30:46 +01:00 by adam · 3 comments
Owner

Originally created by @constantpinger on GitHub (May 25, 2020).

Environment

  • Python version: any
  • NetBox version: 2.8.1 & 2.8.4

Steps to Reproduce

  1. Disable any installed plugins by commenting out the PLUGINS setting in
    configuration.py.
  2. Add device type via YAML import that has comments. Simple example for testing:
manufacturer: Cisco
model: Switch_with_comments
slug: testSwitch
u_height: 1
is_full_depth: false
comments: disappear
interfaces:
- name: ge1/0/0
  type: 1000base-t
  mgmt_only: false

Expected Behavior

New device type includes the comments

Observed Behavior

All details except comments are imported correctly. Comments section is blank.
No error shown.

Notes

I only have access to a v2.8.1 environment (my production) and v2.8.4 (netboxdemo.com). This issue may have existed in prior releases.

This is my first bug report. Please feel free to suggest improvements.

Originally created by @constantpinger on GitHub (May 25, 2020). ### Environment * Python version: any * NetBox version: 2.8.1 & 2.8.4 <!-- Describe in detail the exact steps that someone else can take to reproduce this bug using the current stable release of NetBox. Begin with the creation of any necessary database objects and call out every operation being performed explicitly. If reporting a bug in the REST API, be sure to reconstruct the raw HTTP request(s) being made: Don't rely on a client library such as pynetbox. --> ### Steps to Reproduce 1. Disable any installed plugins by commenting out the `PLUGINS` setting in `configuration.py`. 2. Add device type via YAML import that has comments. Simple example for testing: ``` manufacturer: Cisco model: Switch_with_comments slug: testSwitch u_height: 1 is_full_depth: false comments: disappear interfaces: - name: ge1/0/0 type: 1000base-t mgmt_only: false ``` <!-- What did you expect to happen? --> ### Expected Behavior New device type includes the comments <!-- What happened instead? --> ### Observed Behavior All details except comments are imported correctly. Comments section is blank. No error shown. ### Notes I only have access to a v2.8.1 environment (my production) and v2.8.4 ([netboxdemo.com](https://netboxdemo.com/)). This issue may have existed in prior releases. This is my first bug report. Please feel free to suggest improvements.
adam added the type: bugstatus: accepted labels 2025-12-29 18:30:46 +01:00
adam closed this issue 2025-12-29 18:30:47 +01:00
Author
Owner

@jeremystretch commented on GitHub (May 26, 2020):

I want to clarify why you raised this issue: Are you expecting to import comment strings from the community device type library? That will not be supported, because it would not make sense for a generic device type definition to populate a field which is intended to hold only locally-significant information.

I'm fine with extending import support for the comments field, but want to avoid any confusion between the functionality itself and support for comments in the device type library.

@jeremystretch commented on GitHub (May 26, 2020): I want to clarify why you raised this issue: Are you expecting to import comment strings from the community [device type library](https://github.com/netbox-community/devicetype-library)? That will not be supported, because it would not make sense for a generic device type definition to populate a field which is intended to hold only locally-significant information. I'm fine with extending import support for the comments field, but want to avoid any confusion between the functionality itself and support for comments in the device type library.
Author
Owner

@constantpinger commented on GitHub (May 26, 2020):

This could well be a perception issue on my part.

My perception of the comment field is that it could be used for any additional information about the object. In this case a device type definition. The use case that led to the discovery was that the comment contained a link to the manufacturer datasheet. Though I also use it for information such as weight and dimensions.

My submission wasn't purely regarding the community aspect of this feature. It would still be there for an individual importing YAML files from their own external information store. They might want comments to be imported at that time.

So the question might be "what is the purpose of the comments field in device-types?"
For device definitions it makes sense that this would be local to the install since that device is individual to that organisation. A device-type however should be correct and complete for everywhere it is used.

I can see this isn't a straight forward bug and down to interpretation of the use of the field.

@constantpinger commented on GitHub (May 26, 2020): This could well be a perception issue on my part. My perception of the comment field is that it could be used for any additional information about the object. In this case a device type definition. The use case that led to the discovery was that the comment contained a link to the manufacturer datasheet. Though I also use it for information such as weight and dimensions. My submission wasn't purely regarding the community aspect of this feature. It would still be there for an individual importing YAML files from their own external information store. They might want comments to be imported at that time. So the question might be "what is the purpose of the comments field in device-types?" For device definitions it makes sense that this would be local to the install since that device is individual to that organisation. A device-type however should be correct and complete for everywhere it is used. I can see this isn't a straight forward bug and down to interpretation of the use of the field.
Author
Owner

@jeremystretch commented on GitHub (May 26, 2020):

My perception of the comment field is that it could be used for any additional information about the object.

It can, in the same way that it can for any object in NetBox. It does not pertain to anything specific to the device type model specifically (e.g. its manufacturer or weight).

@jeremystretch commented on GitHub (May 26, 2020): > My perception of the comment field is that it could be used for any additional information about the object. It can, in the same way that it can for any object in NetBox. It does not pertain to anything specific to the device type model specifically (e.g. its manufacturer or weight).
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#3722