-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Reverse for 'script_jobs' with arguments '('',)' not found #19228
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
Comments
It is not NETBOX problem. |
Well, this is actually a bug. In 4.2.7 we added some logic to enforce script ordering. However that logic returns a tuple in some cases and the raw script in others, within the same list. Code here
To fix it: @property
def ordered_scripts(self):
script_objects = {s.name: s for s in self.scripts.all()}
ordered = [
script_objects.pop(sc) for sc in self.module_scripts.keys() if sc in script_objects
]
- ordered.extend(script_objects.items())
+ ordered.extend(script_objects.values())
return ordered |
The issue is, that in certain cirumstances (script is unable to be loaded), the following can be returned from [
<Script: Test Script #1>,
<Script: Test Script #2>,
<Script: Test Script #3>,
('Test Script #4', <Script: Test Script #4>)
] When this is expected: [
<Script: Test Script #1>,
<Script: Test Script #2>,
<Script: Test Script #3>,
<Script: Test Script #4>
] |
Deployment Type
Self-hosted
NetBox Version
v4.2.7
Python Version
3.10
Steps to Reproduce
Expected Behavior
Should be page with list of custom scripts
Observed Behavior
After upgrading to the version 4.2.7 got error:
The text was updated successfully, but these errors were encountered: