The variable request is used to log request, but if
authorization fails, it will not be initialize and
break logging.
Signed-off-by: Lucio Correia <luciojhc(a)linux.vnet.ibm.com>
---
src/wok/control/base.py | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/src/wok/control/base.py b/src/wok/control/base.py
index 419179a..b861b9c 100644
--- a/src/wok/control/base.py
+++ b/src/wok/control/base.py
@@ -122,13 +122,14 @@ class Resource(object):
method = 'POST'
validate_method((method), self.role_key, self.admin_methods)
try:
+ request = parse_request()
+ validate_params(request, self, action_name)
+
self.lookup()
if not self.is_authorized():
raise UnauthorizedError('WOKAPI0009E')
model_args = list(self.model_args)
- request = parse_request()
- validate_params(request, self, action_name)
if action_args is not None:
model_args.extend(
request[key] if key in request.keys() else None
--
1.9.1