[Kimchi-devel] [PATCH 2/2] Issue #737 : fix to remove multiple calls for resource lookup

abhiramk abhiramk at linux.vnet.ibm.com
Wed Oct 7 19:23:57 UTC 2015


Paulo.

This seems to be a bug in the base.py index index(self, *args, **kargs):
method as Archana mentioned. 

whenever we do GET operation on resource, the lookup() method is being
called twice. One before authorization and one after the authorization
which is the actual call to be done

    def index(self, *args, **kargs):
        method = validate_method(('GET', 'DELETE', 'PUT'),
                                 self.role_key, self.admin_methods)

        try:
            self.lookup() ------------------------------->  //FIRST CALL
            if not self.is_authorized():
                raise UnauthorizedError('KCHAPI0009E')

            return {'GET': self.get, -------------------->//SECOND CALL
                    'DELETE': self.delete,
                    'PUT': self.update}[method](*args, **kargs)

With archanas patch, this issue is not happening for me as well.
 


On Mon, 2015-10-05 at 12:54 -0300, Paulo Ricardo Paz Vital wrote:
> Hello Archana.
> 
> Please, provide more information about the issue and the solution on
> commit message. 
> 
> Best regards,
> Paulo.
> 
> On Mon, 2015-10-05 at 21:20 +0530, archus at linux.vnet.ibm.com wrote:
> > From: Archana Singh <archus at linux.vnet.ibm.com>
> > 
> > Signed-off-by: Archana Singh <archus at linux.vnet.ibm.com>
> > ---
> >  src/wok/control/base.py | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> > 
> > diff --git a/src/wok/control/base.py b/src/wok/control/base.py
> > index 5c5c95f..912ed16 100644
> > --- a/src/wok/control/base.py
> > +++ b/src/wok/control/base.py
> > @@ -163,7 +163,7 @@ class Resource(object):
> >                                   self.role_key, self.admin_methods)
> > 
> >          try:
> > -            self.lookup()
> > +            self.info = {}
> >              if not self.is_authorized():
> >                  raise UnauthorizedError('WOKAPI0009E')
> > 
> 
> _______________________________________________
> Kimchi-devel mailing list
> Kimchi-devel at ovirt.org
> http://lists.ovirt.org/mailman/listinfo/kimchi-devel
> 





More information about the Kimchi-devel mailing list