Skip to content

Commit 97a0810

Browse files
authored
Move ansible-test entry point. (ansible#60281)
1 parent 577bb88 commit 97a0810

File tree

2 files changed

+28
-21
lines changed

2 files changed

+28
-21
lines changed

bin/ansible-test

-21
This file was deleted.

bin/ansible-test

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../test/lib/ansible_test/_data/cli/ansible_test_cli_stub.py
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
#!/usr/bin/env python
2+
# PYTHON_ARGCOMPLETE_OK
3+
"""Command line entry point for ansible-test."""
4+
5+
from __future__ import (absolute_import, division, print_function)
6+
__metaclass__ = type
7+
8+
import os
9+
import sys
10+
11+
12+
def main():
13+
"""Main program entry point."""
14+
ansible_root = os.path.abspath(os.path.join(os.path.dirname(os.path.dirname(__file__))))
15+
source_root = os.path.join(ansible_root, 'test', 'lib')
16+
17+
if os.path.exists(os.path.join(ansible_root, 'setup.py')) and os.path.exists(os.path.join(source_root, 'ansible_test', '_internal', 'cli.py')):
18+
# running from source, use that version of ansible-test instead of any version that may already be installed
19+
sys.path.insert(0, source_root)
20+
21+
from ansible_test._internal.cli import main as cli_main
22+
23+
cli_main()
24+
25+
26+
if __name__ == '__main__':
27+
main()

0 commit comments

Comments
 (0)