The direct execution button on the custom script list page fails to work. #10924

Closed
opened 2025-12-29 21:37:48 +01:00 by adam · 1 comment
Owner

Originally created by @Wythetells on GitHub (Mar 20, 2025).

Originally assigned to: @jnovinger on GitHub.

Deployment Type

Self-hosted

NetBox Version

v4.2.5

Python Version

3.11

Steps to Reproduce

1、Select any script that does not require additional parameters but can update the database, and directly click "Run" on the custom script list page.

Image

2、The running result prompts that the stack group has been associated.

Image

3、Virtual Chassis is not associated with any devices.

Image

4、Click on the script details page (by default, the "commit changes" option is selected), and then click "Run Script".

Image

5、The database has been modified and the update is successful.

Image

Expected Behavior

When clicking the "Run" button on the list page, submit the database modification.

The document shows that

The checkbox to commit database changes when executing a script is checked by default.

Image

And my script doesn't have "commit_default" set.


class StackDetection(Script):
    class Meta:
        name = "堆叠检测维护(VirtualChassis)"
        description = "根据设备名称自动创建虚拟堆叠"

    def run(self, data, commit):
···

Observed Behavior

When clicking "Run" on the list page, perform a dry-run.

Originally created by @Wythetells on GitHub (Mar 20, 2025). Originally assigned to: @jnovinger on GitHub. ### Deployment Type Self-hosted ### NetBox Version v4.2.5 ### Python Version 3.11 ### Steps to Reproduce 1、Select any script that does not require additional parameters but can update the database, and directly click "Run" on the custom script list page. ![Image](https://github.com/user-attachments/assets/738bd9b7-30f9-439e-8140-2ff5d3489115) 2、The running result prompts that the stack group has been associated. ![Image](https://github.com/user-attachments/assets/a46be533-de50-44e1-a717-970f2e5d0dff) 3、Virtual Chassis is not associated with any devices. ![Image](https://github.com/user-attachments/assets/f262d59d-fb58-46c7-b27b-3003c59a56a6) 4、Click on the script details page (by default, the "commit changes" option is selected), and then click "Run Script". ![Image](https://github.com/user-attachments/assets/2c60b1bb-4912-49fc-9f6c-c06490135584) 5、The database has been modified and the update is successful. ![Image](https://github.com/user-attachments/assets/161bd011-b29e-4588-81c8-2ba63f1f79bf) ### Expected Behavior When clicking the "Run" button on the list page, submit the database modification. The document shows that > The checkbox to commit database changes when executing a script is checked by default. ![Image](https://github.com/user-attachments/assets/32fe990e-e395-4173-88f9-412bcafa75f2) And my script doesn't have "commit_default" set. ``` class StackDetection(Script): class Meta: name = "堆叠检测维护(VirtualChassis)" description = "根据设备名称自动创建虚拟堆叠" def run(self, data, commit): ··· ``` ### Observed Behavior When clicking "Run" on the list page, perform a dry-run.
adam added the type: bugstatus: acceptedseverity: low labels 2025-12-29 21:37:49 +01:00
adam closed this issue 2025-12-29 21:37:49 +01:00
Author
Owner

@arthanson commented on GitHub (Mar 24, 2025):

Note: The issue is when choosing "Run Script" from the list view page the default for "Commit Changes" is false and should be True, it is True if you go to the script page first.

@arthanson commented on GitHub (Mar 24, 2025): Note: The issue is when choosing "Run Script" from the list view page the default for "Commit Changes" is false and should be True, it is True if you go to the script page first.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#10924