Merge pull request #307 from netbox-community/FixFileMatching

Don't try to run non-python files
This commit is contained in:
Christian Mäder 2020-06-02 14:42:58 +02:00 committed by GitHub
commit 7f93b328af
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -11,7 +11,13 @@ def filename(f):
with scandir(dirname(abspath(__file__))) as it:
for f in sorted(it, key = filename):
if f.name.startswith('__') or not f.is_file():
if not f.is_file():
continue
if f.name.startswith('__'):
continue
if not f.name.endswith('.py'):
continue
print(f"▶️ Running the startup script {f.path}")