We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents ada911c + 9458521 commit 8820cacCopy full SHA for 8820cac
netbox/extras/scripts.py
@@ -3,6 +3,7 @@
3
import logging
4
import os
5
import pkgutil
6
+import sys
7
import traceback
8
from collections import OrderedDict
9
@@ -477,6 +478,10 @@ def get_scripts(use_names=False):
477
478
# Iterate through all modules within the reports path. These are the user-created files in which reports are
479
# defined.
480
for importer, module_name, _ in pkgutil.iter_modules([settings.SCRIPTS_ROOT]):
481
+ # Remove cached module to ensure consistency with filesystem
482
+ if module_name in sys.modules:
483
+ del sys.modules[module_name]
484
+
485
module = importer.find_module(module_name).load_module(module_name)
486
if use_names and hasattr(module, 'name'):
487
module_name = module.name
0 commit comments