Make the value of commit available in custom scripts #4262
Labels
status: accepted
This issue has been accepted for implementation
type: feature
Introduction of new functionality to the application
Environment
Proposed Functionality
Make the status of commit (True/False) available so it's possible to know if part of a script not directly tied to NetBox should be run or not.
Use Case
I have a script to create VMs in a certain way and I use it to update a text file that contains the IPs of the newly created VMs for external use.
While the script and the file is generated properly, I don't want my file to be updated if the VMs are not actually created, ie: when commit=False.
As a workaround proposed by @steffann I can use
if '_commit' in self.request.POST
which works fine but a cleaner way would be better.Database Changes
Don't think so
External Dependencies
none
The text was updated successfully, but these errors were encountered: