[Kimchi-devel] [PATCH V2] Fix controller base code: Update function is not using model_args

Rodrigo Trujillo rodrigo.trujillo at linux.vnet.ibm.com
Mon Feb 10 16:07:41 UTC 2014


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'))]
-- 
1.8.5.3




More information about the Kimchi-devel mailing list