Merge pull request #294 from netbox-community/Fix284

Fix #284: Fixes the bug that initializers with no data stopped the execution of the later initializers
This commit is contained in:
Tobias Genannt 2020-05-15 13:57:23 +02:00 committed by GitHub
commit fd87c7cb98
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -14,5 +14,10 @@ with scandir(dirname(abspath(__file__))) as it:
if f.name.startswith('__') or not f.is_file():
continue
print(f"Running {f.path}")
runpy.run_path(f.path)
print(f"▶️ Running the startup script {f.path}")
try:
runpy.run_path(f.path)
except SystemExit as e:
if e.code is not None and e.code != 0:
print(f"‼️ The startup script {f.path} returned with code {e.code}, exiting.")
raise