diff options
author | Jan Cholasta <jcholast@redhat.com> | 2016-03-08 12:37:40 +0100 |
---|---|---|
committer | Jan Cholasta <jcholast@redhat.com> | 2016-06-03 09:00:34 +0200 |
commit | f1ad3e67ae765ed6bf72fc861ffb47f1d6637c47 (patch) | |
tree | 13b70950f22ce01222eca9887d2b7eb9e3fc93d0 | |
parent | 9b0df69f75e70bcba60b0732dfca4b3dbc7eace4 (diff) | |
download | freeipa-f1ad3e67ae765ed6bf72fc861ffb47f1d6637c47.tar.gz freeipa-f1ad3e67ae765ed6bf72fc861ffb47f1d6637c47.tar.xz freeipa-f1ad3e67ae765ed6bf72fc861ffb47f1d6637c47.zip |
ipaclient: introduce ipaclient.plugins
Load plugins from ipaclient.plugins in client API instances.
https://fedorahosted.org/freeipa/ticket/4739
Reviewed-By: David Kupka <dkupka@redhat.com>
-rw-r--r-- | freeipa.spec.in | 3 | ||||
-rw-r--r-- | ipaclient/plugins/__init__.py | 7 | ||||
-rw-r--r-- | ipaclient/setup.py.in | 6 | ||||
-rw-r--r-- | ipalib/__init__.py | 3 |
4 files changed, 17 insertions, 2 deletions
diff --git a/freeipa.spec.in b/freeipa.spec.in index c6499a5c6..752b58656 100644 --- a/freeipa.spec.in +++ b/freeipa.spec.in @@ -1303,6 +1303,7 @@ fi %license COPYING %dir %{python_sitelib}/ipaclient %{python_sitelib}/ipaclient/*.py* +%{python_sitelib}/ipaclient/plugins/*.py* %{python_sitelib}/ipaclient-*.egg-info @@ -1315,6 +1316,8 @@ fi %dir %{python3_sitelib}/ipaclient %{python3_sitelib}/ipaclient/*.py %{python3_sitelib}/ipaclient/__pycache__/*.py* +%{python3_sitelib}/ipaclient/plugins/*.py +%{python3_sitelib}/ipaclient/plugins/__pycache__/*.py* %{python3_sitelib}/ipaclient-*.egg-info %endif # with_python3 diff --git a/ipaclient/plugins/__init__.py b/ipaclient/plugins/__init__.py new file mode 100644 index 000000000..1a4725e89 --- /dev/null +++ b/ipaclient/plugins/__init__.py @@ -0,0 +1,7 @@ +# +# Copyright (C) 2016 FreeIPA Contributors see COPYING for license +# + +""" +Sub-package containing all client plugins. +""" diff --git a/ipaclient/setup.py.in b/ipaclient/setup.py.in index 47c9b8485..30fb5ba80 100644 --- a/ipaclient/setup.py.in +++ b/ipaclient/setup.py.in @@ -59,8 +59,10 @@ def setup_package(): classifiers=[line for line in CLASSIFIERS.split('\n') if line], platforms = ["Linux", "Solaris", "Unix"], package_dir = {'ipaclient': ''}, - packages = ["ipaclient", - ], + packages = [ + "ipaclient", + "ipaclient.plugins", + ], scripts=['../ipa'], data_files = [('share/man/man1', ["../ipa.1"])], ) diff --git a/ipalib/__init__.py b/ipalib/__init__.py index 62860b348..a6768a843 100644 --- a/ipalib/__init__.py +++ b/ipalib/__init__.py @@ -913,6 +913,9 @@ class API(plugable.API): if self.env.in_server: import ipaserver.plugins result += (ipaserver.plugins,) + else: + import ipaclient.plugins + result += (ipaclient.plugins,) if self.env.context in ('installer', 'updates'): import ipaserver.install.plugins |