summaryrefslogtreecommitdiffstats
path: root/tools/docker-compose/awx-manage
blob: fac1adb5e0e98a5efb25186b1b8e2ce2dfa882ab (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#!/usr/bin/awx-python
import sys
from importlib.metadata import distribution


def load_entry_point(dist, group, name):
    dist_name, _, _ = dist.partition('==')
    matches = (
        entry_point
        for entry_point in distribution(dist_name).entry_points
        if entry_point.group == group and entry_point.name == name
    )
    return next(matches).load()


if __name__ == '__main__':
    sys.exit(
        load_entry_point('awx', 'console_scripts', 'awx-manage')()
    )