Use entry_points for ipa CLI

Fix problem with hard-coded shebang in ipa command line tool by using
a proper setuptools entry point for the console script. ipaclient is now
an executable Python package, too.

```
$ python -m ipaclient ping
```

is equivalent to

```
$ ipa ping
```

Related: https://pagure.io/freeipa/issue/6653
Closes: https://pagure.io/freeipa/issue/6850
Signed-off-by: Christian Heimes <cheimes@redhat.com>
Reviewed-By: Tomas Krizek <tkrizek@redhat.com>
This commit is contained in:
Christian Heimes
2017-04-07 15:03:08 +02:00
committed by Martin Basti
parent bad0f608c4
commit bf67974459
3 changed files with 22 additions and 4 deletions

5
ipa
View File

@@ -24,8 +24,7 @@ Command Line Interface for IPA administration.
The CLI functionality is implemented in ipalib/cli.py
"""
from ipalib import api, cli
from ipaclient.__main__ import main
if __name__ == '__main__':
cli.run(api)
main()