)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":6537,"name":"gordon chung","email":"gord@live.ca","username":"chungg"},"change_message_id":"47e196ef087570ebf4e12df5a37ae0d5281ca7a2","unresolved":false,"context_lines":[{"line_number":11,"context_line":"related API, he may get error message:"},{"line_number":12,"context_line":"\u0027NoneType\u0027 object has no attribute \u0027get_event_types\u0027,"},{"line_number":13,"context_line":"only when back end is mysql or postgresql, he will get correct message"},{"line_number":14,"context_line":"that database connect be connected."},{"line_number":15,"context_line":""},{"line_number":16,"context_line":"With this patch, user will get precise information indicating that"},{"line_number":17,"context_line":"back end is not available."}],"source_content_type":"text/x-gerrit-commit-message","patch_set":2,"id":"7a2fa921_505c0d25","line":14,"updated":"2015-10-06 12:20:12.000000000","message":"this isn\u0027t really clear. the user will get the correct \"database not connected\" message if it\u0027s sql or they *won\u0027t* get the correct message if sql.","commit_id":"919d8d8ebfb44b3b92d3e2deefabe5ebfa2372aa"},{"author":{"_account_id":6676,"name":"zqfan","email":"aji.zqfan@gmail.com","username":"aji-zqfan"},"change_message_id":"4970c23abc1815da1d6203730a51772f7d016fc7","unresolved":false,"context_lines":[{"line_number":11,"context_line":"related API, he may get error message:"},{"line_number":12,"context_line":"\u0027NoneType\u0027 object has no attribute \u0027get_event_types\u0027,"},{"line_number":13,"context_line":"only when back end is mysql or postgresql, he will get correct message"},{"line_number":14,"context_line":"that database connect be connected."},{"line_number":15,"context_line":""},{"line_number":16,"context_line":"With this patch, user will get precise information indicating that"},{"line_number":17,"context_line":"back end is not available."}],"source_content_type":"text/x-gerrit-commit-message","patch_set":2,"id":"7a2fa921_d8009136","line":14,"in_reply_to":"7a2fa921_505c0d25","updated":"2015-10-09 16:57:43.000000000","message":"it should be \u0027cannot be connected\u0027, thanks","commit_id":"919d8d8ebfb44b3b92d3e2deefabe5ebfa2372aa"}],"ceilometer/api/hooks.py":[{"author":{"_account_id":8290,"name":"liusheng","email":"liusheng2048@gmail.com","username":"LiuSheng"},"change_message_id":"41cb89610579aa8601025d8d8b1599ded10e2a94","unresolved":false,"context_lines":[{"line_number":45,"context_line":"        self.name \u003d db_name"},{"line_number":46,"context_line":""},{"line_number":47,"context_line":"    def __getattr__(self, attr):"},{"line_number":48,"context_line":"        raise Exception(\u0027%s back end is not available\u0027 % self.name)"},{"line_number":49,"context_line":""},{"line_number":50,"context_line":"    def __nonzero__(self):"},{"line_number":51,"context_line":"        return False"}],"source_content_type":"text/x-python","patch_set":2,"id":"7a2fa921_60979eec","line":48,"updated":"2015-10-08 04:12:01.000000000","message":"better to s/back end/storage backend/ :)","commit_id":"919d8d8ebfb44b3b92d3e2deefabe5ebfa2372aa"},{"author":{"_account_id":6676,"name":"zqfan","email":"aji.zqfan@gmail.com","username":"aji-zqfan"},"change_message_id":"4970c23abc1815da1d6203730a51772f7d016fc7","unresolved":false,"context_lines":[{"line_number":45,"context_line":"        self.name \u003d db_name"},{"line_number":46,"context_line":""},{"line_number":47,"context_line":"    def __getattr__(self, attr):"},{"line_number":48,"context_line":"        raise Exception(\u0027%s back end is not available\u0027 % self.name)"},{"line_number":49,"context_line":""},{"line_number":50,"context_line":"    def __nonzero__(self):"},{"line_number":51,"context_line":"        return False"}],"source_content_type":"text/x-python","patch_set":2,"id":"7a2fa921_38f1856b","line":48,"in_reply_to":"7a2fa921_60979eec","updated":"2015-10-09 16:57:43.000000000","message":"Done","commit_id":"919d8d8ebfb44b3b92d3e2deefabe5ebfa2372aa"},{"author":{"_account_id":13560,"name":"Rohit Jaiswal","email":"rohit.jaiswal@gmail.com","username":"rjaiswal"},"change_message_id":"ca3e73e43b0ce0fb56d42fef3b21ca0d89745c49","unresolved":false,"context_lines":[{"line_number":47,"context_line":"    def __getattr__(self, attr):"},{"line_number":48,"context_line":"        raise Exception(\u0027%s storage backend is not available\u0027 % self.name)"},{"line_number":49,"context_line":""},{"line_number":50,"context_line":"    def __nonzero__(self):"},{"line_number":51,"context_line":"        return False"},{"line_number":52,"context_line":""},{"line_number":53,"context_line":""}],"source_content_type":"text/x-python","patch_set":3,"id":"7a2fa921_a9d9b7f4","line":50,"updated":"2015-10-10 04:21:25.000000000","message":"Python 3 not have __nonzero__, but __bool__, so this is not python 3 compatible code I think; also would it better to return True as the Class name is dbnotavailable","commit_id":"f76d9da283732a5878167cd1670d787548df6c1b"},{"author":{"_account_id":6676,"name":"zqfan","email":"aji.zqfan@gmail.com","username":"aji-zqfan"},"change_message_id":"61889fd27bf77666fd04b3fbad465a9cce540d89","unresolved":false,"context_lines":[{"line_number":47,"context_line":"    def __getattr__(self, attr):"},{"line_number":48,"context_line":"        raise Exception(\u0027%s storage backend is not available\u0027 % self.name)"},{"line_number":49,"context_line":""},{"line_number":50,"context_line":"    def __nonzero__(self):"},{"line_number":51,"context_line":"        return False"},{"line_number":52,"context_line":""},{"line_number":53,"context_line":""}],"source_content_type":"text/x-python","patch_set":3,"id":"7a2fa921_4bb9d4eb","line":50,"in_reply_to":"7a2fa921_a9d9b7f4","updated":"2015-10-12 14:29:27.000000000","message":"you\u0027re right, done","commit_id":"f76d9da283732a5878167cd1670d787548df6c1b"},{"author":{"_account_id":6676,"name":"zqfan","email":"aji.zqfan@gmail.com","username":"aji-zqfan"},"change_message_id":"cd34622b1a359de1d9e9bf2aa86df700ccb3f0f5","unresolved":false,"context_lines":[{"line_number":45,"context_line":"        self.name \u003d db_name"},{"line_number":46,"context_line":""},{"line_number":47,"context_line":"    def __getattr__(self, attr):"},{"line_number":48,"context_line":"        raise Exception(\u0027%s storage backend is not available\u0027 % self.name)"},{"line_number":49,"context_line":""},{"line_number":50,"context_line":""},{"line_number":51,"context_line":"class DBHook(hooks.PecanHook):"}],"source_content_type":"text/x-python","patch_set":4,"id":"7a2fa921_af73b4b3","line":48,"updated":"2015-10-13 06:09:17.000000000","message":"the attr \u0027name\u0027 better to be private to avoid unpredictable usage such as:  pecan.reqeust.storage_connection.name","commit_id":"c0fde19cc087f98acd1dd2baa5ed9d67c8849137"},{"author":{"_account_id":2813,"name":"Mehdi Abaakouk","email":"sileht@sileht.net","username":"sileht"},"change_message_id":"87a3259efd7d4127e23a4f9c8ed3bf9bc5b7c630","unresolved":false,"context_lines":[{"line_number":66,"context_line":"    def _is_not_available(conn):"},{"line_number":67,"context_line":"        if not conn:"},{"line_number":68,"context_line":"            return True"},{"line_number":69,"context_line":"        if isinstance(conn, _DBNotAvailable):"},{"line_number":70,"context_line":"            return True"},{"line_number":71,"context_line":"        return False"},{"line_number":72,"context_line":""}],"source_content_type":"text/x-python","patch_set":5,"id":"7a2fa921_92729fac","line":69,"updated":"2015-10-13 06:39:18.000000000","message":"Having a variable that can handle two different object types will lead in futur mistake.","commit_id":"d35896c9a49eaa8331f1790616177e8b431d836a"},{"author":{"_account_id":6676,"name":"zqfan","email":"aji.zqfan@gmail.com","username":"aji-zqfan"},"change_message_id":"c2b35d5bdc2ecf08d8b2ccece3be066f623caf63","unresolved":false,"context_lines":[{"line_number":66,"context_line":"    def _is_not_available(conn):"},{"line_number":67,"context_line":"        if not conn:"},{"line_number":68,"context_line":"            return True"},{"line_number":69,"context_line":"        if isinstance(conn, _DBNotAvailable):"},{"line_number":70,"context_line":"            return True"},{"line_number":71,"context_line":"        return False"},{"line_number":72,"context_line":""}],"source_content_type":"text/x-python","patch_set":5,"id":"7a2fa921_d2f2576f","line":69,"in_reply_to":"7a2fa921_92729fac","updated":"2015-10-13 07:01:47.000000000","message":"to make it to be one object type, _DBNotAvailable can inherit from storage.base.Connection, including alarm, event and metering, but need to implement all those interfaces, this is my first thought but the implemented interface list is long, and there maybe more interfaces or properties in future, so here I just reduce all interfaces (and properties) to a single getattr dark magic method.","commit_id":"d35896c9a49eaa8331f1790616177e8b431d836a"},{"author":{"_account_id":2813,"name":"Mehdi Abaakouk","email":"sileht@sileht.net","username":"sileht"},"change_message_id":"87a3259efd7d4127e23a4f9c8ed3bf9bc5b7c630","unresolved":false,"context_lines":[{"line_number":83,"context_line":"            params \u003d {\"purpose\": purpose, \"err\": err}"},{"line_number":84,"context_line":"            LOG.exception(_LE(\"Failed to connect to db, purpose %(purpose)s \""},{"line_number":85,"context_line":"                              \"retry later: %(err)s\") % params)"},{"line_number":86,"context_line":"            return _DBNotAvailable(purpose)"},{"line_number":87,"context_line":""},{"line_number":88,"context_line":""},{"line_number":89,"context_line":"class NotifierHook(hooks.PecanHook):"}],"source_content_type":"text/x-python","patch_set":5,"id":"7a2fa921_925b7f2e","line":86,"updated":"2015-10-13 06:39:18.000000000","message":"You must not return a exception. This method returns a connection object, so if we can\u0027t we should \u0027raise\u0027 an exception.\n\nYou should perhaps use pecan.abort(500, \"foobar\") helper to do that.","commit_id":"d35896c9a49eaa8331f1790616177e8b431d836a"},{"author":{"_account_id":8290,"name":"liusheng","email":"liusheng2048@gmail.com","username":"LiuSheng"},"change_message_id":"b19ee18593ac71792e10190dbe181863dbf461a5","unresolved":false,"context_lines":[{"line_number":83,"context_line":"            params \u003d {\"purpose\": purpose, \"err\": err}"},{"line_number":84,"context_line":"            LOG.exception(_LE(\"Failed to connect to db, purpose %(purpose)s \""},{"line_number":85,"context_line":"                              \"retry later: %(err)s\") % params)"},{"line_number":86,"context_line":"            return _DBNotAvailable(purpose)"},{"line_number":87,"context_line":""},{"line_number":88,"context_line":""},{"line_number":89,"context_line":"class NotifierHook(hooks.PecanHook):"}],"source_content_type":"text/x-python","patch_set":5,"id":"7a2fa921_52a08790","line":86,"in_reply_to":"7a2fa921_925b7f2e","updated":"2015-10-13 06:52:18.000000000","message":"I think api-server shouldn\u0027t be broken if at least one of these three storage backend has been configured, the storage backend only effect corresponding API, e.g. if we only configured metering_connection, we just cannot use event-list, right? so we cannot raise an exception.","commit_id":"d35896c9a49eaa8331f1790616177e8b431d836a"},{"author":{"_account_id":6676,"name":"zqfan","email":"aji.zqfan@gmail.com","username":"aji-zqfan"},"change_message_id":"c2b35d5bdc2ecf08d8b2ccece3be066f623caf63","unresolved":false,"context_lines":[{"line_number":83,"context_line":"            params \u003d {\"purpose\": purpose, \"err\": err}"},{"line_number":84,"context_line":"            LOG.exception(_LE(\"Failed to connect to db, purpose %(purpose)s \""},{"line_number":85,"context_line":"                              \"retry later: %(err)s\") % params)"},{"line_number":86,"context_line":"            return _DBNotAvailable(purpose)"},{"line_number":87,"context_line":""},{"line_number":88,"context_line":""},{"line_number":89,"context_line":"class NotifierHook(hooks.PecanHook):"}],"source_content_type":"text/x-python","patch_set":5,"id":"7a2fa921_b22a3be6","line":86,"in_reply_to":"7a2fa921_925b7f2e","updated":"2015-10-13 07:01:47.000000000","message":"_DBNotAvailable is not an exception but a fake object which will trigger exception whenever you want to call any interface of storage.base.Connection\n\nThe purpose of not raise exception but return a fake object, is because we want to enable some of the functionality when there is any available storage backend for alarm, event or metering.\n\nIf we raise exception here, then API process won\u0027t be able to start.\n\nAnother choice is inherit xxx.storage.base.Connection to create three classes which raise exception for every operation. the effect is same to the fake object _DBNotAvailable, those inherited classes will have more duplicate code, and may cause some confuse because they are not really a connection type","commit_id":"d35896c9a49eaa8331f1790616177e8b431d836a"}],"ceilometer/tests/functional/test_bin.py":[{"author":{"_account_id":8290,"name":"liusheng","email":"liusheng2048@gmail.com","username":"LiuSheng"},"change_message_id":"6f97f50cb81a235967f32696d9d789ff2f3c2ccf","unresolved":false,"context_lines":[{"line_number":236,"context_line":""},{"line_number":237,"context_line":"        response, content \u003d self.get_response(\u0027v2/meters\u0027)"},{"line_number":238,"context_line":"        self.assertEqual(500, response.status)"},{"line_number":239,"context_line":"        self.assertIn(\u0027metering back end is not available\u0027, content)"},{"line_number":240,"context_line":""},{"line_number":241,"context_line":"    def test_v2_with_all_bad_conns(self):"},{"line_number":242,"context_line":""}],"source_content_type":"text/x-python","patch_set":3,"id":"7a2fa921_83293ae8","line":239,"updated":"2015-10-10 01:34:20.000000000","message":"you forgot to change this to match the error message change :(","commit_id":"f76d9da283732a5878167cd1670d787548df6c1b"},{"author":{"_account_id":6676,"name":"zqfan","email":"aji.zqfan@gmail.com","username":"aji-zqfan"},"change_message_id":"61889fd27bf77666fd04b3fbad465a9cce540d89","unresolved":false,"context_lines":[{"line_number":236,"context_line":""},{"line_number":237,"context_line":"        response, content \u003d self.get_response(\u0027v2/meters\u0027)"},{"line_number":238,"context_line":"        self.assertEqual(500, response.status)"},{"line_number":239,"context_line":"        self.assertIn(\u0027metering back end is not available\u0027, content)"},{"line_number":240,"context_line":""},{"line_number":241,"context_line":"    def test_v2_with_all_bad_conns(self):"},{"line_number":242,"context_line":""}],"source_content_type":"text/x-python","patch_set":3,"id":"7a2fa921_cbcde487","line":239,"in_reply_to":"7a2fa921_83293ae8","updated":"2015-10-12 14:29:27.000000000","message":"Done","commit_id":"f76d9da283732a5878167cd1670d787548df6c1b"}]}
