)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":9171,"name":"Vipin Balachandran","email":"vipin.bl@gmail.com","username":"vbala"},"change_message_id":"cf0367c876ff0cf2793eed55dc38fe57a12a84ad","unresolved":false,"context_lines":[{"line_number":7,"context_line":"Fix logging guideline violations in volume/api.py"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"There were a few cases where logging was not following"},{"line_number":10,"context_line":"the logging guidelines for i18m, delayed string"},{"line_number":11,"context_line":"interpolation, and non-duplicating strings at different"},{"line_number":12,"context_line":"levels. This patch cleans up those instances."},{"line_number":13,"context_line":""}],"source_content_type":"text/x-gerrit-commit-message","patch_set":2,"id":"da86d52c_e266a8ba","line":10,"updated":"2015-02-17 09:31:27.000000000","message":"i18n","commit_id":"d0eee703ef76d547cbec3ef270952ac14325c3a2"},{"author":{"_account_id":11904,"name":"Sean McGinnis","email":"sean.mcginnis@gmail.com","username":"SeanM"},"change_message_id":"0131b6c663229910226ceb65d538e2759beb76d1","unresolved":false,"context_lines":[{"line_number":7,"context_line":"Fix logging guideline violations in volume/api.py"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"There were a few cases where logging was not following"},{"line_number":10,"context_line":"the logging guidelines for i18m, delayed string"},{"line_number":11,"context_line":"interpolation, and non-duplicating strings at different"},{"line_number":12,"context_line":"levels. This patch cleans up those instances."},{"line_number":13,"context_line":""}],"source_content_type":"text/x-gerrit-commit-message","patch_set":2,"id":"da86d52c_be8e8325","line":10,"in_reply_to":"da86d52c_e266a8ba","updated":"2015-02-17 13:20:01.000000000","message":"Hah, good catch. I\u0027ll update that if I need to do another patchset. Thanks!","commit_id":"d0eee703ef76d547cbec3ef270952ac14325c3a2"}],"cinder/volume/api.py":[{"author":{"_account_id":10379,"name":"Rajini Karthik","email":"rrajini@gmail.com","username":"rajinir"},"change_message_id":"4fa0bca4d17beb1b34d510d6ec34c40ec3985c27","unresolved":false,"context_lines":[{"line_number":237,"context_line":"                                                 availability_zones,"},{"line_number":238,"context_line":"                                                 create_what)"},{"line_number":239,"context_line":"        except Exception:"},{"line_number":240,"context_line":"            msg \u003d _(\u0027Failed to create api volume flow.\u0027)"},{"line_number":241,"context_line":"            LOG.exception(msg)"},{"line_number":242,"context_line":"            raise exception.CinderException(msg)"},{"line_number":243,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"da86d52c_9fa39eb0","line":240,"updated":"2015-02-16 15:36:24.000000000","message":"Missed _LE ?","commit_id":"f347bb94565103d16b946ce247a54c0e31c616bc"},{"author":{"_account_id":11904,"name":"Sean McGinnis","email":"sean.mcginnis@gmail.com","username":"SeanM"},"change_message_id":"4152a9d31a868879112a5a0c9d01d139c2c5ecc0","unresolved":false,"context_lines":[{"line_number":237,"context_line":"                                                 availability_zones,"},{"line_number":238,"context_line":"                                                 create_what)"},{"line_number":239,"context_line":"        except Exception:"},{"line_number":240,"context_line":"            msg \u003d _(\u0027Failed to create api volume flow.\u0027)"},{"line_number":241,"context_line":"            LOG.exception(msg)"},{"line_number":242,"context_line":"            raise exception.CinderException(msg)"},{"line_number":243,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"da86d52c_3fc39239","line":240,"in_reply_to":"da86d52c_9fa39eb0","updated":"2015-02-16 15:42:00.000000000","message":"We can\u0027t use _LE here because it\u0027s being used for both the logging and the exception. In that case it has to be _().\n\nHere\u0027s some info on that:\nhttp://docs.openstack.org/developer/oslo.i18n/guidelines.html#examples","commit_id":"f347bb94565103d16b946ce247a54c0e31c616bc"},{"author":{"_account_id":11600,"name":"Michał Dulko","email":"michal.dulko@gmail.com","username":"dulek"},"change_message_id":"20fb8d1a2d3b8d419923e4370e87059b528b460b","unresolved":false,"context_lines":[{"line_number":800,"context_line":"                          \u0027because it is part of a consistency \u0027"},{"line_number":801,"context_line":"                          \u0027group.\u0027), snapshot[\u0027id\u0027])"},{"line_number":802,"context_line":"            msg \u003d _(\"Snapshot %s is part of a cgsnapshot and has to be \""},{"line_number":803,"context_line":"                    \"deleted together with the cgsnapshot.\") % snapshot[\u0027id\u0027]"},{"line_number":804,"context_line":"            LOG.error(msg)"},{"line_number":805,"context_line":"            raise exception.InvalidSnapshot(reason\u003dmsg)"},{"line_number":806,"context_line":"        self.db.snapshot_update(context, snapshot[\u0027id\u0027],"}],"source_content_type":"text/x-python","patch_set":1,"id":"da86d52c_421a2a7d","line":803,"updated":"2015-02-16 16:37:11.000000000","message":"We\u0027re logging same thing two times here. This line can be probably removed if we\u0027re doing cleaning here.","commit_id":"f347bb94565103d16b946ce247a54c0e31c616bc"},{"author":{"_account_id":11600,"name":"Michał Dulko","email":"michal.dulko@gmail.com","username":"dulek"},"change_message_id":"20fb8d1a2d3b8d419923e4370e87059b528b460b","unresolved":false,"context_lines":[{"line_number":1081,"context_line":""},{"line_number":1082,"context_line":"        # Make sure volume is not part of a migration"},{"line_number":1083,"context_line":"        if volume[\u0027migration_status\u0027] is not None:"},{"line_number":1084,"context_line":"            msg \u003d _(\"Volume %s is already part of an active \""},{"line_number":1085,"context_line":"                    \"migration.\") % volume[\u0027id\u0027]"},{"line_number":1086,"context_line":"            raise exception.InvalidVolume(reason\u003dmsg)"},{"line_number":1087,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"da86d52c_25fe2006","line":1084,"updated":"2015-02-16 16:37:11.000000000","message":"Not sure why we\u0027re not logging here...","commit_id":"f347bb94565103d16b946ce247a54c0e31c616bc"},{"author":{"_account_id":170,"name":"Mike Perez","email":"thingee@gmail.com","username":"thingee"},"change_message_id":"5a11172946a598039eae8795972fdca0592b47cc","unresolved":false,"context_lines":[{"line_number":1086,"context_line":"        # We only handle volumes without snapshots for now"},{"line_number":1087,"context_line":"        snaps \u003d self.db.snapshot_get_all_for_volume(context, volume[\u0027id\u0027])"},{"line_number":1088,"context_line":"        if snaps:"},{"line_number":1089,"context_line":"            msg \u003d _(\"Volume %s must not have snapshots.\") % volume[\u0027id\u0027]"},{"line_number":1090,"context_line":"            LOG.error(msg)"},{"line_number":1091,"context_line":"            raise exception.InvalidVolume(reason\u003dmsg)"},{"line_number":1092,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"da86d52c_fc2b7f7f","line":1089,"updated":"2015-02-18 07:36:49.000000000","message":"_LE","commit_id":"d0eee703ef76d547cbec3ef270952ac14325c3a2"},{"author":{"_account_id":170,"name":"Mike Perez","email":"thingee@gmail.com","username":"thingee"},"change_message_id":"88ae10450c917f0b56fc57ebaa44b48c4ef481d1","unresolved":false,"context_lines":[{"line_number":1086,"context_line":"        # We only handle volumes without snapshots for now"},{"line_number":1087,"context_line":"        snaps \u003d self.db.snapshot_get_all_for_volume(context, volume[\u0027id\u0027])"},{"line_number":1088,"context_line":"        if snaps:"},{"line_number":1089,"context_line":"            msg \u003d _(\"Volume %s must not have snapshots.\") % volume[\u0027id\u0027]"},{"line_number":1090,"context_line":"            LOG.error(msg)"},{"line_number":1091,"context_line":"            raise exception.InvalidVolume(reason\u003dmsg)"},{"line_number":1092,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"ba7be1f8_a7af2f29","line":1089,"in_reply_to":"ba7be1f8_2797bf3c","updated":"2015-02-24 21:14:20.000000000","message":"Thank you so much James for the clarification. Can you add Sean McGinnis to the review as well?","commit_id":"d0eee703ef76d547cbec3ef270952ac14325c3a2"},{"author":{"_account_id":6601,"name":"James Carey","email":"jecarey@yerac.com","username":"jecarey"},"change_message_id":"d5a3d4738dfefeee027aad8ff89a5271991f1ed1","unresolved":false,"context_lines":[{"line_number":1086,"context_line":"        # We only handle volumes without snapshots for now"},{"line_number":1087,"context_line":"        snaps \u003d self.db.snapshot_get_all_for_volume(context, volume[\u0027id\u0027])"},{"line_number":1088,"context_line":"        if snaps:"},{"line_number":1089,"context_line":"            msg \u003d _(\"Volume %s must not have snapshots.\") % volume[\u0027id\u0027]"},{"line_number":1090,"context_line":"            LOG.error(msg)"},{"line_number":1091,"context_line":"            raise exception.InvalidVolume(reason\u003dmsg)"},{"line_number":1092,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"ba7be1f8_25341792","line":1089,"in_reply_to":"ba7be1f8_a7af2f29","updated":"2015-02-24 22:40:50.000000000","message":"First draft of update up for review: https://review.openstack.org/#/c/158900/ and both of you are added.  Comments appreciated.\n\nBTW, it is global hacking rule H702 that ensures that a string is passed to _() or _Lx().","commit_id":"d0eee703ef76d547cbec3ef270952ac14325c3a2"},{"author":{"_account_id":6601,"name":"James Carey","email":"jecarey@yerac.com","username":"jecarey"},"change_message_id":"16a0c546a9588fef947d091cd45f97aad8a4d883","unresolved":false,"context_lines":[{"line_number":1086,"context_line":"        # We only handle volumes without snapshots for now"},{"line_number":1087,"context_line":"        snaps \u003d self.db.snapshot_get_all_for_volume(context, volume[\u0027id\u0027])"},{"line_number":1088,"context_line":"        if snaps:"},{"line_number":1089,"context_line":"            msg \u003d _(\"Volume %s must not have snapshots.\") % volume[\u0027id\u0027]"},{"line_number":1090,"context_line":"            LOG.error(msg)"},{"line_number":1091,"context_line":"            raise exception.InvalidVolume(reason\u003dmsg)"},{"line_number":1092,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"ba7be1f8_2797bf3c","line":1089,"in_reply_to":"ba7be1f8_bfc3b955","updated":"2015-02-24 21:04:40.000000000","message":"Hi ... I work on the library and I see why this is confusing.  There is a lot going on under the covers that the doc doesn\u0027t talk about.\n\nThe recommendation in this case is to do it the way this code is doing it.\n\nThe reason that we recommend this is because a couple of things that are going on.   \n\nFirst, there are multiple translation catalogs.  One for _() messages, one for _LE() messages, etc.  So we need to make sure that a message that isn\u0027t only going to a log gets into the _() catalog.  Translation is setup so that if it isn\u0027t in the _LE() catalog it will look in the _() catalog.  \n\nThe second is how the messages are automatically put into the catalog.   There is a program that runs and looks for _(), _LE(), etc and pulls the string out from between the ().   If there isn\u0027t a string there, it doesn\u0027t put anything into the catalog.   There are some projects with hacking checks to ensure that this doesn\u0027t happen.\n\nI\u0027ll put a patch up to the documentation and, if you don\u0027t mind, I\u0027ll add you as a reviewer.","commit_id":"d0eee703ef76d547cbec3ef270952ac14325c3a2"},{"author":{"_account_id":11904,"name":"Sean McGinnis","email":"sean.mcginnis@gmail.com","username":"SeanM"},"change_message_id":"1a2ce48853797f178e07ada866c668a813db4acd","unresolved":false,"context_lines":[{"line_number":1086,"context_line":"        # We only handle volumes without snapshots for now"},{"line_number":1087,"context_line":"        snaps \u003d self.db.snapshot_get_all_for_volume(context, volume[\u0027id\u0027])"},{"line_number":1088,"context_line":"        if snaps:"},{"line_number":1089,"context_line":"            msg \u003d _(\"Volume %s must not have snapshots.\") % volume[\u0027id\u0027]"},{"line_number":1090,"context_line":"            LOG.error(msg)"},{"line_number":1091,"context_line":"            raise exception.InvalidVolume(reason\u003dmsg)"},{"line_number":1092,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"da86d52c_1eb2fd48","line":1089,"in_reply_to":"da86d52c_10c83721","updated":"2015-02-18 13:17:55.000000000","message":"Vipin is correct. Here\u0027s some detail from the guidelines where it explicitly calls this out in the examples:\n\nhttp://docs.openstack.org/developer/oslo.i18n/guidelines.html#examples","commit_id":"d0eee703ef76d547cbec3ef270952ac14325c3a2"},{"author":{"_account_id":170,"name":"Mike Perez","email":"thingee@gmail.com","username":"thingee"},"change_message_id":"b80a8b5ec22e5c1484aa41025b08be1ed1ccf73a","unresolved":false,"context_lines":[{"line_number":1086,"context_line":"        # We only handle volumes without snapshots for now"},{"line_number":1087,"context_line":"        snaps \u003d self.db.snapshot_get_all_for_volume(context, volume[\u0027id\u0027])"},{"line_number":1088,"context_line":"        if snaps:"},{"line_number":1089,"context_line":"            msg \u003d _(\"Volume %s must not have snapshots.\") % volume[\u0027id\u0027]"},{"line_number":1090,"context_line":"            LOG.error(msg)"},{"line_number":1091,"context_line":"            raise exception.InvalidVolume(reason\u003dmsg)"},{"line_number":1092,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"ba7be1f8_bfc3b955","line":1089,"in_reply_to":"da86d52c_1eb2fd48","updated":"2015-02-24 19:50:36.000000000","message":"Sean, please stop repeating to me that it\u0027s explicit this and that. I get that, and you repeating this over IRC is *not* helping when it appears to me that the documentation is contradicting itself. The part I\u0027m stuck on is:\n\nFor example, do not do this:\n\n# WRONG\nLOG.exception(_(\u0027There was an error.\u0027))\n\nraise LocalExceptionClass(_(\u0027An error occured.\u0027))\n\nInstead, use this style:\n\n# RIGHT\nLOG.exception(_LE(\u0027There was an error.\u0027))\n\nraise LocalExceptionClass(_(\u0027An error occured.\u0027))\n\nThis makes me think the following is fine:\n\nmsg \u003d \u0027LOLOLO\u0027\n\nLOG.error(_LE(msg))\n\nexception.Laugh(_(msg))\n\nIt is useless to continue arguing about this with the confusion over the documentation. It would be much more productive to get someone who worked on the library or documentation to clarify.","commit_id":"d0eee703ef76d547cbec3ef270952ac14325c3a2"},{"author":{"_account_id":9171,"name":"Vipin Balachandran","email":"vipin.bl@gmail.com","username":"vbala"},"change_message_id":"d84038ea11cb43788d5f3d746236c1438846f4b3","unresolved":false,"context_lines":[{"line_number":1086,"context_line":"        # We only handle volumes without snapshots for now"},{"line_number":1087,"context_line":"        snaps \u003d self.db.snapshot_get_all_for_volume(context, volume[\u0027id\u0027])"},{"line_number":1088,"context_line":"        if snaps:"},{"line_number":1089,"context_line":"            msg \u003d _(\"Volume %s must not have snapshots.\") % volume[\u0027id\u0027]"},{"line_number":1090,"context_line":"            LOG.error(msg)"},{"line_number":1091,"context_line":"            raise exception.InvalidVolume(reason\u003dmsg)"},{"line_number":1092,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"da86d52c_10c83721","line":1089,"in_reply_to":"da86d52c_fc2b7f7f","updated":"2015-02-18 08:36:49.000000000","message":"I think _LE is not needed. It must be translated since we are using it in an exception.","commit_id":"d0eee703ef76d547cbec3ef270952ac14325c3a2"},{"author":{"_account_id":170,"name":"Mike Perez","email":"thingee@gmail.com","username":"thingee"},"change_message_id":"5a11172946a598039eae8795972fdca0592b47cc","unresolved":false,"context_lines":[{"line_number":1093,"context_line":"        # We only handle non-replicated volumes for now"},{"line_number":1094,"context_line":"        rep_status \u003d volume[\u0027replication_status\u0027]"},{"line_number":1095,"context_line":"        if rep_status is not None and rep_status !\u003d \u0027disabled\u0027:"},{"line_number":1096,"context_line":"            msg \u003d _(\"Volume %s must not be replicated.\") % volume[\u0027id\u0027]"},{"line_number":1097,"context_line":"            LOG.error(msg)"},{"line_number":1098,"context_line":"            raise exception.InvalidVolume(reason\u003dmsg)"},{"line_number":1099,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"da86d52c_1c1db362","line":1096,"updated":"2015-02-18 07:36:49.000000000","message":"_LE","commit_id":"d0eee703ef76d547cbec3ef270952ac14325c3a2"}]}
