Skip to content

Make the value of commit available in custom scripts #4262

@benjy44

Description

@benjy44

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

Metadata

Metadata

Assignees

Labels

status: acceptedThis issue has been accepted for implementationtype: featureIntroduction of new functionality to the application

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions