)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":8846,"name":"Hao Wang","display_name":"Hao Wang","email":"sxmatch1986@gmail.com","username":"sxmatch"},"change_message_id":"a1edf9bc5608a874e0a70249b544a0e57a75f3e9","unresolved":false,"context_lines":[{"line_number":26,"context_line":"applied."},{"line_number":27,"context_line":""},{"line_number":28,"context_line":"All \"print\" function calls are substituted to local logger calls."},{"line_number":29,"context_line":""},{"line_number":30,"context_line":"blueprint: websocket-binary-support"},{"line_number":31,"context_line":"Change-Id: I07a7c46795e3b510ee397a6d2c4665e770c2c4b2"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":16,"id":"dae33548_1bd82053","line":29,"updated":"2016-02-15 09:04:01.000000000","message":"Should add APIImpact and DocImpact since we change the api behavior.","commit_id":"262fbabb34d79fba8b7522cc82b4e597ff19f2a0"},{"author":{"_account_id":18683,"name":"Eva Balycheva","email":"ubershy@gmail.com","username":"eva"},"change_message_id":"5e3c9152c23d6c41036d1d8865302f9aa7843035","unresolved":false,"context_lines":[{"line_number":26,"context_line":"applied."},{"line_number":27,"context_line":""},{"line_number":28,"context_line":"All \"print\" function calls are substituted to local logger calls."},{"line_number":29,"context_line":""},{"line_number":30,"context_line":"blueprint: websocket-binary-support"},{"line_number":31,"context_line":"Change-Id: I07a7c46795e3b510ee397a6d2c4665e770c2c4b2"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":16,"id":"dae33548_408d8c30","line":29,"in_reply_to":"dae33548_1bd82053","updated":"2016-02-15 12:10:11.000000000","message":"Yes, sorry. I\u0027m going to do it.","commit_id":"262fbabb34d79fba8b7522cc82b4e597ff19f2a0"}],"examples/scripts/zaqarws.js":[{"author":{"_account_id":18683,"name":"Eva Balycheva","email":"ubershy@gmail.com","username":"eva"},"change_message_id":"0943e009692b3895ebebf27840cfe6cc512b2eb5","unresolved":false,"context_lines":[{"line_number":118,"context_line":"            if (token \u003d\u003d null){"},{"line_number":119,"context_line":"                log_info(\"Connected to Keystone, but no \u0027X-Subject-Token\u0027 \""},{"line_number":120,"context_line":"                + \"header was provided. Is CORS set correctly in Keystone to \""},{"line_number":121,"context_line":"                + \"expose this header?\");"},{"line_number":122,"context_line":"            } else {"},{"line_number":123,"context_line":"                log_info(\"Got token from Keystone. \" +"},{"line_number":124,"context_line":"                \"Sending authentication request to Zaqar.\");"}],"source_content_type":"text/javascript","patch_set":13,"id":"7a5de9d1_433367ab","line":121,"updated":"2016-02-01 03:08:28.000000000","message":"I decided to provide more info to the user about CORS problems. \n\nOtherwise the user might think that something is wrong with our websocket client example. And it would be hard for him to quickly find the solution for these problems.","commit_id":"ec092753681b8a7b022f93b3f281b2131256a7b7"},{"author":{"_account_id":15054,"name":"wangxiyuan","email":"wangxiyuan1007@gmail.com","username":"wangxiyuan"},"change_message_id":"67cc7613b0bb6a1c3b463c571634f6efca9e1ede","unresolved":false,"context_lines":[{"line_number":117,"context_line":"            var token \u003d response.getResponseHeader(\u0027X-Subject-Token\u0027)"},{"line_number":118,"context_line":"            if (token \u003d\u003d null){"},{"line_number":119,"context_line":"                log_info(\"Connected to Keystone, but no \u0027X-Subject-Token\u0027 \""},{"line_number":120,"context_line":"                + \"header was provided. Is CORS set correctly in Keystone to \""},{"line_number":121,"context_line":"                + \"expose this header?\");"},{"line_number":122,"context_line":"            } else {"},{"line_number":123,"context_line":"                log_info(\"Got token from Keystone. \" +"},{"line_number":124,"context_line":"                \"Sending authentication request to Zaqar.\");"}],"source_content_type":"text/javascript","patch_set":14,"id":"7a5de9d1_47760cd8","line":121,"range":{"start_line":120,"start_character":40,"end_line":121,"end_character":38},"updated":"2016-02-01 09:15:27.000000000","message":"is the interrogative sentence suitable in log_info?","commit_id":"8f179a92e9dd1dc557cd688f7f25be974e1fb28a"},{"author":{"_account_id":18683,"name":"Eva Balycheva","email":"ubershy@gmail.com","username":"eva"},"change_message_id":"12af53ab46b9d770a260895e4c0e4fb6631ed401","unresolved":false,"context_lines":[{"line_number":117,"context_line":"            var token \u003d response.getResponseHeader(\u0027X-Subject-Token\u0027)"},{"line_number":118,"context_line":"            if (token \u003d\u003d null){"},{"line_number":119,"context_line":"                log_info(\"Connected to Keystone, but no \u0027X-Subject-Token\u0027 \""},{"line_number":120,"context_line":"                + \"header was provided. Is CORS set correctly in Keystone to \""},{"line_number":121,"context_line":"                + \"expose this header?\");"},{"line_number":122,"context_line":"            } else {"},{"line_number":123,"context_line":"                log_info(\"Got token from Keystone. \" +"},{"line_number":124,"context_line":"                \"Sending authentication request to Zaqar.\");"}],"source_content_type":"text/javascript","patch_set":14,"id":"7a5de9d1_bc8d75d4","line":121,"range":{"start_line":120,"start_character":40,"end_line":121,"end_character":38},"in_reply_to":"7a5de9d1_47760cd8","updated":"2016-02-01 20:50:14.000000000","message":"You\u0027re right, I will get rid of it.","commit_id":"8f179a92e9dd1dc557cd688f7f25be974e1fb28a"},{"author":{"_account_id":6484,"name":"Feilong Wang","email":"hustemb@gmail.com","username":"flwang"},"change_message_id":"3701a53eb2f42e91d22f5baf4ec35f54c5766ccb","unresolved":false,"context_lines":[{"line_number":1,"context_line":"var server_url \u003d wsconf.server_url"},{"line_number":2,"context_line":"var project_id \u003d wsconf.project_id;"},{"line_number":3,"context_line":"var client_id \u003d wsconf.client_id;"},{"line_number":4,"context_line":"var send_binary \u003d wsconf.send_binary_messages;"}],"source_content_type":"text/javascript","patch_set":16,"id":"dae33548_b4add18a","line":1,"updated":"2016-02-14 22:33:42.000000000","message":"TBH, I don\u0027t really like to organize the websocket example like this. Because the example is not only for websocket and the new file structure will make some troubles in the future if we would like to add more examples. IMHO, for example, we don\u0027t have to get a perfect structure, we need to keep it as simple and handy.","commit_id":"262fbabb34d79fba8b7522cc82b4e597ff19f2a0"},{"author":{"_account_id":18683,"name":"Eva Balycheva","email":"ubershy@gmail.com","username":"eva"},"change_message_id":"5e3c9152c23d6c41036d1d8865302f9aa7843035","unresolved":false,"context_lines":[{"line_number":1,"context_line":"var server_url \u003d wsconf.server_url"},{"line_number":2,"context_line":"var project_id \u003d wsconf.project_id;"},{"line_number":3,"context_line":"var client_id \u003d wsconf.client_id;"},{"line_number":4,"context_line":"var send_binary \u003d wsconf.send_binary_messages;"}],"source_content_type":"text/javascript","patch_set":16,"id":"dae33548_430ab6d3","line":1,"in_reply_to":"dae33548_b4add18a","updated":"2016-02-15 12:10:11.000000000","message":"Thanks, Fei Long. You\u0027re finally reviewing my websocket patch. \u003d)\n\nYou\u0027re right, it might make some troubles in the future if we will add more examples. But the solution is simple: put websocket client examples files into sub-directory.\n\nAnd you\u0027re also right, splitting websocket.hmtl is not ideal solution.\nAdvantages: syntax highlighting can be applied which makes it easier to read the code.\nDisadvantages: need to open few files to read the whole code.\n\nOkay, I\u0027ll do as you wish.","commit_id":"262fbabb34d79fba8b7522cc82b4e597ff19f2a0"}],"zaqar/transport/websocket/protocol.py":[{"author":{"_account_id":18683,"name":"Eva Balycheva","email":"ubershy@gmail.com","username":"eva"},"change_message_id":"e5c7a12290d4e8a98aaeea7fd30a88e0a6ea2f84","unresolved":false,"context_lines":[{"line_number":74,"context_line":"        # Deserialize the message"},{"line_number":75,"context_line":"        try:"},{"line_number":76,"context_line":"            if isBinary:"},{"line_number":77,"context_line":"                print(\"Incoming binary message\")"},{"line_number":78,"context_line":"                payload \u003d msgpack.unpackb(payload)"},{"line_number":79,"context_line":"                print(\"Message contents: {0}\".format(payload))"},{"line_number":80,"context_line":"            else:"}],"source_content_type":"text/x-python","patch_set":7,"id":"da6ed579_a95c3dee","line":77,"updated":"2016-01-11 22:14:29.000000000","message":"If you want, I can replace every \"print\" to logger, maybe in next patch.","commit_id":"aae0b20ca2724484db1a66a3284a552d1dd8059d"},{"author":{"_account_id":18683,"name":"Eva Balycheva","email":"ubershy@gmail.com","username":"eva"},"change_message_id":"e5c7a12290d4e8a98aaeea7fd30a88e0a6ea2f84","unresolved":false,"context_lines":[{"line_number":170,"context_line":"        return \u0027HTTP_%s\u0027 % key.replace(\u0027-\u0027, \u0027_\u0027).upper()"},{"line_number":171,"context_line":""},{"line_number":172,"context_line":"    def _send_response(self, resp, in_binary):"},{"line_number":173,"context_line":"        if in_binary:"},{"line_number":174,"context_line":"            self.sendMessage(msgpack.packb(resp.get_response()), True)"},{"line_number":175,"context_line":"        else:"},{"line_number":176,"context_line":"            self.sendMessage(json.dumps(resp.get_response()), False)"}],"source_content_type":"text/x-python","patch_set":7,"id":"da6ed579_299ccd68","line":173,"range":{"start_line":173,"start_character":11,"end_line":173,"end_character":20},"updated":"2016-01-11 22:14:29.000000000","message":"In the early versions of this patch there was \"self.response_in_binary\" instance variable instead of \"in_binary\" local variable. That was much easier, but not safe because of possible race condition.","commit_id":"aae0b20ca2724484db1a66a3284a552d1dd8059d"},{"author":{"_account_id":15054,"name":"wangxiyuan","email":"wangxiyuan1007@gmail.com","username":"wangxiyuan"},"change_message_id":"a11cf37daeccba3ea3014faab8ce5ae1ac1cf29c","unresolved":false,"context_lines":[{"line_number":84,"context_line":"        except ValueError as ex:"},{"line_number":85,"context_line":"            msg \u003d str(ex)"},{"line_number":86,"context_line":"            LOG.exception(\"The message is corrupted. error: {0}\".format(msg))"},{"line_number":87,"context_line":"            body \u003d {\u0027error\u0027: str(ex)}"},{"line_number":88,"context_line":"            resp \u003d self._handler.create_response(400, body)"},{"line_number":89,"context_line":"            return self._send_response(resp, isBinary)"},{"line_number":90,"context_line":"        if not isinstance(payload, dict):"}],"source_content_type":"text/x-python","patch_set":11,"id":"9a68dd71_4a48dd2d","line":87,"range":{"start_line":87,"start_character":29,"end_line":87,"end_character":36},"updated":"2016-01-27 02:10:21.000000000","message":"msg seems better","commit_id":"e3aa5191de9636cbe984503d23a57e7285743854"},{"author":{"_account_id":18683,"name":"Eva Balycheva","email":"ubershy@gmail.com","username":"eva"},"change_message_id":"358e956979f53ae37eecc3cf6e76fb1380beb5b0","unresolved":false,"context_lines":[{"line_number":84,"context_line":"        except ValueError as ex:"},{"line_number":85,"context_line":"            msg \u003d str(ex)"},{"line_number":86,"context_line":"            LOG.exception(\"The message is corrupted. error: {0}\".format(msg))"},{"line_number":87,"context_line":"            body \u003d {\u0027error\u0027: str(ex)}"},{"line_number":88,"context_line":"            resp \u003d self._handler.create_response(400, body)"},{"line_number":89,"context_line":"            return self._send_response(resp, isBinary)"},{"line_number":90,"context_line":"        if not isinstance(payload, dict):"}],"source_content_type":"text/x-python","patch_set":11,"id":"9a68dd71_143a07ce","line":87,"range":{"start_line":87,"start_character":29,"end_line":87,"end_character":36},"in_reply_to":"9a68dd71_4a48dd2d","updated":"2016-01-27 03:37:00.000000000","message":"Yes, indeed.","commit_id":"e3aa5191de9636cbe984503d23a57e7285743854"},{"author":{"_account_id":18683,"name":"Eva Balycheva","email":"ubershy@gmail.com","username":"eva"},"change_message_id":"0943e009692b3895ebebf27840cfe6cc512b2eb5","unresolved":false,"context_lines":[{"line_number":88,"context_line":"            ex_name \u003d ex_type.__name__"},{"line_number":89,"context_line":"            msg \u003d \u0027Can\\\u0027t decode {0} request. {1}: {2}\u0027.format("},{"line_number":90,"context_line":"                pack_name, ex_name, ex_value)"},{"line_number":91,"context_line":"            LOG.debug(msg)"},{"line_number":92,"context_line":"            body \u003d {\u0027error\u0027: msg}"},{"line_number":93,"context_line":"            resp \u003d self._handler.create_response(400, body)"},{"line_number":94,"context_line":"            return self._send_response(resp, isBinary)"}],"source_content_type":"text/x-python","patch_set":13,"id":"7a5de9d1_4354c7fd","line":91,"updated":"2016-02-01 03:08:28.000000000","message":"Instead of logging at exception(error) level, like before this patch, logging at debug level.\n\nError level logging messages are for scaring Zaqar operators, to tell operators that something is very wrong with the system. See https://specs.openstack.org/openstack/openstack-specs/specs/log-guidelines.html#definition-of-log-levels","commit_id":"ec092753681b8a7b022f93b3f281b2131256a7b7"},{"author":{"_account_id":18683,"name":"Eva Balycheva","email":"ubershy@gmail.com","username":"eva"},"change_message_id":"0943e009692b3895ebebf27840cfe6cc512b2eb5","unresolved":false,"context_lines":[{"line_number":89,"context_line":"            msg \u003d \u0027Can\\\u0027t decode {0} request. {1}: {2}\u0027.format("},{"line_number":90,"context_line":"                pack_name, ex_name, ex_value)"},{"line_number":91,"context_line":"            LOG.debug(msg)"},{"line_number":92,"context_line":"            body \u003d {\u0027error\u0027: msg}"},{"line_number":93,"context_line":"            resp \u003d self._handler.create_response(400, body)"},{"line_number":94,"context_line":"            return self._send_response(resp, isBinary)"},{"line_number":95,"context_line":"        # Check if the request is dict"}],"source_content_type":"text/x-python","patch_set":13,"id":"7a5de9d1_68d9a221","line":92,"updated":"2016-02-01 03:08:28.000000000","message":"I decided to expose serialization error message to the user without stacktrace. Is it a good idea? Maybe just a message like \"Unable to deserialize Binary (MessagePack) request.\" would be enough?","commit_id":"ec092753681b8a7b022f93b3f281b2131256a7b7"},{"author":{"_account_id":18683,"name":"Eva Balycheva","email":"ubershy@gmail.com","username":"eva"},"change_message_id":"0943e009692b3895ebebf27840cfe6cc512b2eb5","unresolved":false,"context_lines":[{"line_number":185,"context_line":"            action \u003d resp._request._action"},{"line_number":186,"context_line":"            # Dump to JSON to print body without unicode prefixes on Python 2"},{"line_number":187,"context_line":"            body \u003d json.dumps(resp._request._body)"},{"line_number":188,"context_line":"            LOG.info(\u0027Response: API {0} {1}, {2}. Request: action \"{3}\", \u0027"},{"line_number":189,"context_line":"                     \u0027body {4}.\u0027.format(api, pack_name, status, action, body))"},{"line_number":190,"context_line":""},{"line_number":191,"context_line":""}],"source_content_type":"text/x-python","patch_set":13,"id":"7a5de9d1_23018b05","line":188,"updated":"2016-02-01 03:08:28.000000000","message":"I replaced all print function calls to logger calls and made the logging of websocket requests similar to how we log wsgi requests, but made it to provide more info. For example, here\u0027s how wsgi request logging currently looks in Zaqar:\n\n127.0.0.1 - - [01/Feb/2016 05:36:01] \"GET /v2/queues HTTP/1.1\" 200 27\n\nAccording to https://wiki.openstack.org/wiki/LoggingStandards : \"Every inbound WSGI should get logged exactly once. It should be logged with enough information that the operation the user was attempting can be reconstructed.\"\n\nSince we allow the user to do the same things through websocket protocol, I think we should follow this instruction for wsgi.\n\nSee also https://specs.openstack.org/openstack/openstack-specs/specs/log-guidelines.html#wsgi-requests\n\nIs it good that I decided to provide more info? Should I also inlude headers in the log message?","commit_id":"ec092753681b8a7b022f93b3f281b2131256a7b7"},{"author":{"_account_id":15054,"name":"wangxiyuan","email":"wangxiyuan1007@gmail.com","username":"wangxiyuan"},"change_message_id":"67cc7613b0bb6a1c3b463c571634f6efca9e1ede","unresolved":false,"context_lines":[{"line_number":177,"context_line":"            pack_name \u003d \u0027bin\u0027"},{"line_number":178,"context_line":"            self.sendMessage(msgpack.packb(resp.get_response()), True)"},{"line_number":179,"context_line":"        else:"},{"line_number":180,"context_line":"            pack_name \u003d \u0027txt\u0027"},{"line_number":181,"context_line":"            self.sendMessage(json.dumps(resp.get_response()), False)"},{"line_number":182,"context_line":"        if LOG.isEnabledFor(logging.INFO):"},{"line_number":183,"context_line":"            api \u003d resp._request._api"}],"source_content_type":"text/x-python","patch_set":14,"id":"7a5de9d1_326c70cd","line":180,"range":{"start_line":180,"start_character":25,"end_line":180,"end_character":28},"updated":"2016-02-01 09:15:27.000000000","message":"is bin/txt too simple? not sure.","commit_id":"8f179a92e9dd1dc557cd688f7f25be974e1fb28a"},{"author":{"_account_id":18683,"name":"Eva Balycheva","email":"ubershy@gmail.com","username":"eva"},"change_message_id":"12af53ab46b9d770a260895e4c0e4fb6631ed401","unresolved":false,"context_lines":[{"line_number":177,"context_line":"            pack_name \u003d \u0027bin\u0027"},{"line_number":178,"context_line":"            self.sendMessage(msgpack.packb(resp.get_response()), True)"},{"line_number":179,"context_line":"        else:"},{"line_number":180,"context_line":"            pack_name \u003d \u0027txt\u0027"},{"line_number":181,"context_line":"            self.sendMessage(json.dumps(resp.get_response()), False)"},{"line_number":182,"context_line":"        if LOG.isEnabledFor(logging.INFO):"},{"line_number":183,"context_line":"            api \u003d resp._request._api"}],"source_content_type":"text/x-python","patch_set":14,"id":"7a5de9d1_d705aa45","line":180,"range":{"start_line":180,"start_character":25,"end_line":180,"end_character":28},"in_reply_to":"7a5de9d1_326c70cd","updated":"2016-02-01 20:50:14.000000000","message":"Do you think it should be shrinked to \"b\" and \"t\"? Or vice versa, to \"binary\" and \"text\"?\n\nI shrinked \"binary\" and \"text\" words to \"txt\" and \"bin\" to make log messages a bit more readable in groups.\n\nThis way, all logging data before action name in each logging event has always the same lenght and alignment. For example, response code always starts at column 22.\n\nExample:\n\nResponse: API v2 bin, 200. Request: action \"queue_list\", body {}.\nResponse: API v2 txt, 201. Request: action \"queue_create\", body {\"queue_name\": \"nice\"}.\nResponse: API v2 bin, 200. Request: action \"queue_list\", body {}.\n\nMaybe it is not a very good idea, because it will be ruined, if we will release Zaqar Websocket API v2.1, for example.","commit_id":"8f179a92e9dd1dc557cd688f7f25be974e1fb28a"},{"author":{"_account_id":15054,"name":"wangxiyuan","email":"wangxiyuan1007@gmail.com","username":"wangxiyuan"},"change_message_id":"67cc7613b0bb6a1c3b463c571634f6efca9e1ede","unresolved":false,"context_lines":[{"line_number":179,"context_line":"        else:"},{"line_number":180,"context_line":"            pack_name \u003d \u0027txt\u0027"},{"line_number":181,"context_line":"            self.sendMessage(json.dumps(resp.get_response()), False)"},{"line_number":182,"context_line":"        if LOG.isEnabledFor(logging.INFO):"},{"line_number":183,"context_line":"            api \u003d resp._request._api"},{"line_number":184,"context_line":"            status \u003d resp._headers[\u0027status\u0027]"},{"line_number":185,"context_line":"            action \u003d resp._request._action"},{"line_number":186,"context_line":"            # Dump to JSON to print body without unicode prefixes on Python 2"},{"line_number":187,"context_line":"            body \u003d json.dumps(resp._request._body)"},{"line_number":188,"context_line":"            LOG.info(\u0027Response: API {0} {1}, {2}. Request: action \"{3}\", \u0027"},{"line_number":189,"context_line":"                     \u0027body {4}.\u0027.format(api, pack_name, status, action, body))"},{"line_number":190,"context_line":""},{"line_number":191,"context_line":""},{"line_number":192,"context_line":"class NotificationProtocol(asyncio.Protocol):"}],"source_content_type":"text/x-python","patch_set":14,"id":"7a5de9d1_2710b056","line":189,"range":{"start_line":182,"start_character":8,"end_line":189,"end_character":78},"updated":"2016-02-01 09:15:27.000000000","message":"I agree with this change personally. BTY, this change could be mentioned in commit message.","commit_id":"8f179a92e9dd1dc557cd688f7f25be974e1fb28a"},{"author":{"_account_id":18683,"name":"Eva Balycheva","email":"ubershy@gmail.com","username":"eva"},"change_message_id":"12af53ab46b9d770a260895e4c0e4fb6631ed401","unresolved":false,"context_lines":[{"line_number":179,"context_line":"        else:"},{"line_number":180,"context_line":"            pack_name \u003d \u0027txt\u0027"},{"line_number":181,"context_line":"            self.sendMessage(json.dumps(resp.get_response()), False)"},{"line_number":182,"context_line":"        if LOG.isEnabledFor(logging.INFO):"},{"line_number":183,"context_line":"            api \u003d resp._request._api"},{"line_number":184,"context_line":"            status \u003d resp._headers[\u0027status\u0027]"},{"line_number":185,"context_line":"            action \u003d resp._request._action"},{"line_number":186,"context_line":"            # Dump to JSON to print body without unicode prefixes on Python 2"},{"line_number":187,"context_line":"            body \u003d json.dumps(resp._request._body)"},{"line_number":188,"context_line":"            LOG.info(\u0027Response: API {0} {1}, {2}. Request: action \"{3}\", \u0027"},{"line_number":189,"context_line":"                     \u0027body {4}.\u0027.format(api, pack_name, status, action, body))"},{"line_number":190,"context_line":""},{"line_number":191,"context_line":""},{"line_number":192,"context_line":"class NotificationProtocol(asyncio.Protocol):"}],"source_content_type":"text/x-python","patch_set":14,"id":"7a5de9d1_69dada18","line":189,"range":{"start_line":182,"start_character":8,"end_line":189,"end_character":78},"in_reply_to":"7a5de9d1_2710b056","updated":"2016-02-01 20:50:14.000000000","message":"Good idea, thanks.","commit_id":"8f179a92e9dd1dc557cd688f7f25be974e1fb28a"},{"author":{"_account_id":6484,"name":"Feilong Wang","email":"hustemb@gmail.com","username":"flwang"},"change_message_id":"3701a53eb2f42e91d22f5baf4ec35f54c5766ccb","unresolved":false,"context_lines":[{"line_number":123,"context_line":"                return self._authenticate(payload, isBinary)"},{"line_number":124,"context_line":"            else:"},{"line_number":125,"context_line":"                resp \u003d self._handler.process_request(req, self)"},{"line_number":126,"context_line":"            if payload.get(\u0027action\u0027) \u003d\u003d \u0027subscription_create\u0027:"},{"line_number":127,"context_line":"                self.notify_in_binary \u003d isBinary"},{"line_number":128,"context_line":"        return self._send_response(resp, isBinary)"},{"line_number":129,"context_line":""}],"source_content_type":"text/x-python","patch_set":16,"id":"dae33548_94c1ad31","line":126,"updated":"2016-02-14 22:33:42.000000000","message":"(nit): I would like to see a NOTE to explain the design. Thanks.","commit_id":"262fbabb34d79fba8b7522cc82b4e597ff19f2a0"},{"author":{"_account_id":18683,"name":"Eva Balycheva","email":"ubershy@gmail.com","username":"eva"},"change_message_id":"5e3c9152c23d6c41036d1d8865302f9aa7843035","unresolved":false,"context_lines":[{"line_number":123,"context_line":"                return self._authenticate(payload, isBinary)"},{"line_number":124,"context_line":"            else:"},{"line_number":125,"context_line":"                resp \u003d self._handler.process_request(req, self)"},{"line_number":126,"context_line":"            if payload.get(\u0027action\u0027) \u003d\u003d \u0027subscription_create\u0027:"},{"line_number":127,"context_line":"                self.notify_in_binary \u003d isBinary"},{"line_number":128,"context_line":"        return self._send_response(resp, isBinary)"},{"line_number":129,"context_line":""}],"source_content_type":"text/x-python","patch_set":16,"id":"dae33548_8014b4f5","line":126,"in_reply_to":"dae33548_94c1ad31","updated":"2016-02-15 12:10:11.000000000","message":"Sure","commit_id":"262fbabb34d79fba8b7522cc82b4e597ff19f2a0"},{"author":{"_account_id":8846,"name":"Hao Wang","display_name":"Hao Wang","email":"sxmatch1986@gmail.com","username":"sxmatch"},"change_message_id":"f0a11dfb8dbe7148822401a6515f56ebe0f4db31","unresolved":false,"context_lines":[{"line_number":128,"context_line":"        return self._send_response(resp, isBinary)"},{"line_number":129,"context_line":""},{"line_number":130,"context_line":"    def onClose(self, wasClean, code, reason):"},{"line_number":131,"context_line":"        LOG.info(\"WebSocket connection closed: {0}\".format(reason))"},{"line_number":132,"context_line":""},{"line_number":133,"context_line":"    def _authenticate(self, payload, in_binary):"},{"line_number":134,"context_line":"        self._auth_in_binary \u003d in_binary"}],"source_content_type":"text/x-python","patch_set":16,"id":"dae33548_18f30675","line":131,"range":{"start_line":131,"start_character":7,"end_line":131,"end_character":67},"updated":"2016-02-15 08:55:02.000000000","message":"Please use _LI in LOG.info.","commit_id":"262fbabb34d79fba8b7522cc82b4e597ff19f2a0"},{"author":{"_account_id":18683,"name":"Eva Balycheva","email":"ubershy@gmail.com","username":"eva"},"change_message_id":"5e3c9152c23d6c41036d1d8865302f9aa7843035","unresolved":false,"context_lines":[{"line_number":128,"context_line":"        return self._send_response(resp, isBinary)"},{"line_number":129,"context_line":""},{"line_number":130,"context_line":"    def onClose(self, wasClean, code, reason):"},{"line_number":131,"context_line":"        LOG.info(\"WebSocket connection closed: {0}\".format(reason))"},{"line_number":132,"context_line":""},{"line_number":133,"context_line":"    def _authenticate(self, payload, in_binary):"},{"line_number":134,"context_line":"        self._auth_in_binary \u003d in_binary"}],"source_content_type":"text/x-python","patch_set":16,"id":"dae33548_c0f6bcd6","line":131,"range":{"start_line":131,"start_character":7,"end_line":131,"end_character":67},"in_reply_to":"dae33548_18f30675","updated":"2016-02-15 12:10:11.000000000","message":"Okay, I\u0027ll use it in every log message.","commit_id":"262fbabb34d79fba8b7522cc82b4e597ff19f2a0"},{"author":{"_account_id":6484,"name":"Feilong Wang","email":"hustemb@gmail.com","username":"flwang"},"change_message_id":"3701a53eb2f42e91d22f5baf4ec35f54c5766ccb","unresolved":false,"context_lines":[{"line_number":174,"context_line":""},{"line_number":175,"context_line":"    def _send_response(self, resp, in_binary):"},{"line_number":176,"context_line":"        if in_binary:"},{"line_number":177,"context_line":"            pack_name \u003d \u0027bin\u0027"},{"line_number":178,"context_line":"            self.sendMessage(msgpack.packb(resp.get_response()), True)"},{"line_number":179,"context_line":"        else:"},{"line_number":180,"context_line":"            pack_name \u003d \u0027txt\u0027"}],"source_content_type":"text/x-python","patch_set":16,"id":"dae33548_f4dc791a","line":177,"updated":"2016-02-14 22:33:42.000000000","message":"Why are we using different \u0027pack_name\u0027? See line 84 and 86. Thanks.","commit_id":"262fbabb34d79fba8b7522cc82b4e597ff19f2a0"},{"author":{"_account_id":18683,"name":"Eva Balycheva","email":"ubershy@gmail.com","username":"eva"},"change_message_id":"5e3c9152c23d6c41036d1d8865302f9aa7843035","unresolved":false,"context_lines":[{"line_number":174,"context_line":""},{"line_number":175,"context_line":"    def _send_response(self, resp, in_binary):"},{"line_number":176,"context_line":"        if in_binary:"},{"line_number":177,"context_line":"            pack_name \u003d \u0027bin\u0027"},{"line_number":178,"context_line":"            self.sendMessage(msgpack.packb(resp.get_response()), True)"},{"line_number":179,"context_line":"        else:"},{"line_number":180,"context_line":"            pack_name \u003d \u0027txt\u0027"}],"source_content_type":"text/x-python","patch_set":16,"id":"dae33548_80b954ec","line":177,"in_reply_to":"dae33548_f4dc791a","updated":"2016-02-15 12:10:11.000000000","message":"Let me repeat my comment from the past:\n\nI shrinked \"binary (MessagePack)\" and \"text (JSON)\" words to \"txt\" and \"bin\" to make log messages a bit more readable in groups.\n\nThis way, all logging data before action name in each logging event has always the same lenght and alignment. For example, response code always starts at column 22.\n\nExample:\n\nResponse: API v2 bin, 200. Request: action \"queue_list\", body {}.\nResponse: API v2 txt, 201. Request: action \"queue_create\", body {\"queue_name\": \"nice\"}.\nResponse: API v2 bin, 200. Request: action \"queue_list\", body {}.\n\nMaybe it is not a very good idea, because it will be ruined, if we will release Zaqar Websocket API v2.1, for example.\n\nPlease me know what you think.","commit_id":"262fbabb34d79fba8b7522cc82b4e597ff19f2a0"},{"author":{"_account_id":8846,"name":"Hao Wang","display_name":"Hao Wang","email":"sxmatch1986@gmail.com","username":"sxmatch"},"change_message_id":"f0a11dfb8dbe7148822401a6515f56ebe0f4db31","unresolved":false,"context_lines":[{"line_number":185,"context_line":"            action \u003d resp._request._action"},{"line_number":186,"context_line":"            # Dump to JSON to print body without unicode prefixes on Python 2"},{"line_number":187,"context_line":"            body \u003d json.dumps(resp._request._body)"},{"line_number":188,"context_line":"            LOG.info(\u0027Response: API {0} {1}, {2}. Request: action \"{3}\", \u0027"},{"line_number":189,"context_line":"                     \u0027body {4}.\u0027.format(api, pack_name, status, action, body))"},{"line_number":190,"context_line":""},{"line_number":191,"context_line":""},{"line_number":192,"context_line":"class NotificationProtocol(asyncio.Protocol):"}],"source_content_type":"text/x-python","patch_set":16,"id":"dae33548_18366603","line":189,"range":{"start_line":188,"start_character":11,"end_line":189,"end_character":78},"updated":"2016-02-15 08:55:02.000000000","message":"here too.","commit_id":"262fbabb34d79fba8b7522cc82b4e597ff19f2a0"},{"author":{"_account_id":15054,"name":"wangxiyuan","email":"wangxiyuan1007@gmail.com","username":"wangxiyuan"},"change_message_id":"439717ecbd723fce6ecf3b3133be8e6b04ed2200","unresolved":false,"context_lines":[{"line_number":90,"context_line":"            ex_name \u003d ex_type.__name__"},{"line_number":91,"context_line":"            msg \u003d \u0027Can\\\u0027t decode {0} request. {1}: {2}\u0027.format("},{"line_number":92,"context_line":"                pack_name, ex_name, ex_value)"},{"line_number":93,"context_line":"            LOG.debug(msg)"},{"line_number":94,"context_line":"            body \u003d {\u0027error\u0027: msg}"},{"line_number":95,"context_line":"            resp \u003d self._handler.create_response(400, body)"},{"line_number":96,"context_line":"            return self._send_response(resp, isBinary)"}],"source_content_type":"text/x-python","patch_set":19,"id":"dae33548_bdb33f09","line":93,"range":{"start_line":93,"start_character":16,"end_line":93,"end_character":21},"updated":"2016-02-18 02:47:35.000000000","message":"LOG.exception(msg) maybe better.","commit_id":"99e4367e945cae91eda88a6f64782f8c8992a7ba"},{"author":{"_account_id":15054,"name":"wangxiyuan","email":"wangxiyuan1007@gmail.com","username":"wangxiyuan"},"change_message_id":"88e3e776ddf41ae6c951aecf48ed6f5f5cebdf35","unresolved":false,"context_lines":[{"line_number":90,"context_line":"            ex_name \u003d ex_type.__name__"},{"line_number":91,"context_line":"            msg \u003d \u0027Can\\\u0027t decode {0} request. {1}: {2}\u0027.format("},{"line_number":92,"context_line":"                pack_name, ex_name, ex_value)"},{"line_number":93,"context_line":"            LOG.debug(msg)"},{"line_number":94,"context_line":"            body \u003d {\u0027error\u0027: msg}"},{"line_number":95,"context_line":"            resp \u003d self._handler.create_response(400, body)"},{"line_number":96,"context_line":"            return self._send_response(resp, isBinary)"}],"source_content_type":"text/x-python","patch_set":19,"id":"dae33548_d7ec16bd","line":93,"range":{"start_line":93,"start_character":16,"end_line":93,"end_character":21},"in_reply_to":"dae33548_b7ea32d9","updated":"2016-02-18 09:00:29.000000000","message":"OK, sounds reasonable. Thanks, Eva.","commit_id":"99e4367e945cae91eda88a6f64782f8c8992a7ba"},{"author":{"_account_id":18683,"name":"Eva Balycheva","email":"ubershy@gmail.com","username":"eva"},"change_message_id":"cc22c3966e78311bc0a2df782bd9fa5203905a77","unresolved":false,"context_lines":[{"line_number":90,"context_line":"            ex_name \u003d ex_type.__name__"},{"line_number":91,"context_line":"            msg \u003d \u0027Can\\\u0027t decode {0} request. {1}: {2}\u0027.format("},{"line_number":92,"context_line":"                pack_name, ex_name, ex_value)"},{"line_number":93,"context_line":"            LOG.debug(msg)"},{"line_number":94,"context_line":"            body \u003d {\u0027error\u0027: msg}"},{"line_number":95,"context_line":"            resp \u003d self._handler.create_response(400, body)"},{"line_number":96,"context_line":"            return self._send_response(resp, isBinary)"}],"source_content_type":"text/x-python","patch_set":19,"id":"dae33548_b7ea32d9","line":93,"range":{"start_line":93,"start_character":16,"end_line":93,"end_character":21},"in_reply_to":"dae33548_bdb33f09","updated":"2016-02-18 08:57:48.000000000","message":"Thanks, but no, it\u0027s not better.\n\nLOG.exception produces log message at \"error\" level. Log messages at \"error\" level should tell cloud administrator that something is wrong with Zaqar. See: https://specs.openstack.org/openstack/openstack-specs/specs/log-guidelines.html#definition-of-log-levels\n\nWhen the client sends bad request to Zaqar it\u0027s not fault of Zaqar that this request can\u0027t be deserialized. Something is wrong with the client side. So we should not use LOG.exception to bother cloud administrator.","commit_id":"99e4367e945cae91eda88a6f64782f8c8992a7ba"},{"author":{"_account_id":6484,"name":"Feilong Wang","email":"hustemb@gmail.com","username":"flwang"},"change_message_id":"da930f85423532d8555782f727c3d4ec69ebda36","unresolved":false,"context_lines":[{"line_number":184,"context_line":""},{"line_number":185,"context_line":"    def _send_response(self, resp, in_binary):"},{"line_number":186,"context_line":"        if in_binary:"},{"line_number":187,"context_line":"            pack_name \u003d \u0027bin\u0027"},{"line_number":188,"context_line":"            self.sendMessage(msgpack.packb(resp.get_response()), True)"},{"line_number":189,"context_line":"        else:"},{"line_number":190,"context_line":"            pack_name \u003d \u0027txt\u0027"}],"source_content_type":"text/x-python","patch_set":20,"id":"9aed3d3a_564a5fc6","line":187,"updated":"2016-02-26 12:43:47.000000000","message":"I\u0027m still not really comfortable for the inconsistent pack name. But I don\u0027t want to make it as a blocker at here.","commit_id":"49c90739dee9214d807521a694eaca466c4b9362"}]}
