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

Fixes for missing aliases files sanity test. (#21798)

* Refine test for missing aliases files.
* Fix formatting of missing aliases message.
This commit is contained in:
Matt Clay 2017-02-22 12:04:09 -08:00 committed by GitHub
parent f8157d579a
commit b5e0eb0985

View file

@ -22,7 +22,7 @@ def main():
continue
# don't require aliases for support directories
if any(os.path.splitext(f)[0] == 'test' for f in files):
if any(os.path.splitext(f)[0] == 'test' and os.access(os.path.join(target_dir, f), os.X_OK) for f in files):
continue
# don't require aliases for setup_ directories
@ -41,7 +41,7 @@ def main():
missing_aliases.append(target_dir)
if missing_aliases:
message = '''
message = textwrap.dedent('''
The following integration target directories are missing `aliases` files:
%s
@ -66,9 +66,9 @@ def main():
skip/python3
Take a look at existing `aliases` files to see what aliases are available and how they're used.
''' % '\n'.join(missing_aliases)
''').strip() % '\n'.join(missing_aliases)
print(textwrap.dedent(message).strip())
print(message)
exit(1)