)]}'
{"/PATCHSET_LEVEL":[{"author":{"_account_id":16688,"name":"Rodolfo Alonso","email":"ralonsoh@redhat.com","username":"rodolfo-alonso-hernandez"},"change_message_id":"0d883e686722ff6439a2f01cfbb4438995d1193d","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":3,"id":"a571bd5e_f869a7ae","updated":"2025-11-17 15:04:26.000000000","message":"Good catch, minor comment.","commit_id":"04365ca69a8b8286a87c82d12ed5dbea26f0fdcd"},{"author":{"_account_id":6577,"name":"Sergey Kraynev","email":"sergejyit@gmail.com","username":"skraynev"},"change_message_id":"0596a8e4cf718e07e85e971ca888301b4a73fe36","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":5,"id":"0fff9462_9bd67bd4","updated":"2025-11-21 06:59:45.000000000","message":"I updated code according provided suggestions","commit_id":"77917d73056609e34f51274ecb31fc3aa1fe2f57"},{"author":{"_account_id":16688,"name":"Rodolfo Alonso","email":"ralonsoh@redhat.com","username":"rodolfo-alonso-hernandez"},"change_message_id":"08f65e1c076295180493d9b2896242ccc2d40692","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":6,"id":"9db96102_94179dab","updated":"2025-11-24 08:23:48.000000000","message":"Once merged, we should backport this patch.","commit_id":"d95e3e5eaf24ee788d65255d669671e175f25208"},{"author":{"_account_id":6577,"name":"Sergey Kraynev","email":"sergejyit@gmail.com","username":"skraynev"},"change_message_id":"54edb464ee68f06688a5fccff900efcd02b3cd26","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":6,"id":"4243f8e7_8b167dff","updated":"2025-11-21 09:47:39.000000000","message":"recheck","commit_id":"d95e3e5eaf24ee788d65255d669671e175f25208"},{"author":{"_account_id":16688,"name":"Rodolfo Alonso","email":"ralonsoh@redhat.com","username":"rodolfo-alonso-hernandez"},"change_message_id":"08f65e1c076295180493d9b2896242ccc2d40692","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":6,"id":"3459c292_5f93e6a4","in_reply_to":"4243f8e7_8b167dff","updated":"2025-11-24 08:23:48.000000000","message":"In Neutron we void empty re-checks. It is needed to provide a reason, including, if possible, some analysis of the failed CI job.","commit_id":"d95e3e5eaf24ee788d65255d669671e175f25208"}],"neutron/pecan_wsgi/hooks/policy_enforcement.py":[{"author":{"_account_id":16688,"name":"Rodolfo Alonso","email":"ralonsoh@redhat.com","username":"rodolfo-alonso-hernandez"},"change_message_id":"0d883e686722ff6439a2f01cfbb4438995d1193d","unresolved":true,"context_lines":[{"line_number":188,"context_line":"            # we have to set the status_code here to prevent the catch_errors"},{"line_number":189,"context_line":"            # middleware from turning this into a 500."},{"line_number":190,"context_line":"            state.response.status_code \u003d 404"},{"line_number":191,"context_line":"            # replace the original body on NotFound body"},{"line_number":192,"context_line":"            state.response.json \u003d {"},{"line_number":193,"context_line":"                \u0027type\u0027: \u0027HTTPNotFound\u0027,"},{"line_number":194,"context_line":"                \u0027message\u0027: \u0027The resource could not be found.\u0027,"}],"source_content_type":"text/x-python","patch_set":3,"id":"489a2731_858e1415","line":191,"range":{"start_line":191,"start_character":12,"end_line":191,"end_character":56},"updated":"2025-11-17 15:04:26.000000000","message":"The body can be emptied just assigning this:\n`state.response.body \u003d b\u0027\u0027`\n\nThe `json` property is formatted from the content of `body` [1]\n\n[1]https://github.com/Pylons/webob/blob/39d5af3c797e7b867f152c2e8c979de42d029403/src/webob/response.py#L603-L609","commit_id":"04365ca69a8b8286a87c82d12ed5dbea26f0fdcd"},{"author":{"_account_id":6577,"name":"Sergey Kraynev","email":"sergejyit@gmail.com","username":"skraynev"},"change_message_id":"ad57b85a67922d57994de776d76a65b60074cef4","unresolved":true,"context_lines":[{"line_number":188,"context_line":"            # we have to set the status_code here to prevent the catch_errors"},{"line_number":189,"context_line":"            # middleware from turning this into a 500."},{"line_number":190,"context_line":"            state.response.status_code \u003d 404"},{"line_number":191,"context_line":"            # replace the original body on NotFound body"},{"line_number":192,"context_line":"            state.response.json \u003d {"},{"line_number":193,"context_line":"                \u0027type\u0027: \u0027HTTPNotFound\u0027,"},{"line_number":194,"context_line":"                \u0027message\u0027: \u0027The resource could not be found.\u0027,"}],"source_content_type":"text/x-python","patch_set":3,"id":"4b9a66a6_bbf61c34","line":191,"range":{"start_line":191,"start_character":12,"end_line":191,"end_character":56},"in_reply_to":"489a2731_858e1415","updated":"2025-11-17 16:36:45.000000000","message":"The key idea is to add body the same as on original NotFound error.\nI think it allows better hide replacement fact, than just clearing real response.\n\nIf it\u0027s ok, I could assign the json to body attr.","commit_id":"04365ca69a8b8286a87c82d12ed5dbea26f0fdcd"},{"author":{"_account_id":11975,"name":"Slawek Kaplonski","email":"skaplons@redhat.com","username":"slaweq"},"change_message_id":"3bb05dbb7485eae7ccf3a72396c57e15bd4c037e","unresolved":true,"context_lines":[{"line_number":188,"context_line":"            # we have to set the status_code here to prevent the catch_errors"},{"line_number":189,"context_line":"            # middleware from turning this into a 500."},{"line_number":190,"context_line":"            state.response.status_code \u003d 404"},{"line_number":191,"context_line":"            # replace the original body on NotFound body"},{"line_number":192,"context_line":"            state.response.json \u003d {"},{"line_number":193,"context_line":"                \u0027type\u0027: \u0027HTTPNotFound\u0027,"},{"line_number":194,"context_line":"                \u0027message\u0027: \u0027The resource could not be found.\u0027,"}],"source_content_type":"text/x-python","patch_set":3,"id":"bfb55ecf_22a904a7","line":191,"range":{"start_line":191,"start_character":12,"end_line":191,"end_character":56},"in_reply_to":"4b9a66a6_bbf61c34","updated":"2025-11-19 10:10:45.000000000","message":"It is fine for me to do it that way and return more \"real\" 404","commit_id":"04365ca69a8b8286a87c82d12ed5dbea26f0fdcd"},{"author":{"_account_id":6577,"name":"Sergey Kraynev","email":"sergejyit@gmail.com","username":"skraynev"},"change_message_id":"0596a8e4cf718e07e85e971ca888301b4a73fe36","unresolved":false,"context_lines":[{"line_number":188,"context_line":"            # we have to set the status_code here to prevent the catch_errors"},{"line_number":189,"context_line":"            # middleware from turning this into a 500."},{"line_number":190,"context_line":"            state.response.status_code \u003d 404"},{"line_number":191,"context_line":"            # replace the original body on NotFound body"},{"line_number":192,"context_line":"            state.response.json \u003d {"},{"line_number":193,"context_line":"                \u0027type\u0027: \u0027HTTPNotFound\u0027,"},{"line_number":194,"context_line":"                \u0027message\u0027: \u0027The resource could not be found.\u0027,"}],"source_content_type":"text/x-python","patch_set":3,"id":"eaf235fa_bab96126","line":191,"range":{"start_line":191,"start_character":12,"end_line":191,"end_character":56},"in_reply_to":"bfb55ecf_22a904a7","updated":"2025-11-21 06:59:45.000000000","message":"Done","commit_id":"04365ca69a8b8286a87c82d12ed5dbea26f0fdcd"},{"author":{"_account_id":16688,"name":"Rodolfo Alonso","email":"ralonsoh@redhat.com","username":"rodolfo-alonso-hernandez"},"change_message_id":"45284fbd5019a970718d23a5cc75358a19d9f52a","unresolved":true,"context_lines":[{"line_number":193,"context_line":"                \u0027type\u0027: \u0027HTTPNotFound\u0027,"},{"line_number":194,"context_line":"                \u0027message\u0027: \u0027The resource could not be found.\u0027,"},{"line_number":195,"context_line":"                \u0027detail\u0027: \u0027\u0027"},{"line_number":196,"context_line":"            }"},{"line_number":197,"context_line":"            return"},{"line_number":198,"context_line":""},{"line_number":199,"context_line":"        if is_single:"}],"source_content_type":"text/x-python","patch_set":4,"id":"f3bbb8a5_f2582cb5","line":196,"updated":"2025-11-19 15:39:51.000000000","message":"Same comment as in PS3: it is not a good practice to directly write the `pecan.core.Response.json` variable. From Gemini (that provides a much better reply):\n\"\"\"\nIt is generally not considered a good practice to directly assign the pecan.core.Response.json property in Pecan, especially if you are also setting the status code or custom headers.\n\nWhile Pecan\u0027s response object (a subclass of WebOb\u0027s Response) does have a json property that handles serialization/deserialization, using it can sometimes be less explicit or interfere with other settings, such as the status code you needed for the 404 error.\n\"\"\"\n\nSo the recommendation here is to use the other properties of the object. This is the suggested code:\n`\nfrom oslo_serialization import jsonutils\n...\n            state.response.status_code \u003d 404\n            error_message \u003d {\n                \u0027NeutronError\u0027: {\n                    \u0027type\u0027: \u0027ObjectNotFound\u0027,\n                    \u0027message\u0027: \u0027Object not found.\u0027,\n                    \u0027detail\u0027: \u0027\u0027\n                }\n            }\n            state.response.text \u003d jsonutils.dumps(error_message)\n            state.response.content_type \u003d \u0027application/json\u0027\n`\n\nNOTE: the exception type and the message derives from `neutron_lib.exceptions.ObjectNotFound`, that is the generic exception for a missing object, without referring the type. `HTTPNotFound` is not a Neutron exception.","commit_id":"5adb905616afbd7b33c55fb08657ede805c5ea0a"},{"author":{"_account_id":6577,"name":"Sergey Kraynev","email":"sergejyit@gmail.com","username":"skraynev"},"change_message_id":"9c0cb9d97c8a78ddca0bb34162ad219d22b56124","unresolved":true,"context_lines":[{"line_number":193,"context_line":"                \u0027type\u0027: \u0027HTTPNotFound\u0027,"},{"line_number":194,"context_line":"                \u0027message\u0027: \u0027The resource could not be found.\u0027,"},{"line_number":195,"context_line":"                \u0027detail\u0027: \u0027\u0027"},{"line_number":196,"context_line":"            }"},{"line_number":197,"context_line":"            return"},{"line_number":198,"context_line":""},{"line_number":199,"context_line":"        if is_single:"}],"source_content_type":"text/x-python","patch_set":4,"id":"fc17d28f_4b4e1085","line":196,"in_reply_to":"f3bbb8a5_f2582cb5","updated":"2025-11-20 17:51:06.000000000","message":"sure, I will use this approach.\nI just waited agreement about using non empty body.\n\nActually I took the body from the another error, when tried the same scenario for routers. \nMoreover in \"before\" method also used not Neutron Error message:\n     raise webob.exc.HTTPNotFound(msg)","commit_id":"5adb905616afbd7b33c55fb08657ede805c5ea0a"},{"author":{"_account_id":6577,"name":"Sergey Kraynev","email":"sergejyit@gmail.com","username":"skraynev"},"change_message_id":"0596a8e4cf718e07e85e971ca888301b4a73fe36","unresolved":false,"context_lines":[{"line_number":193,"context_line":"                \u0027type\u0027: \u0027HTTPNotFound\u0027,"},{"line_number":194,"context_line":"                \u0027message\u0027: \u0027The resource could not be found.\u0027,"},{"line_number":195,"context_line":"                \u0027detail\u0027: \u0027\u0027"},{"line_number":196,"context_line":"            }"},{"line_number":197,"context_line":"            return"},{"line_number":198,"context_line":""},{"line_number":199,"context_line":"        if is_single:"}],"source_content_type":"text/x-python","patch_set":4,"id":"d79ce178_8cc727ff","line":196,"in_reply_to":"fc17d28f_4b4e1085","updated":"2025-11-21 06:59:45.000000000","message":"Done","commit_id":"5adb905616afbd7b33c55fb08657ede805c5ea0a"}]}
