)]}'
{"ceilometer/api/controllers/v2.py":[{"author":{"_account_id":2284,"name":"Eoghan Glynn","email":"eglynn@redhat.com","username":"eglynn"},"change_message_id":"7386d3317c1759000261fdd165725e569ef4c678","unresolved":false,"context_lines":[{"line_number":1671,"context_line":"            if alarm.combination_rule in (wtypes.Unset, None):"},{"line_number":1672,"context_line":"                error \u003d _(\"combination_rule must be set for combination \""},{"line_number":1673,"context_line":"                          \"type alarm\")"},{"line_number":1674,"context_line":"                raise ClientSideError(error)"},{"line_number":1675,"context_line":"        if alarm.threshold_rule and alarm.combination_rule:"},{"line_number":1676,"context_line":"            error \u003d _(\"threshold_rule and combination_rule \""},{"line_number":1677,"context_line":"                      \"cannot be set at the same time\")"}],"source_content_type":"text/x-python","patch_set":7,"id":"AAAAWH%2F%2FW3U%3D","line":1674,"updated":"2014-03-18 12:04:20.000000000","message":"Could that slightly repetitive code be rationalized something like:\n\n  def validate(alarm):\n      def _check_rule(type):\n          attr \u003d \u0027%s_rule\u0027 % type\n          if getattr(alarm, attr) in (wtypes.Unset, None):\n              error \u003d _(\"%s must be set for %s type\") % (attr, type)\n              raise ClientSideError(error)\n\n      _check_rule(alarm.type)","commit_id":"e5b8b8a48fd4ea766f880b640e0e93b469229833"},{"author":{"_account_id":8290,"name":"liusheng","email":"liusheng2048@gmail.com","username":"LiuSheng"},"change_message_id":"0be3eccf57eca79edb16ad9d341833fa8b5d4419","unresolved":false,"context_lines":[{"line_number":1671,"context_line":"            if alarm.combination_rule in (wtypes.Unset, None):"},{"line_number":1672,"context_line":"                error \u003d _(\"combination_rule must be set for combination \""},{"line_number":1673,"context_line":"                          \"type alarm\")"},{"line_number":1674,"context_line":"                raise ClientSideError(error)"},{"line_number":1675,"context_line":"        if alarm.threshold_rule and alarm.combination_rule:"},{"line_number":1676,"context_line":"            error \u003d _(\"threshold_rule and combination_rule \""},{"line_number":1677,"context_line":"                      \"cannot be set at the same time\")"}],"source_content_type":"text/x-python","patch_set":7,"id":"AAAAWH%2F%2FPn8%3D","line":1674,"in_reply_to":"AAAAWH%2F%2FW3U%3D","updated":"2014-03-19 06:20:06.000000000","message":"thanks for your reviewing, done\ncheers.","commit_id":"e5b8b8a48fd4ea766f880b640e0e93b469229833"},{"author":{"_account_id":2813,"name":"Mehdi Abaakouk","email":"sileht@sileht.net","username":"sileht"},"change_message_id":"862f75d53a7fca6b2eec275fb29a63acb733171c","unresolved":false,"context_lines":[{"line_number":1708,"context_line":""},{"line_number":1709,"context_line":"    @staticmethod"},{"line_number":1710,"context_line":"    def validate(alarm):"},{"line_number":1711,"context_line":"        def _check_rule(type):"},{"line_number":1712,"context_line":"            rule \u003d \u0027%s_rule\u0027 % type"},{"line_number":1713,"context_line":"            if getattr(alarm, rule) in (wtypes.Unset, None):"},{"line_number":1714,"context_line":"                error \u003d _(\"%(rule)s must be set for %(type)s\""}],"source_content_type":"text/x-python","patch_set":9,"id":"AAAAWH%2F%2FPF0%3D","line":1711,"updated":"2014-03-19 08:03:49.000000000","message":"You can put this staticmethod in the class directly. It doesn\u0027t need to be inside the validate method.","commit_id":"f5f94f6950edd19ef181e0a0ecde1db494bc7f7e"}],"ceilometer/tests/api/v2/test_alarm_scenarios.py":[{"author":{"_account_id":9562,"name":"Ildiko Vancsa","email":"ildiko.vancsa@gmail.com","username":"ildikov"},"change_message_id":"d6fc88f29ab6cfd4ad307368ae27914f57c9fd23","unresolved":false,"context_lines":[{"line_number":955,"context_line":"            }"},{"line_number":956,"context_line":"        }"},{"line_number":957,"context_line":"        self.post_json(\u0027/alarms\u0027, params\u003djson,"},{"line_number":958,"context_line":"                       expect_errors\u003dFalse, status\u003d400,"},{"line_number":959,"context_line":"                       headers\u003dself.auth_headers)"},{"line_number":960,"context_line":""},{"line_number":961,"context_line":"    def test_post_threshold_alarm_with_combination_rule(self):"}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAAVn%2F%2FNVI%3D","line":958,"updated":"2014-03-08 09:01:18.000000000","message":"s/False/True/\n\nIt makes the test unreadable and also it only works because the \u0027status\u0027 parameter is set to an error code, if you would move the status code check to a separate assertEqual check, this test would fail. The expect_errors\u003dTrue means that other codes, than 200/3xx are accepted, if it is set to False, then only 200/3xx status code should be accepted, which behavior is obscured by the \u0027status\u0027 parameter in this particular situation.","commit_id":"e8bbd3930343cd79202b94d42984ea0430cef488"},{"author":{"_account_id":9562,"name":"Ildiko Vancsa","email":"ildiko.vancsa@gmail.com","username":"ildikov"},"change_message_id":"d6fc88f29ab6cfd4ad307368ae27914f57c9fd23","unresolved":false,"context_lines":[{"line_number":956,"context_line":"        }"},{"line_number":957,"context_line":"        self.post_json(\u0027/alarms\u0027, params\u003djson,"},{"line_number":958,"context_line":"                       expect_errors\u003dFalse, status\u003d400,"},{"line_number":959,"context_line":"                       headers\u003dself.auth_headers)"},{"line_number":960,"context_line":""},{"line_number":961,"context_line":"    def test_post_threshold_alarm_with_combination_rule(self):"},{"line_number":962,"context_line":"        \"\"\"Test the creation of an threshold alarm with combination rule."}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAAVn%2F%2FI%2F0%3D","line":959,"updated":"2014-03-08 09:01:18.000000000","message":"It would be good to check the error message too, as that validate function, where the additional check take place now, can raise three different ClientSideError, all with the same default status code (400), but different error messages.","commit_id":"e8bbd3930343cd79202b94d42984ea0430cef488"},{"author":{"_account_id":9562,"name":"Ildiko Vancsa","email":"ildiko.vancsa@gmail.com","username":"ildikov"},"change_message_id":"d6fc88f29ab6cfd4ad307368ae27914f57c9fd23","unresolved":false,"context_lines":[{"line_number":977,"context_line":"            }"},{"line_number":978,"context_line":"        }"},{"line_number":979,"context_line":"        self.post_json(\u0027/alarms\u0027, params\u003djson,"},{"line_number":980,"context_line":"                       expect_errors\u003dFalse, status\u003d400,"},{"line_number":981,"context_line":"                       headers\u003dself.auth_headers)"},{"line_number":982,"context_line":""},{"line_number":983,"context_line":"    def _do_post_combination_alarm_as_admin_success(self, owner_is_set):"}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAAVn%2F%2FNVE%3D","line":980,"updated":"2014-03-08 09:01:18.000000000","message":"s/False/True/","commit_id":"e8bbd3930343cd79202b94d42984ea0430cef488"},{"author":{"_account_id":9562,"name":"Ildiko Vancsa","email":"ildiko.vancsa@gmail.com","username":"ildikov"},"change_message_id":"d6fc88f29ab6cfd4ad307368ae27914f57c9fd23","unresolved":false,"context_lines":[{"line_number":978,"context_line":"        }"},{"line_number":979,"context_line":"        self.post_json(\u0027/alarms\u0027, params\u003djson,"},{"line_number":980,"context_line":"                       expect_errors\u003dFalse, status\u003d400,"},{"line_number":981,"context_line":"                       headers\u003dself.auth_headers)"},{"line_number":982,"context_line":""},{"line_number":983,"context_line":"    def _do_post_combination_alarm_as_admin_success(self, owner_is_set):"},{"line_number":984,"context_line":"        \"\"\"Test that post a combination alarm as admin on behalf of nobody"}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAAVn%2F%2FI%2Fw%3D","line":981,"updated":"2014-03-08 09:01:18.000000000","message":"Error message check, as above.","commit_id":"e8bbd3930343cd79202b94d42984ea0430cef488"},{"author":{"_account_id":9562,"name":"Ildiko Vancsa","email":"ildiko.vancsa@gmail.com","username":"ildikov"},"change_message_id":"a6322c4b1169894a1d5299d9c0db68ba610a573f","unresolved":false,"context_lines":[{"line_number":410,"context_line":"                              status\u003d400, headers\u003dself.auth_headers)"},{"line_number":411,"context_line":"        self.assertEqual("},{"line_number":412,"context_line":"            resp.json[\u0027error_message\u0027][\u0027faultstring\u0027],"},{"line_number":413,"context_line":"            \"threshold_rule must be set for threshold type alarm\")"},{"line_number":414,"context_line":""},{"line_number":415,"context_line":"    def test_post_invalid_alarm_statistic(self):"},{"line_number":416,"context_line":"        json \u003d {"}],"source_content_type":"text/x-python","patch_set":6,"id":"AAAAVn%2F%2FETg%3D","line":413,"updated":"2014-03-10 08:37:01.000000000","message":"According to bug 1259292, the order in asertEqual should be: expected, observed.","commit_id":"39b471d127f2f4b9440a3d90f16e6c1b9c115a4d"},{"author":{"_account_id":9562,"name":"Ildiko Vancsa","email":"ildiko.vancsa@gmail.com","username":"ildikov"},"change_message_id":"a6322c4b1169894a1d5299d9c0db68ba610a573f","unresolved":false,"context_lines":[{"line_number":959,"context_line":"                              headers\u003dself.auth_headers)"},{"line_number":960,"context_line":"        self.assertEqual("},{"line_number":961,"context_line":"            resp.json[\u0027error_message\u0027][\u0027faultstring\u0027],"},{"line_number":962,"context_line":"            \"combination_rule must be set for combination type alarm\")"},{"line_number":963,"context_line":""},{"line_number":964,"context_line":"    def test_post_threshold_alarm_with_combination_rule(self):"},{"line_number":965,"context_line":"        \"\"\"Test the creation of an threshold alarm with combination rule."}],"source_content_type":"text/x-python","patch_set":6,"id":"AAAAVn%2F%2FETc%3D","line":962,"updated":"2014-03-10 08:37:01.000000000","message":"Same as above.","commit_id":"39b471d127f2f4b9440a3d90f16e6c1b9c115a4d"},{"author":{"_account_id":9562,"name":"Ildiko Vancsa","email":"ildiko.vancsa@gmail.com","username":"ildikov"},"change_message_id":"a6322c4b1169894a1d5299d9c0db68ba610a573f","unresolved":false,"context_lines":[{"line_number":984,"context_line":"                              headers\u003dself.auth_headers)"},{"line_number":985,"context_line":"        self.assertEqual("},{"line_number":986,"context_line":"            resp.json[\u0027error_message\u0027][\u0027faultstring\u0027],"},{"line_number":987,"context_line":"            \"threshold_rule must be set for threshold type alarm\")"},{"line_number":988,"context_line":""},{"line_number":989,"context_line":"    def _do_post_combination_alarm_as_admin_success(self, owner_is_set):"},{"line_number":990,"context_line":"        \"\"\"Test that post a combination alarm as admin on behalf of nobody"}],"source_content_type":"text/x-python","patch_set":6,"id":"AAAAVn%2F%2FETY%3D","line":987,"updated":"2014-03-10 08:37:01.000000000","message":"Same as above.","commit_id":"39b471d127f2f4b9440a3d90f16e6c1b9c115a4d"}]}
