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

From: Archana Singh <archus@linux.vnet.ibm.com> Signed-off-by: Archana Singh <archus@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') -- 2.1.0

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@linux.vnet.ibm.com wrote:
From: Archana Singh <archus@linux.vnet.ibm.com>
Signed-off-by: Archana Singh <archus@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')

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@linux.vnet.ibm.com wrote:
From: Archana Singh <archus@linux.vnet.ibm.com>
Signed-off-by: Archana Singh <archus@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@ovirt.org http://lists.ovirt.org/mailman/listinfo/kimchi-devel

There are tests failing with this patch. Please, run "make check" on wok and kimchi to make sure your patch does not break anything. On 05/10/2015 12:50, archus@linux.vnet.ibm.com wrote:
From: Archana Singh <archus@linux.vnet.ibm.com>
Signed-off-by: Archana Singh <archus@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')

"make check" is failing for me for the latest-code I pulled from git(without any changes). Could you please let me know if something need to be done which is system specific? On 10/9/2015 4:30 AM, Aline Manera wrote:
There are tests failing with this patch. Please, run "make check" on wok and kimchi to make sure your patch does not break anything.
On 05/10/2015 12:50, archus@linux.vnet.ibm.com wrote:
From: Archana Singh <archus@linux.vnet.ibm.com>
Signed-off-by: Archana Singh <archus@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')

HI Archana, Is this output from wok or Kimchi tests? To make sure your patch does not break anything else, run "make check" prior and before your changes and make sure any new failure is added. Regards, Aline Manera On 12/10/2015 10:36, Archana Singh wrote:
"make check" is failing for me for the latest-code I pulled from git(without any changes). Could you please let me know if something need to be done which is system specific?
On 10/9/2015 4:30 AM, Aline Manera wrote:
There are tests failing with this patch. Please, run "make check" on wok and kimchi to make sure your patch does not break anything.
On 05/10/2015 12:50, archus@linux.vnet.ibm.com wrote:
From: Archana Singh <archus@linux.vnet.ibm.com>
Signed-off-by: Archana Singh <archus@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')

Hello Aline, This was the result from wok tests. And this result I got prior to any changes. Basically without any modification in the cloned wok code, the test case was failing. Thanks, Archana Singh On 10/13/2015 6:13 PM, Aline Manera wrote:
HI Archana,
Is this output from wok or Kimchi tests?
To make sure your patch does not break anything else, run "make check" prior and before your changes and make sure any new failure is added.
Regards, Aline Manera
On 12/10/2015 10:36, Archana Singh wrote:
"make check" is failing for me for the latest-code I pulled from git(without any changes). Could you please let me know if something need to be done which is system specific?
On 10/9/2015 4:30 AM, Aline Manera wrote:
There are tests failing with this patch. Please, run "make check" on wok and kimchi to make sure your patch does not break anything.
On 05/10/2015 12:50, archus@linux.vnet.ibm.com wrote:
From: Archana Singh <archus@linux.vnet.ibm.com>
Signed-off-by: Archana Singh <archus@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')

Which distro are you using? I am on Ubuntu 15.04 and all tests pass for wok framework with the current master. On 13/10/2015 13:23, Archana Singh wrote:
Hello Aline,
This was the result from wok tests. And this result I got prior to any changes. Basically without any modification in the cloned wok code, the test case was failing.
Thanks, Archana Singh
On 10/13/2015 6:13 PM, Aline Manera wrote:
HI Archana,
Is this output from wok or Kimchi tests?
To make sure your patch does not break anything else, run "make check" prior and before your changes and make sure any new failure is added.
Regards, Aline Manera
On 12/10/2015 10:36, Archana Singh wrote:
"make check" is failing for me for the latest-code I pulled from git(without any changes). Could you please let me know if something need to be done which is system specific?
On 10/9/2015 4:30 AM, Aline Manera wrote:
There are tests failing with this patch. Please, run "make check" on wok and kimchi to make sure your patch does not break anything.
On 05/10/2015 12:50, archus@linux.vnet.ibm.com wrote:
From: Archana Singh <archus@linux.vnet.ibm.com>
Signed-off-by: Archana Singh <archus@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')
participants (5)
-
abhiramk
-
Aline Manera
-
Archana Singh
-
archus@linux.vnet.ibm.com
-
Paulo Ricardo Paz Vital