Device Type Export YAML indenting behaviour #6334

Closed
opened 2025-12-29 19:39:32 +01:00 by adam · 5 comments
Owner

Originally created by @ekrichbaum on GitHub (Apr 10, 2022).

NetBox version

v3.2.0

Python version

3.10

Steps to Reproduce

  1. From Device Type List, Select Export, All Data (YAML)

Expected Behavior

console-ports:
  - name: Con0
    type: rj-45
    label: ''
    description: ''

Additional indent of 2 spaces for each sub element. (allow for direct paste for devicetype library item without edit of each line)

Potentially, also drop blank items out (also for allow to direct paste for devicetype library without removal).

Observed Behavior

console-ports:
- name: Con0
  type: rj-45
  label: ''
  description: ''

Those don't format well here.

Originally created by @ekrichbaum on GitHub (Apr 10, 2022). ### NetBox version v3.2.0 ### Python version 3.10 ### Steps to Reproduce 1. From Device Type List, Select Export, All Data (YAML) ### Expected Behavior ```yaml console-ports: - name: Con0 type: rj-45 label: '' description: '' ``` Additional indent of 2 spaces for each sub element. (allow for direct paste for devicetype library item without edit of each line) Potentially, also drop blank items out (also for allow to direct paste for devicetype library without removal). ### Observed Behavior ```yaml console-ports: - name: Con0 type: rj-45 label: '' description: '' ``` Those don't format well here.
adam added the type: bugstatus: needs ownerpending closure labels 2025-12-29 19:39:32 +01:00
adam closed this issue 2025-12-29 19:39:32 +01:00
Author
Owner

@DanSheps commented on GitHub (Apr 11, 2022):

So, the observed behaviour is actually valid YAML. Not sure why the devicetype library needs the two spaces before the sub-item in the array. Perhaps it is a problem with the linter.

@DanSheps commented on GitHub (Apr 11, 2022): So, the observed behaviour is actually valid YAML. Not sure why the devicetype library needs the two spaces before the sub-item in the array. Perhaps it is a problem with the linter.
Author
Owner

@jeremystretch commented on GitHub (Apr 11, 2022):

Yeah I believe that's all it is: The linter check in the device type library requires further indentation, which introduces friction when trying to generate new definitions for the library from NetBox.

@jeremystretch commented on GitHub (Apr 11, 2022): Yeah I believe that's all it is: The linter check in the device type library requires further indentation, which introduces friction when trying to generate new definitions for the library from NetBox.
Author
Owner

@jeremystretch commented on GitHub (Apr 12, 2022):

Relevant: https://stackoverflow.com/questions/25108581/python-yaml-dump-bad-indentation

@jeremystretch commented on GitHub (Apr 12, 2022): Relevant: https://stackoverflow.com/questions/25108581/python-yaml-dump-bad-indentation
Author
Owner

@github-actions[bot] commented on GitHub (Jun 12, 2022):

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. NetBox is governed by a small group of core maintainers which means not all opened issues may receive direct feedback. Do not attempt to circumvent this process by "bumping" the issue; doing so will result in its immediate closure and you may be barred from participating in any future discussions. Please see our contributing guide.

@github-actions[bot] commented on GitHub (Jun 12, 2022): This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. NetBox is governed by a small group of core maintainers which means not all opened issues may receive direct feedback. **Do not** attempt to circumvent this process by "bumping" the issue; doing so will result in its immediate closure and you may be barred from participating in any future discussions. Please see our [contributing guide](https://github.com/netbox-community/netbox/blob/develop/CONTRIBUTING.md).
Author
Owner

@github-actions[bot] commented on GitHub (Jul 12, 2022):

This issue has been automatically closed due to lack of activity. In an effort to reduce noise, please do not comment any further. Note that the core maintainers may elect to reopen this issue at a later date if deemed necessary.

@github-actions[bot] commented on GitHub (Jul 12, 2022): This issue has been automatically closed due to lack of activity. In an effort to reduce noise, please do not comment any further. Note that the core maintainers may elect to reopen this issue at a later date if deemed necessary.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#6334