mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2025-01-26 16:16:31 -06:00
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:
parent
bad0f608c4
commit
bf67974459
5
ipa
5
ipa
@ -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()
|
||||
|
15
ipaclient/__main__.py
Normal file
15
ipaclient/__main__.py
Normal file
@ -0,0 +1,15 @@
|
||||
# Copyright (C) 2017 FreeIPA Contributors see COPYING for license
|
||||
"""
|
||||
Command Line Interface for IPA administration.
|
||||
|
||||
The CLI functionality is implemented in ipalib/cli.py
|
||||
"""
|
||||
from ipalib import api, cli
|
||||
|
||||
|
||||
def main():
|
||||
cli.run(api)
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
@ -31,7 +31,6 @@ if __name__ == '__main__':
|
||||
ipasetup(
|
||||
name="ipaclient",
|
||||
doc=__doc__,
|
||||
scripts=['../ipa'],
|
||||
package_dir={'ipaclient': ''},
|
||||
packages=[
|
||||
"ipaclient",
|
||||
@ -60,6 +59,11 @@ if __name__ == '__main__':
|
||||
"qrcode",
|
||||
"six",
|
||||
],
|
||||
entry_points={
|
||||
'console_scripts': [
|
||||
'ipa = ipaclient.__main__:main'
|
||||
]
|
||||
},
|
||||
extras_require={
|
||||
"install": ["ipaplatform"],
|
||||
"otptoken_yubikey": ["yubico", "usb"]
|
||||
|
Loading…
Reference in New Issue
Block a user