)]}'
{"openstackclient/tests/unit/volume/v2/test_consistency_group.py":[{"author":{"_account_id":970,"name":"Dean Troyer","email":"dtroyer@gmail.com","username":"dtroyer"},"change_message_id":"b940919920466f33c7a9c70997d13fe45bec67fd","unresolved":false,"context_lines":[{"line_number":133,"context_line":"            result \u003d self.cmd.take_action(parsed_args)"},{"line_number":134,"context_line":"            mock_error.assert_called_with(\u0027%(result)s of %(total)s \u0027"},{"line_number":135,"context_line":"                                          \u0027volumes failed to add.\u0027,"},{"line_number":136,"context_line":"                                          {\u0027result\u0027: 1, \u0027total\u0027: 2})"},{"line_number":137,"context_line":"            self.assertIsNone(result)"},{"line_number":138,"context_line":"            find_mock.assert_any_call(self.consistencygroups_mock,"},{"line_number":139,"context_line":"                                      self._consistency_group.id)"}],"source_content_type":"text/x-python","patch_set":2,"id":"fa31d9ce_f447a8b9","line":136,"updated":"2017-02-13 22:53:01.000000000","message":"Why are you doing this for hard-coded values?  I do not see an improvement here","commit_id":"68358287eecc4761f56142d3782c4f10984b2fba"},{"author":{"_account_id":18602,"name":"Gábor Antal","email":"antal@inf.u-szeged.hu","username":"antal"},"change_message_id":"46594891552d49e2cab36793a70efef8b6582e90","unresolved":false,"context_lines":[{"line_number":133,"context_line":"            result \u003d self.cmd.take_action(parsed_args)"},{"line_number":134,"context_line":"            mock_error.assert_called_with(\u0027%(result)s of %(total)s \u0027"},{"line_number":135,"context_line":"                                          \u0027volumes failed to add.\u0027,"},{"line_number":136,"context_line":"                                          {\u0027result\u0027: 1, \u0027total\u0027: 2})"},{"line_number":137,"context_line":"            self.assertIsNone(result)"},{"line_number":138,"context_line":"            find_mock.assert_any_call(self.consistencygroups_mock,"},{"line_number":139,"context_line":"                                      self._consistency_group.id)"}],"source_content_type":"text/x-python","patch_set":2,"id":"fa31d9ce_ed669db9","line":136,"in_reply_to":"fa31d9ce_87a6e0ab","updated":"2017-02-15 17:34:13.000000000","message":"Okay, I try explain this through a simple example. This \nchange is needed, because using % interpolates the string \nbefore the logging call, while using comma means that \ninterpolation will happen in the logger\u0027s side. That means\nlogger is not called with a string, it is called with a \n(format) string and a dictionary mostly, which hold the \nvalues for the format string, and the logger will \ninterpolate the values in the format string ONLY IF it is \nneeded.\n\nHere\u0027s a simple example: \n\n    def foo(*args):\n        print(\u0027foo called with:\u0027)\n        for arg in args:\n            print(arg)\n        print(\u0027------\u0027)\n\nThis is a simple function which can be called with almost \neverything. I will call it 2 different ways. The first one\nis the way it was used in the codes:\n\n    foo(\"1. My favorite number is %d, and my name is %s\" % \n(42, \"Earl\"))\n\nBecause I used % to interpolate the string, the values will \nbe replaced before calling the method, and the method will \nresult in the following output:\n\n    foo called with:\n    1. My favorite number is 42, and my name is Earl\n    ------\n\nWhile the currently supported way is leave this \ninterpolation to the logger. And the interpolation will only\nhappen when it needed, not every single time regardless the\nlogging level. So calling it in the new way:\n\n    foo(\"2. My favorite number is %d, and my name is %s\", 42, \u0027Earl\u0027)\n\nThe output will be the following:\n    foo called with:\n    2. My favorite number is %d, and my name is %s\n    42\n    Earl\n    ------\n\nThat change caused that I needed to replace the old-kind call with this. However, you can also try the old test yourself, that will prove that this line needed to be changed.\n\nI hope you understand now why I had to change this test.\n\nGreetings,\nGábor","commit_id":"68358287eecc4761f56142d3782c4f10984b2fba"},{"author":{"_account_id":970,"name":"Dean Troyer","email":"dtroyer@gmail.com","username":"dtroyer"},"change_message_id":"387ac4daa283b7b44d82a5d03cffc79fef69bf0b","unresolved":false,"context_lines":[{"line_number":133,"context_line":"            result \u003d self.cmd.take_action(parsed_args)"},{"line_number":134,"context_line":"            mock_error.assert_called_with(\u0027%(result)s of %(total)s \u0027"},{"line_number":135,"context_line":"                                          \u0027volumes failed to add.\u0027,"},{"line_number":136,"context_line":"                                          {\u0027result\u0027: 1, \u0027total\u0027: 2})"},{"line_number":137,"context_line":"            self.assertIsNone(result)"},{"line_number":138,"context_line":"            find_mock.assert_any_call(self.consistencygroups_mock,"},{"line_number":139,"context_line":"                                      self._consistency_group.id)"}],"source_content_type":"text/x-python","patch_set":2,"id":"fa31d9ce_87a6e0ab","line":136,"in_reply_to":"fa31d9ce_d7b29893","updated":"2017-02-15 16:55:39.000000000","message":"\u003e Before this patch, the string was interpolated before the logging call, the logger was call was (1 parameter which is a string)\n\nI really do not understand this statement.  where does interpolation happen with a single string constant?  I\u0027m not a python guru, but I see no interpolation there.\n\nOur primary purpose here is clear understandable code.  This sort of optimization in tests is secondary.","commit_id":"68358287eecc4761f56142d3782c4f10984b2fba"},{"author":{"_account_id":18602,"name":"Gábor Antal","email":"antal@inf.u-szeged.hu","username":"antal"},"change_message_id":"c8a8cb473e7dc9bbf6c3c5537808d26d3ce752a3","unresolved":false,"context_lines":[{"line_number":133,"context_line":"            result \u003d self.cmd.take_action(parsed_args)"},{"line_number":134,"context_line":"            mock_error.assert_called_with(\u0027%(result)s of %(total)s \u0027"},{"line_number":135,"context_line":"                                          \u0027volumes failed to add.\u0027,"},{"line_number":136,"context_line":"                                          {\u0027result\u0027: 1, \u0027total\u0027: 2})"},{"line_number":137,"context_line":"            self.assertIsNone(result)"},{"line_number":138,"context_line":"            find_mock.assert_any_call(self.consistencygroups_mock,"},{"line_number":139,"context_line":"                                      self._consistency_group.id)"}],"source_content_type":"text/x-python","patch_set":2,"id":"fa31d9ce_d7b29893","line":136,"in_reply_to":"fa31d9ce_f447a8b9","updated":"2017-02-14 08:31:22.000000000","message":"You\u0027re wrong. Before this patch, the string was interpolated before the logging call, the logger was call was (1 parameter which is a string): \n\n    LOG.error(\"1 of 2 volumes failed to add.\")\n\nAnd in this patchset, it is replaced by calling the logger with the format string, and the additional parameters, which is mostly a dictionary. And after all, the logger interpolates the string and replaces the the format parameters with the parameters from dictionary. It is done only when it needed. (For example, if your logging level is set to \"error\", then the \"debug\" messages will not be interpolated, no useless replaces happen.)\n\nThis cause that this assert had to be replaced, as the new logging call looks like (with 2 parameters, a format string, and a dictionary):\n\n    LOG.error(\u0027%(result)s of %(total)s volumes failed to add.\u0027, {\u0027result\u0027: 1, \u0027total\u0027: 2})","commit_id":"68358287eecc4761f56142d3782c4f10984b2fba"}]}
