1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00

Make sure plugins/ contains no symbolic links or other things that aren't regular files (#4579)

This commit is contained in:
Felix Fontein 2022-04-26 22:19:34 +02:00 committed by GitHub
parent 7743ecd776
commit 520705df30
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -6,6 +6,7 @@ from __future__ import (absolute_import, division, print_function)
__metaclass__ = type __metaclass__ = type
import os import os
import os.path
import sys import sys
@ -38,6 +39,11 @@ def main():
if any(path.startswith(skip_directory) for skip_directory in skip_directories): if any(path.startswith(skip_directory) for skip_directory in skip_directories):
continue continue
if os.path.islink(path):
print('%s: is a symbolic link' % (path, ))
elif not os.path.isfile(path):
print('%s: is not a regular file' % (path, ))
ext = os.path.splitext(path)[1] ext = os.path.splitext(path)[1]
if ext in ('.yml', ) and any(path.startswith(yaml_directory) for yaml_directory in yaml_directories): if ext in ('.yml', ) and any(path.startswith(yaml_directory) for yaml_directory in yaml_directories):