-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
Custom Script CLI and API execution not working #17923
Comments
+1 to this |
I repeat my comment from #17885 and volunteer for submitting a PR:
|
With c34a0e2, validation of job object fields is enabled, so ScriptJob must not set required fields to empty strings. This commit reverts b18f193 and (hopefully) fixes this issue not only for UI views, but for all interactions with scripts. Fixes: netbox-community#17923
@alehaa are you still planning on making a PR? |
There is already one linked to this issue. :) |
Thanks! I missed that. I tested your change now and I can confirm it fixes the problem for both CLI and scheduled script execution. |
I believe this has been resolved by PR #17932. |
Deployment Type
Self-hosted
Triage priority
N/A
NetBox Version
v4.1.6
Python Version
3.11
Steps to Reproduce
Unable to execute custom scripts via the CLI and API. This is the same issue referenced in #17885. The fix implemented only applies to the GUI.
Adding the script name as an argument to the enqueue method fixes the problem.
netbox/netbox/extras/api/views.py
Lines 281 to 290 in 27d1561
netbox/netbox/extras/management/commands/runscript.py
Lines 84 to 100 in 27d1561
Expected Behavior
Executing a script for the CLI and API should work
Observed Behavior
The following error is produced when attempting to use the CLI runscript command
The text was updated successfully, but these errors were encountered: