)]}'
{"nova/api/metadata/handler.py":[{"author":{"_account_id":26458,"name":"Brin Zhang","email":"zhangbailin@inspur.com","username":"zhangbailin"},"change_message_id":"0ad3b50397a49c423f41ffca15165ff4a54bccfa","unresolved":false,"context_lines":[{"line_number":248,"context_line":""},{"line_number":249,"context_line":"        if len(ports) !\u003d 1:"},{"line_number":250,"context_line":"            msg \u003d _(\u0027Expected a single port matching provider %(pr)s \u0027"},{"line_number":251,"context_line":"                    \u0027and IP %(ip)s. Found %(count)d.\u0027) % {"},{"line_number":252,"context_line":"                        \u0027pr\u0027: provider_id,"},{"line_number":253,"context_line":"                        \u0027ip\u0027: instance_address,"},{"line_number":254,"context_line":"                        \u0027count\u0027: len(ports)}"}],"source_content_type":"text/x-python","patch_set":3,"id":"1fa4df85_71873663","line":251,"updated":"2020-02-28 04:41:10.000000000","message":"Looks good, but IMHO, I don\u0027t see any obvious mistakes.","commit_id":"320429efb558b3e745d0c8603eac44e1d4c204d1"},{"author":{"_account_id":26458,"name":"Brin Zhang","email":"zhangbailin@inspur.com","username":"zhangbailin"},"change_message_id":"2423affce16fff89bf62174d47b32bc259a918bd","unresolved":false,"context_lines":[{"line_number":248,"context_line":""},{"line_number":249,"context_line":"        if len(ports) !\u003d 1:"},{"line_number":250,"context_line":"            msg \u003d _(\u0027Expected a single port matching provider %(pr)s \u0027"},{"line_number":251,"context_line":"                    \u0027and IP %(ip)s. Found %(count)d.\u0027) % {"},{"line_number":252,"context_line":"                        \u0027pr\u0027: provider_id,"},{"line_number":253,"context_line":"                        \u0027ip\u0027: instance_address,"},{"line_number":254,"context_line":"                        \u0027count\u0027: len(ports)}"}],"source_content_type":"text/x-python","patch_set":3,"id":"1fa4df85_fcd0d6f9","line":251,"in_reply_to":"1fa4df85_09049649","updated":"2020-02-28 14:04:56.000000000","message":"Ok, thanks efried, the analysis is very clear, I understand, thank you, I will pay attention to this in subsequent reviews.\n\nI like this way [1], use two \"()\", I think it\u0027s clear and easy to distinguish.\n\n[1]https://github.com/openstack/nova/blob/master/nova/service.py#L343-L346","commit_id":"320429efb558b3e745d0c8603eac44e1d4c204d1"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"a4523bf58470c23bfa15ddf9e7bb598159fab605","unresolved":false,"context_lines":[{"line_number":248,"context_line":""},{"line_number":249,"context_line":"        if len(ports) !\u003d 1:"},{"line_number":250,"context_line":"            msg \u003d _(\u0027Expected a single port matching provider %(pr)s \u0027"},{"line_number":251,"context_line":"                    \u0027and IP %(ip)s. Found %(count)d.\u0027) % {"},{"line_number":252,"context_line":"                        \u0027pr\u0027: provider_id,"},{"line_number":253,"context_line":"                        \u0027ip\u0027: instance_address,"},{"line_number":254,"context_line":"                        \u0027count\u0027: len(ports)}"}],"source_content_type":"text/x-python","patch_set":3,"id":"1fa4df85_09049649","line":251,"in_reply_to":"1fa4df85_71873663","updated":"2020-02-28 13:10:02.000000000","message":"It’s tough to spot (which is why it wasn’t caught during review), but it’s the difference between\n\n msg \u003d _(“...fmt...” % args)\n\nand \n\n msg \u003d _(“...fmt...”) % args\n\nIn the first one, variable interpolation is done on the (untranslated) marker string. Since the translation logic matches the marker string complete with format codes (%(foo)s etc), the result is most likely that this wouldn’t be “found” in the catalog and therefore not translated. TL;DR: you would see this message in English instead of your chosen/configured language. \n\nThe second example shows how it’s supposed to work: the translation function operates on the raw marker string, so you get a translated format string complete with codes. *Then* the args are substituted in.","commit_id":"320429efb558b3e745d0c8603eac44e1d4c204d1"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"ecafa7317b5011c9f4281748b5aedda36ad8ddee","unresolved":false,"context_lines":[{"line_number":248,"context_line":""},{"line_number":249,"context_line":"        if len(ports) !\u003d 1:"},{"line_number":250,"context_line":"            msg \u003d _(\u0027Expected a single port matching provider %(pr)s \u0027"},{"line_number":251,"context_line":"                    \u0027and IP %(ip)s. Found %(count)d.\u0027) % {"},{"line_number":252,"context_line":"                        \u0027pr\u0027: provider_id,"},{"line_number":253,"context_line":"                        \u0027ip\u0027: instance_address,"},{"line_number":254,"context_line":"                        \u0027count\u0027: len(ports)}"}],"source_content_type":"text/x-python","patch_set":3,"id":"1fa4df85_1fd604c5","line":251,"in_reply_to":"1fa4df85_fcd0d6f9","updated":"2020-02-28 14:47:56.000000000","message":"\u003e I like this way [1], use two \"()\", I think it\u0027s clear and easy to\n \u003e distinguish.\n \u003e \n \u003e [1]https://github.com/openstack/nova/blob/master/nova/service.py#L343-L346\n\nIn that one, I think they chose to use outer parentheses rather than putting the opening brace of the args dict on the same line (or using a backslash). I don\u0027t think it was for clarity.","commit_id":"320429efb558b3e745d0c8603eac44e1d4c204d1"},{"author":{"_account_id":8556,"name":"Ghanshyam Maan","display_name":"Ghanshyam Maan","email":"gmaan.os14@gmail.com","username":"ghanshyam"},"change_message_id":"6828a9227f6c50ce4e419356f4f55c1a604c9834","unresolved":false,"context_lines":[{"line_number":248,"context_line":""},{"line_number":249,"context_line":"        if len(ports) !\u003d 1:"},{"line_number":250,"context_line":"            msg \u003d _(\u0027Expected a single port matching provider %(pr)s \u0027"},{"line_number":251,"context_line":"                    \u0027and IP %(ip)s. Found %(count)d.\u0027) % {"},{"line_number":252,"context_line":"                        \u0027pr\u0027: provider_id,"},{"line_number":253,"context_line":"                        \u0027ip\u0027: instance_address,"},{"line_number":254,"context_line":"                        \u0027count\u0027: len(ports)}"}],"source_content_type":"text/x-python","patch_set":3,"id":"1fa4df85_1f9364a5","line":251,"in_reply_to":"1fa4df85_fcd0d6f9","updated":"2020-02-28 14:23:48.000000000","message":"yeah, to distinguish the translated string, formatting keywords have to be separated.","commit_id":"320429efb558b3e745d0c8603eac44e1d4c204d1"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"a4523bf58470c23bfa15ddf9e7bb598159fab605","unresolved":false,"context_lines":[{"line_number":253,"context_line":"                        \u0027ip\u0027: instance_address,"},{"line_number":254,"context_line":"                        \u0027count\u0027: len(ports)}"},{"line_number":255,"context_line":""},{"line_number":256,"context_line":"            LOG.error(msg)"},{"line_number":257,"context_line":"            raise webob.exc.HTTPBadRequest(explanation\u003dmsg)"},{"line_number":258,"context_line":""},{"line_number":259,"context_line":"        instance_data \u003d ports[0]"}],"source_content_type":"text/x-python","patch_set":3,"id":"1fa4df85_29add230","line":256,"range":{"start_line":256,"start_character":16,"end_line":256,"end_character":21},"updated":"2020-02-28 13:10:02.000000000","message":"Side note: we’re not supposed to do this. Technically we’re supposed to maintain two different messages, one translated and one not, and use the former for the exception and the latter for logging. That would be a separate change though, and there are a million more casesthat could be fixed.","commit_id":"320429efb558b3e745d0c8603eac44e1d4c204d1"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"ecafa7317b5011c9f4281748b5aedda36ad8ddee","unresolved":false,"context_lines":[{"line_number":253,"context_line":"                        \u0027ip\u0027: instance_address,"},{"line_number":254,"context_line":"                        \u0027count\u0027: len(ports)}"},{"line_number":255,"context_line":""},{"line_number":256,"context_line":"            LOG.error(msg)"},{"line_number":257,"context_line":"            raise webob.exc.HTTPBadRequest(explanation\u003dmsg)"},{"line_number":258,"context_line":""},{"line_number":259,"context_line":"        instance_data \u003d ports[0]"}],"source_content_type":"text/x-python","patch_set":3,"id":"1fa4df85_ff276811","line":256,"range":{"start_line":256,"start_character":16,"end_line":256,"end_character":21},"in_reply_to":"1fa4df85_1ff4c4ce","updated":"2020-02-28 14:47:56.000000000","message":"We don\u0027t translate logs anymore. This chunk is probably a holdover from when we did. So in this case you would see a translated log message in the middle of untranslated ones.","commit_id":"320429efb558b3e745d0c8603eac44e1d4c204d1"},{"author":{"_account_id":8556,"name":"Ghanshyam Maan","display_name":"Ghanshyam Maan","email":"gmaan.os14@gmail.com","username":"ghanshyam"},"change_message_id":"6828a9227f6c50ce4e419356f4f55c1a604c9834","unresolved":false,"context_lines":[{"line_number":253,"context_line":"                        \u0027ip\u0027: instance_address,"},{"line_number":254,"context_line":"                        \u0027count\u0027: len(ports)}"},{"line_number":255,"context_line":""},{"line_number":256,"context_line":"            LOG.error(msg)"},{"line_number":257,"context_line":"            raise webob.exc.HTTPBadRequest(explanation\u003dmsg)"},{"line_number":258,"context_line":""},{"line_number":259,"context_line":"        instance_data \u003d ports[0]"}],"source_content_type":"text/x-python","patch_set":3,"id":"1fa4df85_1ff4c4ce","line":256,"range":{"start_line":256,"start_character":16,"end_line":256,"end_character":21},"in_reply_to":"1fa4df85_29add230","updated":"2020-02-28 14:23:48.000000000","message":"but every log supposed to be translated in translation right? I mean we do not need to keep English message along with same translated logs.","commit_id":"320429efb558b3e745d0c8603eac44e1d4c204d1"},{"author":{"_account_id":8556,"name":"Ghanshyam Maan","display_name":"Ghanshyam Maan","email":"gmaan.os14@gmail.com","username":"ghanshyam"},"change_message_id":"6a44cc78fbb5cd0be439da988758d077c41274a0","unresolved":false,"context_lines":[{"line_number":253,"context_line":"                        \u0027ip\u0027: instance_address,"},{"line_number":254,"context_line":"                        \u0027count\u0027: len(ports)}"},{"line_number":255,"context_line":""},{"line_number":256,"context_line":"            LOG.error(msg)"},{"line_number":257,"context_line":"            raise webob.exc.HTTPBadRequest(explanation\u003dmsg)"},{"line_number":258,"context_line":""},{"line_number":259,"context_line":"        instance_data \u003d ports[0]"}],"source_content_type":"text/x-python","patch_set":3,"id":"1fa4df85_58cb2d1d","line":256,"range":{"start_line":256,"start_character":16,"end_line":256,"end_character":21},"in_reply_to":"1fa4df85_ff276811","updated":"2020-02-29 02:40:20.000000000","message":"ah yeah, got your point now. +1.\nI am sure most of the projects are not cleaned up for that.","commit_id":"320429efb558b3e745d0c8603eac44e1d4c204d1"},{"author":{"_account_id":26458,"name":"Brin Zhang","email":"zhangbailin@inspur.com","username":"zhangbailin"},"change_message_id":"0ad3b50397a49c423f41ffca15165ff4a54bccfa","unresolved":false,"context_lines":[{"line_number":308,"context_line":"        if (not signature or"},{"line_number":309,"context_line":"            not secutils.constant_time_compare(expected_signature, signature)):"},{"line_number":310,"context_line":"            if requestor_id:"},{"line_number":311,"context_line":"                LOG.warning(\u0027X-Instance-ID-Signature: %(signature)s does \u0027"},{"line_number":312,"context_line":"                            \u0027not match the expected value: \u0027"},{"line_number":313,"context_line":"                            \u0027%(expected_signature)s for id: \u0027"},{"line_number":314,"context_line":"                            \u0027%(requestor_id)s. Request From: \u0027"},{"line_number":315,"context_line":"                            \u0027%(requestor_address)s\u0027,"},{"line_number":316,"context_line":"                            {\u0027signature\u0027: signature,"},{"line_number":317,"context_line":"                             \u0027expected_signature\u0027: expected_signature,"},{"line_number":318,"context_line":"                             \u0027requestor_id\u0027: requestor_id,"},{"line_number":319,"context_line":"                             \u0027requestor_address\u0027: requestor_address})"},{"line_number":320,"context_line":"            msg \u003d _(\u0027Invalid proxy request signature.\u0027)"},{"line_number":321,"context_line":"            raise webob.exc.HTTPForbidden(explanation\u003dmsg)"},{"line_number":322,"context_line":""}],"source_content_type":"text/x-python","patch_set":3,"id":"1fa4df85_117e026b","line":319,"range":{"start_line":311,"start_character":28,"end_line":319,"end_character":68},"updated":"2020-02-28 04:41:10.000000000","message":"How is the above change different from here?","commit_id":"320429efb558b3e745d0c8603eac44e1d4c204d1"},{"author":{"_account_id":8556,"name":"Ghanshyam Maan","display_name":"Ghanshyam Maan","email":"gmaan.os14@gmail.com","username":"ghanshyam"},"change_message_id":"6828a9227f6c50ce4e419356f4f55c1a604c9834","unresolved":false,"context_lines":[{"line_number":308,"context_line":"        if (not signature or"},{"line_number":309,"context_line":"            not secutils.constant_time_compare(expected_signature, signature)):"},{"line_number":310,"context_line":"            if requestor_id:"},{"line_number":311,"context_line":"                LOG.warning(\u0027X-Instance-ID-Signature: %(signature)s does \u0027"},{"line_number":312,"context_line":"                            \u0027not match the expected value: \u0027"},{"line_number":313,"context_line":"                            \u0027%(expected_signature)s for id: \u0027"},{"line_number":314,"context_line":"                            \u0027%(requestor_id)s. Request From: \u0027"},{"line_number":315,"context_line":"                            \u0027%(requestor_address)s\u0027,"},{"line_number":316,"context_line":"                            {\u0027signature\u0027: signature,"},{"line_number":317,"context_line":"                             \u0027expected_signature\u0027: expected_signature,"},{"line_number":318,"context_line":"                             \u0027requestor_id\u0027: requestor_id,"},{"line_number":319,"context_line":"                             \u0027requestor_address\u0027: requestor_address})"},{"line_number":320,"context_line":"            msg \u003d _(\u0027Invalid proxy request signature.\u0027)"},{"line_number":321,"context_line":"            raise webob.exc.HTTPForbidden(explanation\u003dmsg)"},{"line_number":322,"context_line":""}],"source_content_type":"text/x-python","patch_set":3,"id":"1fa4df85_1faa84d1","line":319,"range":{"start_line":311,"start_character":28,"end_line":319,"end_character":68},"in_reply_to":"1fa4df85_0989f6c8","updated":"2020-02-28 14:23:48.000000000","message":"yeah, issue is for localization string.","commit_id":"320429efb558b3e745d0c8603eac44e1d4c204d1"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"a4523bf58470c23bfa15ddf9e7bb598159fab605","unresolved":false,"context_lines":[{"line_number":308,"context_line":"        if (not signature or"},{"line_number":309,"context_line":"            not secutils.constant_time_compare(expected_signature, signature)):"},{"line_number":310,"context_line":"            if requestor_id:"},{"line_number":311,"context_line":"                LOG.warning(\u0027X-Instance-ID-Signature: %(signature)s does \u0027"},{"line_number":312,"context_line":"                            \u0027not match the expected value: \u0027"},{"line_number":313,"context_line":"                            \u0027%(expected_signature)s for id: \u0027"},{"line_number":314,"context_line":"                            \u0027%(requestor_id)s. Request From: \u0027"},{"line_number":315,"context_line":"                            \u0027%(requestor_address)s\u0027,"},{"line_number":316,"context_line":"                            {\u0027signature\u0027: signature,"},{"line_number":317,"context_line":"                             \u0027expected_signature\u0027: expected_signature,"},{"line_number":318,"context_line":"                             \u0027requestor_id\u0027: requestor_id,"},{"line_number":319,"context_line":"                             \u0027requestor_address\u0027: requestor_address})"},{"line_number":320,"context_line":"            msg \u003d _(\u0027Invalid proxy request signature.\u0027)"},{"line_number":321,"context_line":"            raise webob.exc.HTTPForbidden(explanation\u003dmsg)"},{"line_number":322,"context_line":""}],"source_content_type":"text/x-python","patch_set":3,"id":"1fa4df85_0989f6c8","line":319,"range":{"start_line":311,"start_character":28,"end_line":319,"end_character":68},"in_reply_to":"1fa4df85_117e026b","updated":"2020-02-28 13:10:02.000000000","message":"There’s no translation happening here.","commit_id":"320429efb558b3e745d0c8603eac44e1d4c204d1"}]}
