[Kimchi-devel] [PATCH] packaging: ship kimchi with plugins/__init__.py
Mark Wu
wudxw at linux.vnet.ibm.com
Thu Apr 17 07:30:17 UTC 2014
On 04/17/2014 11:59 AM, zhshzhou at linux.vnet.ibm.com wrote:
> From: Zhou Zheng Sheng <zhshzhou at linux.vnet.ibm.com>
>
> If we do not package and install plugins/__init__.py, plugins can not be
> imported as "import kimchi.plugins.pluginXYZ". The plugins also can not
> be discovered and imported dynamically. This patch fixes the problem.
>
> Signed-off-by: Zhou Zheng Sheng <zhshzhou at linux.vnet.ibm.com>
> ---
> contrib/kimchi.spec.fedora.in | 1 +
> contrib/kimchi.spec.suse.in | 1 +
> plugins/Makefile.am | 5 ++++-
> 3 files changed, 6 insertions(+), 1 deletion(-)
>
> diff --git a/contrib/kimchi.spec.fedora.in b/contrib/kimchi.spec.fedora.in
> index 1cd99b0..62d3000 100644
> --- a/contrib/kimchi.spec.fedora.in
> +++ b/contrib/kimchi.spec.fedora.in
> @@ -141,6 +141,7 @@ rm -rf $RPM_BUILD_ROOT
> %{python_sitelib}/kimchi/control/vm/*.py*
> %{python_sitelib}/kimchi/model/*.py*
> %{python_sitelib}/kimchi/API.json
> +%{python_sitelib}/kimchi/plugins/*.py*
> %{_datadir}/kimchi/doc/API.md
> %{_datadir}/kimchi/doc/README.md
> %{_datadir}/kimchi/doc/kimchi-guest.png
> diff --git a/contrib/kimchi.spec.suse.in b/contrib/kimchi.spec.suse.in
> index efb2c08..524a000 100644
> --- a/contrib/kimchi.spec.suse.in
> +++ b/contrib/kimchi.spec.suse.in
> @@ -67,6 +67,7 @@ rm -rf $RPM_BUILD_ROOT
> %{python_sitelib}/kimchi/control/vm/*.py*
> %{python_sitelib}/kimchi/model/*.py*
> %{python_sitelib}/kimchi/API.json
> +%{python_sitelib}/kimchi/plugins/*.py*
> %{_datadir}/kimchi/doc/API.md
> %{_datadir}/kimchi/doc/README.md
> %{_datadir}/kimchi/doc/kimchi-guest.png
> diff --git a/plugins/Makefile.am b/plugins/Makefile.am
> index 2ceedae..894d28e 100644
> --- a/plugins/Makefile.am
> +++ b/plugins/Makefile.am
> @@ -19,4 +19,7 @@
>
> SUBDIRS = sample
>
> -EXTRA_DIST = __init__.py
> +plugins_PYTHON = \
> + __init__.py
> +
> +pluginsdir = $(pythondir)/kimchi/plugins
Reviewed-by: Mark Wu<wudxw at linux.vnet.ibm.com>
It makes sense to provide the plugin mechanism support in kimchi base.
More information about the Kimchi-devel
mailing list