[Kimchi-devel] [PATCH 2/3] Plugins: Fix api_schema for plugins framework

Aline Manera alinefm at linux.vnet.ibm.com
Thu Jan 16 02:33:59 UTC 2014


Reviewed-by: Aline Manera <alinefm at linux.vnet.ibm.com>

On 01/14/2014 02:17 PM, Rodrigo Trujillo wrote:
> Currently, the api_schema for the plugins have not been checked.
> This patch fixes this problem getting the api_schema from the main
> plugin class.
>
> Signed-off-by: Rodrigo Trujillo <rodrigo.trujillo at linux.vnet.ibm.com>
> ---
>   src/kimchi/control/utils.py | 4 +++-
>   1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/src/kimchi/control/utils.py b/src/kimchi/control/utils.py
> index c3c5f8e..676fa08 100644
> --- a/src/kimchi/control/utils.py
> +++ b/src/kimchi/control/utils.py
> @@ -89,7 +89,9 @@ def internal_redirect(url):
>   def validate_params(params, instance, action):
>       root = cherrypy.request.app.root
>
> -    if hasattr(root, 'api_schema'):
> +    if hasattr(instance, 'api_schema'):
> +        api_schema = instance.api_schema
> +    elif hasattr(root, 'api_schema'):
>           api_schema = root.api_schema
>       else:
>           return




More information about the Kimchi-devel mailing list