Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make the value of commit available in custom scripts #4262

Closed
benjy44 opened this issue Feb 24, 2020 · 2 comments
Closed

Make the value of commit available in custom scripts #4262

benjy44 opened this issue Feb 24, 2020 · 2 comments
Assignees
Labels
status: accepted This issue has been accepted for implementation type: feature Introduction of new functionality to the application

Comments

@benjy44
Copy link

benjy44 commented Feb 24, 2020

Environment

  • Python version: 3.5.1
  • NetBox version: 2.7.7

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

@samk-acw
Copy link
Contributor

Being able to hide/disable the commit checkbox would also be nice for scripts that don't make any changes (which is essential what reports are, but I believe the custom scripts feature is ultimately meant to replace reports)

@jeremystretch jeremystretch self-assigned this Feb 25, 2020
@jeremystretch jeremystretch added status: accepted This issue has been accepted for implementation type: feature Introduction of new functionality to the application labels Feb 25, 2020
@jeremystretch
Copy link
Member

Implemented in 5000f7f

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
status: accepted This issue has been accepted for implementation type: feature Introduction of new functionality to the application
Projects
None yet
Development

No branches or pull requests

3 participants