)]}'
{"monasca_notification/common/repositories/mysql/mysql_repo.py":[{"author":{"_account_id":16168,"name":"Tomasz Trębski","email":"kornicameister@gmail.com","username":"trebskit"},"change_message_id":"4ac8bf79a14c6c0113317fce532390df34d7176c","unresolved":false,"context_lines":[{"line_number":1,"context_line":"# Copyright 2015 FUJITSU LIMITED"},{"line_number":2,"context_line":"# (C) Copyright 2015,2016 Hewlett Packard Enterprise Development LP"},{"line_number":3,"context_line":"#"},{"line_number":4,"context_line":"# Licensed under the Apache License, Version 2.0 (the \"License\"); you may not use this file except"}],"source_content_type":"text/x-python","patch_set":2,"id":"9f436f4f_dacbf5a2","line":1,"updated":"2017-08-09 04:02:34.000000000","message":"CR","commit_id":"556a25870ae035ffe750a57c9fab2f00b4516e35"},{"author":{"_account_id":20033,"name":"Artur Basiak","email":"artur.basiak@ts.fujitsu.com","username":"abasiak"},"change_message_id":"479a1a0a78415d4a1c9dad395e533fb5f10725a0","unresolved":false,"context_lines":[{"line_number":1,"context_line":"# Copyright 2015 FUJITSU LIMITED"},{"line_number":2,"context_line":"# (C) Copyright 2015,2016 Hewlett Packard Enterprise Development LP"},{"line_number":3,"context_line":"#"},{"line_number":4,"context_line":"# Licensed under the Apache License, Version 2.0 (the \"License\"); you may not use this file except"}],"source_content_type":"text/x-python","patch_set":2,"id":"9f436f4f_fa67d924","line":1,"in_reply_to":"9f436f4f_dacbf5a2","updated":"2017-08-09 04:40:38.000000000","message":"Done","commit_id":"556a25870ae035ffe750a57c9fab2f00b4516e35"}],"monasca_notification/main.py":[{"author":{"_account_id":16168,"name":"Tomasz Trębski","email":"kornicameister@gmail.com","username":"trebskit"},"change_message_id":"4ac8bf79a14c6c0113317fce532390df34d7176c","unresolved":false,"context_lines":[{"line_number":1,"context_line":"# (C) Copyright 2014-2017 Hewlett Packard Enterprise Development LP"},{"line_number":2,"context_line":"#"},{"line_number":3,"context_line":"# Licensed under the Apache License, Version 2.0 (the \"License\");"},{"line_number":4,"context_line":"# you may not use this file except in compliance with the License."}],"source_content_type":"text/x-python","patch_set":2,"id":"9f436f4f_9ac56d91","line":1,"updated":"2017-08-09 04:02:34.000000000","message":"CR","commit_id":"556a25870ae035ffe750a57c9fab2f00b4516e35"},{"author":{"_account_id":20033,"name":"Artur Basiak","email":"artur.basiak@ts.fujitsu.com","username":"abasiak"},"change_message_id":"479a1a0a78415d4a1c9dad395e533fb5f10725a0","unresolved":false,"context_lines":[{"line_number":1,"context_line":"# (C) Copyright 2014-2017 Hewlett Packard Enterprise Development LP"},{"line_number":2,"context_line":"#"},{"line_number":3,"context_line":"# Licensed under the Apache License, Version 2.0 (the \"License\");"},{"line_number":4,"context_line":"# you may not use this file except in compliance with the License."}],"source_content_type":"text/x-python","patch_set":2,"id":"9f436f4f_da6c150a","line":1,"in_reply_to":"9f436f4f_9ac56d91","updated":"2017-08-09 04:40:38.000000000","message":"Done","commit_id":"556a25870ae035ffe750a57c9fab2f00b4516e35"}],"monasca_notification/processors/alarm_processor.py":[{"author":{"_account_id":16168,"name":"Tomasz Trębski","email":"kornicameister@gmail.com","username":"trebskit"},"change_message_id":"4ac8bf79a14c6c0113317fce532390df34d7176c","unresolved":false,"context_lines":[{"line_number":1,"context_line":"# (C) Copyright 2014-2016 Hewlett Packard Enterprise Development LP"},{"line_number":2,"context_line":"#"},{"line_number":3,"context_line":"# Licensed under the Apache License, Version 2.0 (the \"License\");"},{"line_number":4,"context_line":"# you may not use this file except in compliance with the License."}],"source_content_type":"text/x-python","patch_set":2,"id":"9f436f4f_7ac2c987","line":1,"updated":"2017-08-09 04:02:34.000000000","message":"CR","commit_id":"556a25870ae035ffe750a57c9fab2f00b4516e35"},{"author":{"_account_id":20033,"name":"Artur Basiak","email":"artur.basiak@ts.fujitsu.com","username":"abasiak"},"change_message_id":"479a1a0a78415d4a1c9dad395e533fb5f10725a0","unresolved":false,"context_lines":[{"line_number":1,"context_line":"# (C) Copyright 2014-2016 Hewlett Packard Enterprise Development LP"},{"line_number":2,"context_line":"#"},{"line_number":3,"context_line":"# Licensed under the Apache License, Version 2.0 (the \"License\");"},{"line_number":4,"context_line":"# you may not use this file except in compliance with the License."}],"source_content_type":"text/x-python","patch_set":2,"id":"9f436f4f_9a768dd8","line":1,"in_reply_to":"9f436f4f_7ac2c987","updated":"2017-08-09 04:40:38.000000000","message":"Done","commit_id":"556a25870ae035ffe750a57c9fab2f00b4516e35"},{"author":{"_account_id":16168,"name":"Tomasz Trębski","email":"kornicameister@gmail.com","username":"trebskit"},"change_message_id":"4ac8bf79a14c6c0113317fce532390df34d7176c","unresolved":false,"context_lines":[{"line_number":13,"context_line":"# See the License for the specific language governing permissions and"},{"line_number":14,"context_line":"# limitations under the License."},{"line_number":15,"context_line":""},{"line_number":16,"context_line":"import json"},{"line_number":17,"context_line":"import logging"},{"line_number":18,"context_line":"import time"},{"line_number":19,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"9f436f4f_fa3b5999","line":16,"updated":"2017-08-09 04:02:34.000000000","message":"json...hmm....ujson ;-)","commit_id":"556a25870ae035ffe750a57c9fab2f00b4516e35"},{"author":{"_account_id":20033,"name":"Artur Basiak","email":"artur.basiak@ts.fujitsu.com","username":"abasiak"},"change_message_id":"479a1a0a78415d4a1c9dad395e533fb5f10725a0","unresolved":false,"context_lines":[{"line_number":13,"context_line":"# See the License for the specific language governing permissions and"},{"line_number":14,"context_line":"# limitations under the License."},{"line_number":15,"context_line":""},{"line_number":16,"context_line":"import json"},{"line_number":17,"context_line":"import logging"},{"line_number":18,"context_line":"import time"},{"line_number":19,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"9f436f4f_7a73e9e8","line":16,"in_reply_to":"9f436f4f_fa3b5999","updated":"2017-08-09 04:40:38.000000000","message":"Done","commit_id":"556a25870ae035ffe750a57c9fab2f00b4516e35"},{"author":{"_account_id":13702,"name":"yushiro","username":"yushiro","inactive":true},"change_message_id":"f23cf93d05cbc46fedc7bdb6d9c70ddfe80e21ec","unresolved":false,"context_lines":[{"line_number":53,"context_line":"        ]"},{"line_number":54,"context_line":"        # check if alarm_data is \u003cclass \u0027bytes\u0027\u003e"},{"line_number":55,"context_line":"        # if yes convert it to standard string"},{"line_number":56,"context_line":"        if isinstance(alarm_data, bytes):"},{"line_number":57,"context_line":"            alarm_data \u003d alarm_data.decode(\"utf-8\")"},{"line_number":58,"context_line":"        json_alarm \u003d json.loads(alarm_data)"},{"line_number":59,"context_line":"        alarm \u003d json_alarm[\u0027alarm-transitioned\u0027]"}],"source_content_type":"text/x-python","patch_set":2,"id":"9f436f4f_6080dc8c","line":56,"range":{"start_line":56,"start_character":33,"end_line":56,"end_character":39},"updated":"2017-08-09 06:07:18.000000000","message":"Could you consider to use \"six.binary_type\"?","commit_id":"556a25870ae035ffe750a57c9fab2f00b4516e35"},{"author":{"_account_id":13702,"name":"yushiro","username":"yushiro","inactive":true},"change_message_id":"878563c95303f6f7976c356b6a43385ffd6ad6b5","unresolved":false,"context_lines":[{"line_number":53,"context_line":"        ]"},{"line_number":54,"context_line":"        # check if alarm_data is \u003cclass \u0027bytes\u0027\u003e"},{"line_number":55,"context_line":"        # if yes convert it to standard string"},{"line_number":56,"context_line":"        if isinstance(alarm_data, bytes):"},{"line_number":57,"context_line":"            alarm_data \u003d alarm_data.decode(\"utf-8\")"},{"line_number":58,"context_line":"        json_alarm \u003d json.loads(alarm_data)"},{"line_number":59,"context_line":"        alarm \u003d json_alarm[\u0027alarm-transitioned\u0027]"}],"source_content_type":"text/x-python","patch_set":2,"id":"9f436f4f_d6fdf2b1","line":56,"range":{"start_line":56,"start_character":33,"end_line":56,"end_character":39},"in_reply_to":"9f436f4f_547a3924","updated":"2017-08-10 02:35:12.000000000","message":"Sorry, I don\u0027t get your point.  You\u0027d like to convert from bytes to str or avoid converting when alarm_data is string, right?  If latter case is correct, could you tell me some effect to decode \u0027utf-8\u0027 from string?  I think \u0027byte\u0027 is only Python3 and doesn\u0027t exist in Python2 ( same as \u0027str\u0027).  Furthermore, these are same result both \u0027byte\u0027 and \u0027six.binary_type:\n\n\n$ python2.7\n\u003e\u003e\u003e import six; ret \u003d [((\u0027validator is binary\u0027, isinstance(p, bytes)), (\u0027validator is six.binary_type\u0027, isinstance(p, six.binary_type))) for p in [bytes(), \u0027hoge\u0027]];print(ret)\n\n[((\u0027validator is binary\u0027, True), (\u0027validator is six.binary_type\u0027, True)),\n ((\u0027validator is binary\u0027, True), (\u0027validator is six.binary_type\u0027, True))]\n\n$ python3.5\n\u003e\u003e\u003e import six; ret \u003d [((\u0027validator is binary\u0027, isinstance(p, bytes)), (\u0027validator is six.binary_type\u0027, isinstance(p, six.binary_type))) for p in [bytes(), \u0027hoge\u0027]];print(ret)\n\n[((\u0027validator is binary\u0027, True),  (\u0027validator is six.binary_type\u0027, True)),\n ((\u0027validator is binary\u0027, False), (\u0027validator is six.binary_type\u0027, False))]\n\nSo, I think it\u0027s better to use six.binary_type for compatibility perspective.","commit_id":"556a25870ae035ffe750a57c9fab2f00b4516e35"},{"author":{"_account_id":20033,"name":"Artur Basiak","email":"artur.basiak@ts.fujitsu.com","username":"abasiak"},"change_message_id":"a12dafca82395d0a87ec393c9f27d9ca5168fc95","unresolved":false,"context_lines":[{"line_number":53,"context_line":"        ]"},{"line_number":54,"context_line":"        # check if alarm_data is \u003cclass \u0027bytes\u0027\u003e"},{"line_number":55,"context_line":"        # if yes convert it to standard string"},{"line_number":56,"context_line":"        if isinstance(alarm_data, bytes):"},{"line_number":57,"context_line":"            alarm_data \u003d alarm_data.decode(\"utf-8\")"},{"line_number":58,"context_line":"        json_alarm \u003d json.loads(alarm_data)"},{"line_number":59,"context_line":"        alarm \u003d json_alarm[\u0027alarm-transitioned\u0027]"}],"source_content_type":"text/x-python","patch_set":2,"id":"9f436f4f_547a3924","line":56,"range":{"start_line":56,"start_character":33,"end_line":56,"end_character":39},"in_reply_to":"9f436f4f_6080dc8c","updated":"2017-08-09 06:32:36.000000000","message":"I cannot use six.bianry_type here, because in every situation this condition will be True, for example in Python2: \n  \u003e\u003e\u003e import six\n  \u003e\u003e\u003e six.binary_type\n  \u003ctype \u0027str\u0027\u003e\n  \u003e\u003e\u003e a \u003d \u0027fff\u0027\n  \u003e\u003e\u003e type(a)\n  \u003ctype \u0027str\u0027\u003e\n  \u003e\u003e\u003e isinstance(a, six.binary_type)\n  True\n  \u003e\u003e\u003e\n\nThe same will be in Python3. This condition will be always True regarding which version of Python you want to use. That is why here I am checking \u003cclass \u0027bytes\u0027\u003e conditions which will be fulfilled for Python3.","commit_id":"556a25870ae035ffe750a57c9fab2f00b4516e35"}]}
