)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":9200,"name":"IWAMOTO Toshihiro","email":"iwamoto@valinux.co.jp","username":"toshii"},"change_message_id":"969d59f12e4bac3eac9da007c091b817b0da9304","unresolved":false,"context_lines":[{"line_number":12,"context_line":"  isinstance(text, six.text_type) test"},{"line_number":13,"context_line":"* Replace jsonutils.dumps(obj).encode(\u0027utf-8\u0027) with"},{"line_number":14,"context_line":"  jsonutils.dump_as_bytes(obj). The old code doesn\u0027t work"},{"line_number":15,"context_line":"  on Python 3."},{"line_number":16,"context_line":"* Other minor bytes/Unicode changes"},{"line_number":17,"context_line":""},{"line_number":18,"context_line":"Change-Id: I03b8eff0fd70ab65ac66d6f3221e8ced0a56db17"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":5,"id":"9a061dce_ce8895ea","line":15,"updated":"2016-04-05 02:16:28.000000000","message":"Did the old code generate errors on python3?\n\nI agree use of dump_as_bytes is better.","commit_id":"9bb65cba996b6360819f659c507aed05c6d102af"},{"author":{"_account_id":9107,"name":"Victor Stinner","email":"vstinner@redhat.com","username":"haypo"},"change_message_id":"99c5c23995e354c21ae0827148ad5c1355b60d21","unresolved":false,"context_lines":[{"line_number":12,"context_line":"  isinstance(text, six.text_type) test"},{"line_number":13,"context_line":"* Replace jsonutils.dumps(obj).encode(\u0027utf-8\u0027) with"},{"line_number":14,"context_line":"  jsonutils.dump_as_bytes(obj). The old code doesn\u0027t work"},{"line_number":15,"context_line":"  on Python 3."},{"line_number":16,"context_line":"* Other minor bytes/Unicode changes"},{"line_number":17,"context_line":""},{"line_number":18,"context_line":"Change-Id: I03b8eff0fd70ab65ac66d6f3221e8ced0a56db17"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":5,"id":"7a1b2928_edbe5bd3","line":15,"in_reply_to":"9a061dce_ce8895ea","updated":"2016-04-21 07:15:18.000000000","message":"I don\u0027t recall why I wrote that the old code doesn\u0027t work on Python 3. I just removed the sentence.","commit_id":"9bb65cba996b6360819f659c507aed05c6d102af"}],"neutron/agent/linux/utils.py":[{"author":{"_account_id":18602,"name":"Gábor Antal","email":"antal@inf.u-szeged.hu","username":"antal"},"change_message_id":"712c525373f3a8a4b837d33e5073f29b4b25dd88","unresolved":false,"context_lines":[{"line_number":107,"context_line":"            extra_ok_codes\u003dNone, run_as_root\u003dFalse):"},{"line_number":108,"context_line":"    try:"},{"line_number":109,"context_line":"        if process_input is None:"},{"line_number":110,"context_line":"            _process_input \u003d process_input"},{"line_number":111,"context_line":"        else:"},{"line_number":112,"context_line":"            _process_input \u003d encodeutils.to_utf8(process_input)"},{"line_number":113,"context_line":"        if run_as_root and cfg.CONF.AGENT.root_helper_daemon:"}],"source_content_type":"text/x-python","patch_set":2,"id":"bae84128_89301da0","line":110,"range":{"start_line":110,"start_character":29,"end_line":110,"end_character":42},"updated":"2016-02-22 10:58:57.000000000","message":"Maybe you can simplify this as process_input is None. So you should write None instead of a named variable which is None. Before this modification the process_input could also be a type of six.binary_type, which is no longer possible. If I missed something, please write what I\u0027ve missed.","commit_id":"555d84ae8557eea66ab313a48f5da2cef46eb62f"},{"author":{"_account_id":9107,"name":"Victor Stinner","email":"vstinner@redhat.com","username":"haypo"},"change_message_id":"2591f7d088f114a6cbd7244afa23890704fa703b","unresolved":false,"context_lines":[{"line_number":107,"context_line":"            extra_ok_codes\u003dNone, run_as_root\u003dFalse):"},{"line_number":108,"context_line":"    try:"},{"line_number":109,"context_line":"        if process_input is None:"},{"line_number":110,"context_line":"            _process_input \u003d process_input"},{"line_number":111,"context_line":"        else:"},{"line_number":112,"context_line":"            _process_input \u003d encodeutils.to_utf8(process_input)"},{"line_number":113,"context_line":"        if run_as_root and cfg.CONF.AGENT.root_helper_daemon:"}],"source_content_type":"text/x-python","patch_set":2,"id":"bae84128_29dd91e0","line":110,"range":{"start_line":110,"start_character":29,"end_line":110,"end_character":42},"in_reply_to":"bae84128_89301da0","updated":"2016-02-22 11:04:33.000000000","message":"Done","commit_id":"555d84ae8557eea66ab313a48f5da2cef46eb62f"},{"author":{"_account_id":8726,"name":"Victor Morales","email":"chipahuac@hotmail.com","username":"electrocucaracha"},"change_message_id":"f5c9ae1a3934009c1066c2278fc118b8d84a060c","unresolved":false,"context_lines":[{"line_number":104,"context_line":"            check_exit_code\u003dTrue, return_stderr\u003dFalse, log_fail_as_error\u003dTrue,"},{"line_number":105,"context_line":"            extra_ok_codes\u003dNone, run_as_root\u003dFalse):"},{"line_number":106,"context_line":"    try:"},{"line_number":107,"context_line":"        if process_input is None:"},{"line_number":108,"context_line":"            _process_input \u003d None"},{"line_number":109,"context_line":"        else:"},{"line_number":110,"context_line":"            _process_input \u003d encodeutils.to_utf8(process_input)"},{"line_number":111,"context_line":"        if run_as_root and cfg.CONF.AGENT.root_helper_daemon:"},{"line_number":112,"context_line":"            returncode, _stdout, _stderr \u003d ("},{"line_number":113,"context_line":"                execute_rootwrap_daemon(cmd, process_input, addl_env))"}],"source_content_type":"text/x-python","patch_set":5,"id":"ba0121b8_7be4e2aa","line":110,"range":{"start_line":107,"start_character":0,"end_line":110,"end_character":63},"updated":"2016-04-01 17:59:01.000000000","message":"nit:\n\n_process_input \u003d None\nif not (process_input is None):\n    _process_input \u003d encodeutils.to_utf8(process_input)","commit_id":"9bb65cba996b6360819f659c507aed05c6d102af"},{"author":{"_account_id":9107,"name":"Victor Stinner","email":"vstinner@redhat.com","username":"haypo"},"change_message_id":"99c5c23995e354c21ae0827148ad5c1355b60d21","unresolved":false,"context_lines":[{"line_number":104,"context_line":"            check_exit_code\u003dTrue, return_stderr\u003dFalse, log_fail_as_error\u003dTrue,"},{"line_number":105,"context_line":"            extra_ok_codes\u003dNone, run_as_root\u003dFalse):"},{"line_number":106,"context_line":"    try:"},{"line_number":107,"context_line":"        if process_input is None:"},{"line_number":108,"context_line":"            _process_input \u003d None"},{"line_number":109,"context_line":"        else:"},{"line_number":110,"context_line":"            _process_input \u003d encodeutils.to_utf8(process_input)"},{"line_number":111,"context_line":"        if run_as_root and cfg.CONF.AGENT.root_helper_daemon:"},{"line_number":112,"context_line":"            returncode, _stdout, _stderr \u003d ("},{"line_number":113,"context_line":"                execute_rootwrap_daemon(cmd, process_input, addl_env))"}],"source_content_type":"text/x-python","patch_set":5,"id":"7a1b2928_ed93fb4d","line":110,"range":{"start_line":107,"start_character":0,"end_line":110,"end_character":63},"in_reply_to":"9a061dce_ee7c7974","updated":"2016-04-21 07:15:18.000000000","message":"I inverted the test.","commit_id":"9bb65cba996b6360819f659c507aed05c6d102af"},{"author":{"_account_id":9200,"name":"IWAMOTO Toshihiro","email":"iwamoto@valinux.co.jp","username":"toshii"},"change_message_id":"969d59f12e4bac3eac9da007c091b817b0da9304","unresolved":false,"context_lines":[{"line_number":104,"context_line":"            check_exit_code\u003dTrue, return_stderr\u003dFalse, log_fail_as_error\u003dTrue,"},{"line_number":105,"context_line":"            extra_ok_codes\u003dNone, run_as_root\u003dFalse):"},{"line_number":106,"context_line":"    try:"},{"line_number":107,"context_line":"        if process_input is None:"},{"line_number":108,"context_line":"            _process_input \u003d None"},{"line_number":109,"context_line":"        else:"},{"line_number":110,"context_line":"            _process_input \u003d encodeutils.to_utf8(process_input)"},{"line_number":111,"context_line":"        if run_as_root and cfg.CONF.AGENT.root_helper_daemon:"},{"line_number":112,"context_line":"            returncode, _stdout, _stderr \u003d ("},{"line_number":113,"context_line":"                execute_rootwrap_daemon(cmd, process_input, addl_env))"}],"source_content_type":"text/x-python","patch_set":5,"id":"9a061dce_ee7c7974","line":110,"range":{"start_line":107,"start_character":0,"end_line":110,"end_character":63},"in_reply_to":"ba0121b8_7be4e2aa","updated":"2016-04-05 02:16:28.000000000","message":"Hi Victor,\n\nI think the original patch is fine.\nIn your example, \"if process_input is not None\" seems to be more common.","commit_id":"9bb65cba996b6360819f659c507aed05c6d102af"}],"neutron/agent/windows/utils.py":[{"author":{"_account_id":18602,"name":"Gábor Antal","email":"antal@inf.u-szeged.hu","username":"antal"},"change_message_id":"712c525373f3a8a4b837d33e5073f29b4b25dd88","unresolved":false,"context_lines":[{"line_number":50,"context_line":"            extra_ok_codes\u003dNone, run_as_root\u003dFalse, do_decode\u003dTrue):"},{"line_number":51,"context_line":""},{"line_number":52,"context_line":"    try:"},{"line_number":53,"context_line":"        if process_input is None:"},{"line_number":54,"context_line":"            _process_input \u003d process_input"},{"line_number":55,"context_line":"        else:"},{"line_number":56,"context_line":"            _process_input \u003d encodeutils.to_utf8(process_input)"},{"line_number":57,"context_line":"        obj, cmd \u003d create_process(cmd, addl_env\u003daddl_env)"}],"source_content_type":"text/x-python","patch_set":2,"id":"bae84128_091d2d0f","line":54,"range":{"start_line":53,"start_character":8,"end_line":54,"end_character":42},"updated":"2016-02-22 10:58:57.000000000","message":"Same here","commit_id":"555d84ae8557eea66ab313a48f5da2cef46eb62f"},{"author":{"_account_id":8726,"name":"Victor Morales","email":"chipahuac@hotmail.com","username":"electrocucaracha"},"change_message_id":"f5c9ae1a3934009c1066c2278fc118b8d84a060c","unresolved":false,"context_lines":[{"line_number":50,"context_line":"            extra_ok_codes\u003dNone, run_as_root\u003dFalse, do_decode\u003dTrue):"},{"line_number":51,"context_line":""},{"line_number":52,"context_line":"    try:"},{"line_number":53,"context_line":"        if process_input is None:"},{"line_number":54,"context_line":"            _process_input \u003d process_input"},{"line_number":55,"context_line":"        else:"},{"line_number":56,"context_line":"            _process_input \u003d encodeutils.to_utf8(process_input)"},{"line_number":57,"context_line":"        obj, cmd \u003d create_process(cmd, addl_env\u003daddl_env)"},{"line_number":58,"context_line":"        _stdout, _stderr \u003d obj.communicate(_process_input)"},{"line_number":59,"context_line":"        obj.stdin.close()"}],"source_content_type":"text/x-python","patch_set":5,"id":"ba0121b8_746b4f85","line":56,"range":{"start_line":53,"start_character":0,"end_line":56,"end_character":63},"updated":"2016-04-01 17:59:01.000000000","message":"nit:\n_process_input \u003d process_input\nif not (process_input is None):\n    _process_input \u003d encodeutils.to_utf8(process_input)","commit_id":"9bb65cba996b6360819f659c507aed05c6d102af"},{"author":{"_account_id":9107,"name":"Victor Stinner","email":"vstinner@redhat.com","username":"haypo"},"change_message_id":"99c5c23995e354c21ae0827148ad5c1355b60d21","unresolved":false,"context_lines":[{"line_number":50,"context_line":"            extra_ok_codes\u003dNone, run_as_root\u003dFalse, do_decode\u003dTrue):"},{"line_number":51,"context_line":""},{"line_number":52,"context_line":"    try:"},{"line_number":53,"context_line":"        if process_input is None:"},{"line_number":54,"context_line":"            _process_input \u003d process_input"},{"line_number":55,"context_line":"        else:"},{"line_number":56,"context_line":"            _process_input \u003d encodeutils.to_utf8(process_input)"},{"line_number":57,"context_line":"        obj, cmd \u003d create_process(cmd, addl_env\u003daddl_env)"},{"line_number":58,"context_line":"        _stdout, _stderr \u003d obj.communicate(_process_input)"},{"line_number":59,"context_line":"        obj.stdin.close()"}],"source_content_type":"text/x-python","patch_set":5,"id":"7a1b2928_ed081b94","line":56,"range":{"start_line":53,"start_character":0,"end_line":56,"end_character":63},"in_reply_to":"ba0121b8_746b4f85","updated":"2016-04-21 07:15:18.000000000","message":"I changed the code.","commit_id":"9bb65cba996b6360819f659c507aed05c6d102af"}],"neutron/common/utils.py":[{"author":{"_account_id":9200,"name":"IWAMOTO Toshihiro","email":"iwamoto@valinux.co.jp","username":"toshii"},"change_message_id":"1222b1fda42327b6eaa992f0278f467a639a8664","unresolved":false,"context_lines":[{"line_number":325,"context_line":"    rndstr \u003d \"\""},{"line_number":326,"context_line":"    random.seed(datetime.datetime.now().microsecond)"},{"line_number":327,"context_line":"    while len(rndstr) \u003c length:"},{"line_number":328,"context_line":"        base_str \u003d str(random.random())"},{"line_number":329,"context_line":"        base_str \u003d encodeutils.to_utf8(base_str)"},{"line_number":330,"context_line":"        rndstr +\u003d hashlib.sha224(base_str).hexdigest()"},{"line_number":331,"context_line":""}],"source_content_type":"text/x-python","patch_set":3,"id":"7af24918_7bcc0abb","line":328,"updated":"2016-03-04 02:00:58.000000000","message":"This function is broken in several ways.\n\nrandom.random() generates only 53bits of randomness. Hashing such a value to generate 224bits of digest doesn\u0027t make sense.\n\nThis use of random.seed degrades random number quality. The RNG has been initialized with os.urandom() with enough bits of randomness.","commit_id":"76807a4398f037b4ce4b408a370a7755cbe0707c"}],"neutron/tests/common/agents/ovs_agent.py":[{"author":{"_account_id":9200,"name":"IWAMOTO Toshihiro","email":"iwamoto@valinux.co.jp","username":"toshii"},"change_message_id":"969d59f12e4bac3eac9da007c091b817b0da9304","unresolved":false,"context_lines":[{"line_number":31,"context_line":""},{"line_number":32,"context_line":"    # Remove length of network_type and two dashes"},{"line_number":33,"context_line":"    hashlen \u003d (n_const.DEVICE_NAME_MAX_LEN - len(network_type) - 2) // 2"},{"line_number":34,"context_line":"    remote_ip_hex \u003d encodeutils.to_utf8(remote_ip_hex)"},{"line_number":35,"context_line":"    remote_ip_hash \u003d hashlib.sha1(remote_ip_hex).hexdigest()[:hashlen]"},{"line_number":36,"context_line":""},{"line_number":37,"context_line":"    local_ip_hex \u003d cls.get_ip_in_hex(local_ip)"}],"source_content_type":"text/x-python","patch_set":5,"id":"9a061dce_6e1b491c","line":34,"updated":"2016-04-05 02:16:28.000000000","message":"As get_ip_in_hex always returns text_type, using encode_utils.to_utf8 introduces a needless if branch.\n\nI think the original code is better in this case.","commit_id":"9bb65cba996b6360819f659c507aed05c6d102af"},{"author":{"_account_id":9200,"name":"IWAMOTO Toshihiro","email":"iwamoto@valinux.co.jp","username":"toshii"},"change_message_id":"3992c72b197f52b55c0a64cec6c8bb787ee2ccdc","unresolved":false,"context_lines":[{"line_number":31,"context_line":""},{"line_number":32,"context_line":"    # Remove length of network_type and two dashes"},{"line_number":33,"context_line":"    hashlen \u003d (n_const.DEVICE_NAME_MAX_LEN - len(network_type) - 2) // 2"},{"line_number":34,"context_line":"    remote_ip_hex \u003d encodeutils.to_utf8(remote_ip_hex)"},{"line_number":35,"context_line":"    remote_ip_hash \u003d hashlib.sha1(remote_ip_hex).hexdigest()[:hashlen]"},{"line_number":36,"context_line":""},{"line_number":37,"context_line":"    local_ip_hex \u003d cls.get_ip_in_hex(local_ip)"}],"source_content_type":"text/x-python","patch_set":5,"id":"1a122d0e_0ab63df8","line":34,"in_reply_to":"7a1b2928_6d09ab31","updated":"2016-04-21 07:40:48.000000000","message":"Oh I see.","commit_id":"9bb65cba996b6360819f659c507aed05c6d102af"},{"author":{"_account_id":9107,"name":"Victor Stinner","email":"vstinner@redhat.com","username":"haypo"},"change_message_id":"99c5c23995e354c21ae0827148ad5c1355b60d21","unresolved":false,"context_lines":[{"line_number":31,"context_line":""},{"line_number":32,"context_line":"    # Remove length of network_type and two dashes"},{"line_number":33,"context_line":"    hashlen \u003d (n_const.DEVICE_NAME_MAX_LEN - len(network_type) - 2) // 2"},{"line_number":34,"context_line":"    remote_ip_hex \u003d encodeutils.to_utf8(remote_ip_hex)"},{"line_number":35,"context_line":"    remote_ip_hash \u003d hashlib.sha1(remote_ip_hex).hexdigest()[:hashlen]"},{"line_number":36,"context_line":""},{"line_number":37,"context_line":"    local_ip_hex \u003d cls.get_ip_in_hex(local_ip)"}],"source_content_type":"text/x-python","patch_set":5,"id":"7a1b2928_6d09ab31","line":34,"in_reply_to":"9a061dce_6e1b491c","updated":"2016-04-21 07:15:18.000000000","message":"Are you sure?\n\nIn neutron/plugins/ml2/drivers/openvswitch/agent/ovs_neutron_agent.py, I see the code:\n\n   return \u0027%08x\u0027 % netaddr.IPAddress(ip_address, version\u003d4)\n\nwhich returns type str (bytes) on Python 2.\n\nOn Python 2, str.encode(\u0027utf8\u0027) is useless and can lead to bugs since it starts by decoding the string from ASCII.","commit_id":"9bb65cba996b6360819f659c507aed05c6d102af"},{"author":{"_account_id":9200,"name":"IWAMOTO Toshihiro","email":"iwamoto@valinux.co.jp","username":"toshii"},"change_message_id":"969d59f12e4bac3eac9da007c091b817b0da9304","unresolved":false,"context_lines":[{"line_number":35,"context_line":"    remote_ip_hash \u003d hashlib.sha1(remote_ip_hex).hexdigest()[:hashlen]"},{"line_number":36,"context_line":""},{"line_number":37,"context_line":"    local_ip_hex \u003d cls.get_ip_in_hex(local_ip)"},{"line_number":38,"context_line":"    local_ip_hex \u003d encodeutils.to_utf8(local_ip_hex)"},{"line_number":39,"context_line":"    source_ip_hash \u003d hashlib.sha1(local_ip_hex).hexdigest()[:hashlen]"},{"line_number":40,"context_line":""},{"line_number":41,"context_line":"    return \u0027%s-%s-%s\u0027 % (network_type, source_ip_hash, remote_ip_hash)"}],"source_content_type":"text/x-python","patch_set":5,"id":"9a061dce_aed3a137","line":38,"updated":"2016-04-05 02:16:28.000000000","message":"ditto","commit_id":"9bb65cba996b6360819f659c507aed05c6d102af"}]}
