)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":11343,"name":"Gal Sagie","email":"gal.sagie@gmail.com","username":"GalSagie"},"change_message_id":"6272bbdd9bb854cc6e6afc0d593b718857e2d51c","unresolved":false,"context_lines":[{"line_number":8,"context_line":""},{"line_number":9,"context_line":"When a user requests an operation prohibited by the policy"},{"line_number":10,"context_line":"(e.g. try to delete a shared network by a regular user),"},{"line_number":11,"context_line":"neutron returns 404 not found in a response, but ERROR level"},{"line_number":12,"context_line":"log will be recorded. This commit lowers the log level"},{"line_number":13,"context_line":"to INFO for such events."},{"line_number":14,"context_line":""}],"source_content_type":"text/x-gerrit-commit-message","patch_set":1,"id":"9a41bdd9_0182e152","line":11,"updated":"2015-07-11 15:04:59.000000000","message":"Its not directly related to this change, but why Neutron doesnt return 401 (Unauthorised)  or better yet 403 (Forbidden) error code in that case ?","commit_id":"c0c0a8b8e611eb05067f5eda89a9298c1a053078"},{"author":{"_account_id":2874,"name":"yong sheng gong","email":"gong.yongsheng@99cloud.net","username":"gongysh"},"change_message_id":"f6b9b4eef74955214543734c334c3c93b7e46bdd","unresolved":false,"context_lines":[{"line_number":8,"context_line":""},{"line_number":9,"context_line":"When a user requests an operation prohibited by the policy"},{"line_number":10,"context_line":"(e.g. try to delete a shared network by a regular user),"},{"line_number":11,"context_line":"neutron returns 404 not found in a response, but ERROR level"},{"line_number":12,"context_line":"log will be recorded. This commit lowers the log level"},{"line_number":13,"context_line":"to INFO for such events."},{"line_number":14,"context_line":""}],"source_content_type":"text/x-gerrit-commit-message","patch_set":1,"id":"9a41bdd9_17ee9f8b","line":11,"in_reply_to":"9a41bdd9_0182e152","updated":"2015-07-11 23:28:35.000000000","message":"It is designed to hide the authorized prohibition among the 404 not found.","commit_id":"c0c0a8b8e611eb05067f5eda89a9298c1a053078"},{"author":{"_account_id":841,"name":"Akihiro Motoki","email":"amotoki@gmail.com","username":"amotoki"},"change_message_id":"bb1bca2db662baa80563e8ffce09da667365bf34","unresolved":false,"context_lines":[{"line_number":8,"context_line":""},{"line_number":9,"context_line":"When a user requests an operation prohibited by the policy"},{"line_number":10,"context_line":"(e.g. try to delete a shared network by a regular user),"},{"line_number":11,"context_line":"neutron returns 404 not found in a response, but ERROR level"},{"line_number":12,"context_line":"log will be recorded. This commit lowers the log level"},{"line_number":13,"context_line":"to INFO for such events."},{"line_number":14,"context_line":""}],"source_content_type":"text/x-gerrit-commit-message","patch_set":1,"id":"9a41bdd9_c198796d","line":11,"in_reply_to":"9a41bdd9_0182e152","updated":"2015-07-12 07:39:15.000000000","message":"Okay, I will update the commit message.\n\nAs reported in the bug report, this situation only happens when PolicyNotAuthorized is converted into NotFound error.\nThe reason of this is that if a resource is prohibited by a policy definition the resource should be hidden to unauthorized users in most cases. It works in most cases.\n\nIMHO, generally speaking it is better to raise non-webob exception and map an exception based on the fault map.","commit_id":"c0c0a8b8e611eb05067f5eda89a9298c1a053078"}],"neutron/api/v2/resource.py":[{"author":{"_account_id":11343,"name":"Gal Sagie","email":"gal.sagie@gmail.com","username":"GalSagie"},"change_message_id":"6272bbdd9bb854cc6e6afc0d593b718857e2d51c","unresolved":false,"context_lines":[{"line_number":102,"context_line":"            raise mapped_exc(**kwargs)"},{"line_number":103,"context_line":"        except webob.exc.HTTPException as e:"},{"line_number":104,"context_line":"            type_, value, tb \u003d sys.exc_info()"},{"line_number":105,"context_line":"            if hasattr(e, \u0027code\u0027) and 400 \u003c\u003d e.code \u003c 500:"},{"line_number":106,"context_line":"                LOG.info(_LI(\u0027%(action)s failed (client error): %(exc)s\u0027),"},{"line_number":107,"context_line":"                         {\u0027action\u0027: action, \u0027exc\u0027: e})"},{"line_number":108,"context_line":"            else:"}],"source_content_type":"text/x-python","patch_set":1,"id":"9a41bdd9_2187e562","line":105,"updated":"2015-07-11 15:04:59.000000000","message":"Why are you putting the entire range if you only want to recognize 404?","commit_id":"c0c0a8b8e611eb05067f5eda89a9298c1a053078"},{"author":{"_account_id":8124,"name":"cbrandily","email":"zzelle@gmail.com","username":"cbrandily"},"change_message_id":"d613c94504dca4a3806207f451265305ecdc91b7","unresolved":false,"context_lines":[{"line_number":102,"context_line":"            raise mapped_exc(**kwargs)"},{"line_number":103,"context_line":"        except webob.exc.HTTPException as e:"},{"line_number":104,"context_line":"            type_, value, tb \u003d sys.exc_info()"},{"line_number":105,"context_line":"            if hasattr(e, \u0027code\u0027) and 400 \u003c\u003d e.code \u003c 500:"},{"line_number":106,"context_line":"                LOG.info(_LI(\u0027%(action)s failed (client error): %(exc)s\u0027),"},{"line_number":107,"context_line":"                         {\u0027action\u0027: action, \u0027exc\u0027: e})"},{"line_number":108,"context_line":"            else:"}],"source_content_type":"text/x-python","patch_set":1,"id":"9a41bdd9_012bc1ec","line":105,"in_reply_to":"9a41bdd9_2187e562","updated":"2015-07-11 16:04:29.000000000","message":"Ccommit msg and implementaion should be aligned","commit_id":"c0c0a8b8e611eb05067f5eda89a9298c1a053078"},{"author":{"_account_id":841,"name":"Akihiro Motoki","email":"amotoki@gmail.com","username":"amotoki"},"change_message_id":"bb1bca2db662baa80563e8ffce09da667365bf34","unresolved":false,"context_lines":[{"line_number":102,"context_line":"            raise mapped_exc(**kwargs)"},{"line_number":103,"context_line":"        except webob.exc.HTTPException as e:"},{"line_number":104,"context_line":"            type_, value, tb \u003d sys.exc_info()"},{"line_number":105,"context_line":"            if hasattr(e, \u0027code\u0027) and 400 \u003c\u003d e.code \u003c 500:"},{"line_number":106,"context_line":"                LOG.info(_LI(\u0027%(action)s failed (client error): %(exc)s\u0027),"},{"line_number":107,"context_line":"                         {\u0027action\u0027: action, \u0027exc\u0027: e})"},{"line_number":108,"context_line":"            else:"}],"source_content_type":"text/x-python","patch_set":1,"id":"9a41bdd9_d11da210","line":105,"in_reply_to":"9a41bdd9_2187e562","updated":"2015-07-12 07:39:15.000000000","message":"This clause is specific to webob.exc.HTTPException.\nWhen we return 4xx response code, it means it is a user error\nand there is no reason to log it as ERROR.\n\nAt now I think 404 from neutron.policy.enforce is the only case but I think logging INFO for 4xx webob exception is reasonable.\n\nDo you think limiting to 404 is better?","commit_id":"c0c0a8b8e611eb05067f5eda89a9298c1a053078"},{"author":{"_account_id":2874,"name":"yong sheng gong","email":"gong.yongsheng@99cloud.net","username":"gongysh"},"change_message_id":"f6b9b4eef74955214543734c334c3c93b7e46bdd","unresolved":false,"context_lines":[{"line_number":102,"context_line":"            raise mapped_exc(**kwargs)"},{"line_number":103,"context_line":"        except webob.exc.HTTPException as e:"},{"line_number":104,"context_line":"            type_, value, tb \u003d sys.exc_info()"},{"line_number":105,"context_line":"            if hasattr(e, \u0027code\u0027) and 400 \u003c\u003d e.code \u003c 500:"},{"line_number":106,"context_line":"                LOG.info(_LI(\u0027%(action)s failed (client error): %(exc)s\u0027),"},{"line_number":107,"context_line":"                         {\u0027action\u0027: action, \u0027exc\u0027: e})"},{"line_number":108,"context_line":"            else:"}],"source_content_type":"text/x-python","patch_set":1,"id":"9a41bdd9_d7e7d7aa","line":105,"in_reply_to":"9a41bdd9_2187e562","updated":"2015-07-11 23:28:35.000000000","message":"agree with GalSagie, why to enlarge the code range?","commit_id":"c0c0a8b8e611eb05067f5eda89a9298c1a053078"},{"author":{"_account_id":2874,"name":"yong sheng gong","email":"gong.yongsheng@99cloud.net","username":"gongysh"},"change_message_id":"bae8da8315ae039d0a0dab483747b3e46486f46e","unresolved":false,"context_lines":[{"line_number":103,"context_line":"        except webob.exc.HTTPException as e:"},{"line_number":104,"context_line":"            type_, value, tb \u003d sys.exc_info()"},{"line_number":105,"context_line":"            if hasattr(e, \u0027code\u0027) and 400 \u003c\u003d e.code \u003c 500:"},{"line_number":106,"context_line":"                LOG.info(_LI(\u0027%(action)s failed (client error): %(exc)s\u0027),"},{"line_number":107,"context_line":"                         {\u0027action\u0027: action, \u0027exc\u0027: e})"},{"line_number":108,"context_line":"            else:"},{"line_number":109,"context_line":"                LOG.exception(_LE(\u0027%s failed\u0027), action)"}],"source_content_type":"text/x-python","patch_set":2,"id":"9a41bdd9_3f3c7e2e","line":106,"updated":"2015-07-14 04:28:54.000000000","message":"maybe use warning is better?","commit_id":"2d390876b99c7ee227543663aa7345ba4bef714c"},{"author":{"_account_id":841,"name":"Akihiro Motoki","email":"amotoki@gmail.com","username":"amotoki"},"change_message_id":"c4ec8c2b3b15bb3b8c0dea497fec76302cc7173d","unresolved":false,"context_lines":[{"line_number":103,"context_line":"        except webob.exc.HTTPException as e:"},{"line_number":104,"context_line":"            type_, value, tb \u003d sys.exc_info()"},{"line_number":105,"context_line":"            if hasattr(e, \u0027code\u0027) and 400 \u003c\u003d e.code \u003c 500:"},{"line_number":106,"context_line":"                LOG.info(_LI(\u0027%(action)s failed (client error): %(exc)s\u0027),"},{"line_number":107,"context_line":"                         {\u0027action\u0027: action, \u0027exc\u0027: e})"},{"line_number":108,"context_line":"            else:"},{"line_number":109,"context_line":"                LOG.exception(_LE(\u0027%s failed\u0027), action)"}],"source_content_type":"text/x-python","patch_set":2,"id":"9a41bdd9_4b6f3fc5","line":106,"in_reply_to":"9a41bdd9_3f3c7e2e","updated":"2015-07-14 09:05:25.000000000","message":"Why is \"warning\" needed? Warning means something which is not expected is happening in your system. In this case, this occurs only by user requests, so I think INFO is appropriate. It is compatible with L.94 too.","commit_id":"2d390876b99c7ee227543663aa7345ba4bef714c"},{"author":{"_account_id":2874,"name":"yong sheng gong","email":"gong.yongsheng@99cloud.net","username":"gongysh"},"change_message_id":"e12b30a23629a0e83e2b88677c82379ecf92bbb9","unresolved":false,"context_lines":[{"line_number":103,"context_line":"        except webob.exc.HTTPException as e:"},{"line_number":104,"context_line":"            type_, value, tb \u003d sys.exc_info()"},{"line_number":105,"context_line":"            if hasattr(e, \u0027code\u0027) and 400 \u003c\u003d e.code \u003c 500:"},{"line_number":106,"context_line":"                LOG.info(_LI(\u0027%(action)s failed (client error): %(exc)s\u0027),"},{"line_number":107,"context_line":"                         {\u0027action\u0027: action, \u0027exc\u0027: e})"},{"line_number":108,"context_line":"            else:"},{"line_number":109,"context_line":"                LOG.exception(_LE(\u0027%s failed\u0027), action)"}],"source_content_type":"text/x-python","patch_set":2,"id":"9a41bdd9_eb689389","line":106,"in_reply_to":"9a41bdd9_4b6f3fc5","updated":"2015-07-14 09:08:57.000000000","message":"IMHO, If we are raising non-authorized converted 403, it should be an unusual exception. If it is just user error for not existed resources, it is normal flow.","commit_id":"2d390876b99c7ee227543663aa7345ba4bef714c"}]}
