[Kimchi-devel] [PATCH V2] Fix controller base code: Update function is not using model_args
Aline Manera
alinefm at linux.vnet.ibm.com
Mon Feb 10 19:29:01 UTC 2014
Reviewed-by: Aline Manera <alinefm at linux.vnet.ibm.com>
On 02/10/2014 02:07 PM, Rodrigo Trujillo wrote:
> The model_args variable is used to pass information to functions.
> Specially in functions of sub-collections and sub-resources, it is used
> to pass the main collections and resources names/classes. The wrapper
> update function from control base was not using model_args, then some
> resouces might miss this information.
>
> Signed-off-by: Rodrigo Trujillo <rodrigo.trujillo at linux.vnet.ibm.com>
> ---
> src/kimchi/control/base.py | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/src/kimchi/control/base.py b/src/kimchi/control/base.py
> index f50ff6e..a841ac2 100644
> --- a/src/kimchi/control/base.py
> +++ b/src/kimchi/control/base.py
> @@ -151,7 +151,8 @@ class Resource(object):
> error = "%s are not allowed to be updated" % invalids
> raise cherrypy.HTTPError(405, error)
>
> - ident = update(self.ident, params)
> + args = list(self.model_args) + [params]
> + ident = update(*args)
> if ident != self.ident:
> uri_params = list(self.model_args[:-1])
> uri_params += [urllib2.quote(ident.encode('utf8'))]
More information about the Kimchi-devel
mailing list