Update netbox/extras/models/scripts.py

Co-authored-by: Jeremy Stretch <jstretch@netboxlabs.com>
This commit is contained in:
Arthur Hanson 2023-05-04 11:45:41 -07:00 committed by GitHub
parent 2cd14b4dd1
commit 5976d8484e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -53,11 +53,10 @@ class ScriptModule(PythonModuleMixin, JobsMixin, ManagedFile):
# For child objects in submodules use the full import path w/o the root module as the name # For child objects in submodules use the full import path w/o the root module as the name
return cls.full_name.split(".", maxsplit=1)[1] return cls.full_name.split(".", maxsplit=1)[1]
module = None
try: try:
module = self.get_module() module = self.get_module()
except Exception as e: except Exception as e:
pass module = None
scripts = {} scripts = {}
ordered = getattr(module, 'script_order', []) ordered = getattr(module, 'script_order', [])