-
Notifications
You must be signed in to change notification settings - Fork 2.9k
Description
NetBox version
v3.3.2
Python version
3.10
Steps to Reproduce
Create the following folder structure:
./scripts/__init__.py
./scripts/testscript.py
./scripts/subscriptfolder/__init__.py
./scripts/subscriptfolder/myscript1.py
./scripts/subscriptfolder/myscript2.py
testscript.py contains script class TestScript(Script):
myscript1.py contains script class MyScript1(Script):
myscript2.py contains script class MyScript2(Script):
__init__.py contains:
from myscript1 import MyScript1
from myscript2 import MyScript2
Expected Behavior
Three scripts should be shown on the script page:
TestScript under the testscript heading and MyScript1 and MyScript2 under the subscriptfolder heading.
All scripts should work as expected.
Observed Behavior
All scripts show in the list as expected, but clicking on the subscriptsfolder scripts will cause a 404 error as the URL points to subscriptsfolder.myscript1.MyScript1 but the returned dict from get_scripts() is in the following format:
{
"subscriptsfolder": {"MyScript1": MyScript1() }
}
Noticably missing the myscript1 part of the module path.
This makes it hard to organize scripts as there is no way to get scripts under the same heading without having them in the same file.