Do not forget when updating. (/opt/netbox/validators/ ) #9734

Closed
opened 2025-12-29 21:21:51 +01:00 by adam · 3 comments
Owner

Originally created by @LHBL2003 on GitHub (May 24, 2024).

Change Type

Addition

Area

Installation/upgrade

Proposed Changes

I implemented my first validator class in Netbox today. However, the update documentation does not mention that the "/opt/netbox/validators/" folder must also be copied as an option. I would like to document this.
I would therefore ask for permission to do so.

Originally created by @LHBL2003 on GitHub (May 24, 2024). ### Change Type Addition ### Area Installation/upgrade ### Proposed Changes I implemented my first validator class in Netbox today. However, the update documentation does not mention that the "/opt/netbox/validators/" folder must also be copied as an option. I would like to document this. I would therefore ask for permission to do so.
adam added the type: documentation label 2025-12-29 21:21:51 +01:00
adam closed this issue 2025-12-29 21:21:51 +01:00
Author
Owner

@PieterL75 commented on GitHub (May 24, 2024):

I think that the place for custom code is in in /opt/netbox/netbox/local
That folder is excluded from git updates. So running a git command will not complain about any folder/file you added.
you can import your validator as local.yourfilename.classname

@PieterL75 commented on GitHub (May 24, 2024): I think that the place for custom code is in in /opt/netbox/netbox/local That folder is excluded from git updates. So running a git command will not complain about any folder/file you added. you can import your validator as local.yourfilename.classname
Author
Owner

@jeremystretch commented on GitHub (May 24, 2024):

The documentation does not prescribe a specific location for custom validators, and thus it cannot advise on specific additional steps pursuant to an upgrade. Ideally any such custom code should be installed via separate Python package entirely.

@jeremystretch commented on GitHub (May 24, 2024): The documentation does not prescribe a specific location for custom validators, and thus it cannot advise on specific additional steps pursuant to an upgrade. Ideally any such custom code should be installed via separate Python package entirely.
Author
Owner

@jeffgdotorg commented on GitHub (May 29, 2024):

Closing issue as not planned.

@LHBL2003 thanks for flagging a potential pitfall and looking out for future users in your position. If you would like to open a new docs PR to capture the availability of the netbox/local directory for protecting local resources from git-meddling, you're welcome to do so.

@jeffgdotorg commented on GitHub (May 29, 2024): Closing issue as not planned. @LHBL2003 thanks for flagging a potential pitfall and looking out for future users in your position. If you would like to open a new docs PR to capture the availability of the `netbox/local` directory for protecting local resources from git-meddling, you're welcome to do so.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#9734