Skip to content

Commit fd87c7c

Browse files
authored
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
2 parents 1f38ca0 + 77feec3 commit fd87c7c

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

startup_scripts/__main__.py

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,11 @@ def filename(f):
1313
for f in sorted(it, key = filename):
1414
if f.name.startswith('__') or not f.is_file():
1515
continue
16-
17-
print(f"Running {f.path}")
18-
runpy.run_path(f.path)
16+
17+
print(f"▶️ Running the startup script {f.path}")
18+
try:
19+
runpy.run_path(f.path)
20+
except SystemExit as e:
21+
if e.code is not None and e.code != 0:
22+
print(f"‼️ The startup script {f.path} returned with code {e.code}, exiting.")
23+
raise

0 commit comments

Comments
 (0)