)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":21273,"name":"Ilya Chukhnakov","email":"Ilya.chukhnakov@gmail.com","username":"ichukhnakov"},"change_message_id":"178fdc7618df3d232b439ef2275c440147b7462d","unresolved":false,"context_lines":[{"line_number":6,"context_line":""},{"line_number":7,"context_line":"Use bisect to search sorted rows"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"The Python OVS library returns lists in sorted order. When searching"},{"line_number":10,"context_line":"a list for a matching row, we can use bisect() to go from O(n) to"},{"line_number":11,"context_line":"O(log(n)) for the search."},{"line_number":12,"context_line":""}],"source_content_type":"text/x-gerrit-commit-message","patch_set":7,"id":"7aa08908_43a8fa1f","line":9,"range":{"start_line":9,"start_character":11,"end_line":9,"end_character":52},"updated":"2016-06-06 13:34:26.000000000","message":"Can we have a test to make sure OVS lib keeps that behaviour?","commit_id":"9eb14ced6a5193a8a87a01c2d8788488328beb6e"},{"author":{"_account_id":21273,"name":"Ilya Chukhnakov","email":"Ilya.chukhnakov@gmail.com","username":"ichukhnakov"},"change_message_id":"3fb0c383bd7c99d6362679929ba86822344f7e98","unresolved":false,"context_lines":[{"line_number":6,"context_line":""},{"line_number":7,"context_line":"Use bisect to search sorted rows"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"The Python OVS library returns lists in sorted order. When searching"},{"line_number":10,"context_line":"a list for a matching row, we can use bisect() to go from O(n) to"},{"line_number":11,"context_line":"O(log(n)) for the search."},{"line_number":12,"context_line":""}],"source_content_type":"text/x-gerrit-commit-message","patch_set":7,"id":"7aa08908_c9087ddc","line":9,"range":{"start_line":9,"start_character":11,"end_line":9,"end_character":52},"in_reply_to":"7aa08908_2f182f1d","updated":"2016-06-06 16:43:38.000000000","message":"@Jakub, @Terry, my point is that we rely on something that might be just an implementation detail of the OVS library, but is not necessary guaranteed. And if it actually changes, it might be a nightmarish bug to catch.\n\n\u003e the tests I have already added would fail\n\n@Terry, the unit tests from test_idlutils do not cover the OVS lib case, so it only leaves \u0027test_delete_one_of_many_ports\u0027 where ports are added in the natural order, so I don\u0027t think it somehow tests the ordering.\n\nI\u0027d agree that we probably can\u0027t reliably test the ordering returned by OVS lib. But at least it\u0027s worth leaving a note in the code.\n\nAlso, I\u0027ve run your test with \u0027x in set(list)\u0027 approach [1]. Of cause it is somewhat slower than bisect, but still 20 times faster than original \u0027in\u0027 and does not rely on OVS lib behaviour. Would you consider that \u0027good enough\u0027?\n\n[1] http://paste.openstack.org/show/508405/","commit_id":"9eb14ced6a5193a8a87a01c2d8788488328beb6e"},{"author":{"_account_id":5756,"name":"Terry Wilson","email":"twilson@redhat.com","username":"otherwiseguy"},"change_message_id":"e0537db30b8d0fd41fb0b8afdbfdfe778c4155b2","unresolved":false,"context_lines":[{"line_number":6,"context_line":""},{"line_number":7,"context_line":"Use bisect to search sorted rows"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"The Python OVS library returns lists in sorted order. When searching"},{"line_number":10,"context_line":"a list for a matching row, we can use bisect() to go from O(n) to"},{"line_number":11,"context_line":"O(log(n)) for the search."},{"line_number":12,"context_line":""}],"source_content_type":"text/x-gerrit-commit-message","patch_set":7,"id":"7aa08908_2f182f1d","line":9,"range":{"start_line":9,"start_character":11,"end_line":9,"end_character":52},"in_reply_to":"7aa08908_43a8fa1f","updated":"2016-06-06 14:24:16.000000000","message":"It is specifically done with return sorted(...) so isn\u0027t an accident, has always been done (in two different ways, but always specifically sorted), and is done in the C library as well as Python. If the behavior changes, the tests I have already added would fail. I see tests in the OVS tree ensuring that sorting of all of the atomic types works and modifying one of the OVSDB IDL tests in the OVS tree to change the order of a stored array did not affect whether the test passed. They could not easily change this behavior without breaking lots of dependent code.\n\nIdeally, instead of just returning sorted() results everywhere in the Python OVS library, it would use one of the many sorted containers modules available and then we\u0027d just use \u0027in\u0027 and be done with it. But that is a pretty huge change and is unlikely to happen anytime soon.","commit_id":"9eb14ced6a5193a8a87a01c2d8788488328beb6e"},{"author":{"_account_id":8655,"name":"Jakub Libosvar","email":"libosvar@redhat.com","username":"jlibosva"},"change_message_id":"f813ab7f07436d0fa1303ee24ecbfa01839c131a","unresolved":false,"context_lines":[{"line_number":6,"context_line":""},{"line_number":7,"context_line":"Use bisect to search sorted rows"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"The Python OVS library returns lists in sorted order. When searching"},{"line_number":10,"context_line":"a list for a matching row, we can use bisect() to go from O(n) to"},{"line_number":11,"context_line":"O(log(n)) for the search."},{"line_number":12,"context_line":""}],"source_content_type":"text/x-gerrit-commit-message","patch_set":7,"id":"7aa08908_da096b2e","line":9,"range":{"start_line":9,"start_character":11,"end_line":9,"end_character":52},"in_reply_to":"7aa08908_43a8fa1f","updated":"2016-06-06 13:58:42.000000000","message":"Why do you think we need to test 3rd party libraries\u0027 API?","commit_id":"9eb14ced6a5193a8a87a01c2d8788488328beb6e"},{"author":{"_account_id":21273,"name":"Ilya Chukhnakov","email":"Ilya.chukhnakov@gmail.com","username":"ichukhnakov"},"change_message_id":"6c93a3d6a82deaeca5426c1cc647d898aa6127e4","unresolved":false,"context_lines":[{"line_number":6,"context_line":""},{"line_number":7,"context_line":"Use bisect to search sorted rows"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"The Python OVS library returns lists in sorted order. When searching"},{"line_number":10,"context_line":"a list for a matching row, we can use bisect() to go from O(n) to"},{"line_number":11,"context_line":"O(log(n)) for the search."},{"line_number":12,"context_line":""}],"source_content_type":"text/x-gerrit-commit-message","patch_set":7,"id":"7aa08908_8f731515","line":9,"range":{"start_line":9,"start_character":11,"end_line":9,"end_character":52},"in_reply_to":"7aa08908_c9087ddc","updated":"2016-06-06 17:14:13.000000000","message":"Please, disregard the \u0027x in set\u0027 (it does not account for missing __hash__).","commit_id":"9eb14ced6a5193a8a87a01c2d8788488328beb6e"}],"neutron/agent/ovsdb/native/commands.py":[{"author":{"_account_id":8655,"name":"Jakub Libosvar","email":"libosvar@redhat.com","username":"jlibosva"},"change_message_id":"268f074d663a7c18adb46051b67652d9f2223fed","unresolved":false,"context_lines":[{"line_number":329,"context_line":"                                       self.bridge)"},{"line_number":330,"context_line":"            try:"},{"line_number":331,"context_line":"                idlutils.sorted_row_find(br.ports, port)"},{"line_number":332,"context_line":"            except ValueError:"},{"line_number":333,"context_line":"                if self.if_exists:"},{"line_number":334,"context_line":"                    pass"},{"line_number":335,"context_line":"                # TODO(twilson) Make real errors across both implementations"}],"source_content_type":"text/x-python","patch_set":2,"id":"9abb7d3a_6a36cde8","line":332,"range":{"start_line":332,"start_character":12,"end_line":332,"end_character":29},"updated":"2016-06-02 13:09:16.000000000","message":"I somehow can\u0027t see when this occurs. I see that sorted_row_find is similar to one on python docs page but without ValueError","commit_id":"6d48af08af601b2941513403e9d1db6956964a9d"},{"author":{"_account_id":5756,"name":"Terry Wilson","email":"twilson@redhat.com","username":"otherwiseguy"},"change_message_id":"f3370220a7ca9eaac27c1f8fb96d67392f004f46","unresolved":false,"context_lines":[{"line_number":329,"context_line":"                                       self.bridge)"},{"line_number":330,"context_line":"            try:"},{"line_number":331,"context_line":"                idlutils.sorted_row_find(br.ports, port)"},{"line_number":332,"context_line":"            except ValueError:"},{"line_number":333,"context_line":"                if self.if_exists:"},{"line_number":334,"context_line":"                    pass"},{"line_number":335,"context_line":"                # TODO(twilson) Make real errors across both implementations"}],"source_content_type":"text/x-python","patch_set":2,"id":"9abb7d3a_2a17a055","line":332,"range":{"start_line":332,"start_character":12,"end_line":332,"end_character":29},"in_reply_to":"9abb7d3a_6a36cde8","updated":"2016-06-02 15:17:02.000000000","message":"Crap, this was left over from a different version.","commit_id":"6d48af08af601b2941513403e9d1db6956964a9d"},{"author":{"_account_id":5756,"name":"Terry Wilson","email":"twilson@redhat.com","username":"otherwiseguy"},"change_message_id":"c4b60dbb98145bbe0d69677362c4d5b1258e51e1","unresolved":false,"context_lines":[{"line_number":402,"context_line":"                                          self.name)"},{"line_number":403,"context_line":"        ports \u003d self.api._tables[\u0027Port\u0027].rows.values()"},{"line_number":404,"context_line":"        pname \u003d next(port for port in ports"},{"line_number":405,"context_line":"                     if idlutils.sorted_row_find(port.interfaces, interface))"},{"line_number":406,"context_line":"        bridges \u003d self.api._tables[\u0027Bridge\u0027].rows.values()"},{"line_number":407,"context_line":"        self.result \u003d next(br.name for br in bridges"},{"line_number":408,"context_line":"                           if idlutils.sorted_row_find(br.ports, pname))"}],"source_content_type":"text/x-python","patch_set":2,"id":"bab6814e_b8334161","line":405,"updated":"2016-05-26 20:51:40.000000000","message":"This one is probably technically slower because port.interfaces is almost never going to be anything but len(1).","commit_id":"6d48af08af601b2941513403e9d1db6956964a9d"},{"author":{"_account_id":21273,"name":"Ilya Chukhnakov","email":"Ilya.chukhnakov@gmail.com","username":"ichukhnakov"},"change_message_id":"178fdc7618df3d232b439ef2275c440147b7462d","unresolved":false,"context_lines":[{"line_number":330,"context_line":"            br \u003d idlutils.row_by_value(self.api.idl, \u0027Bridge\u0027, \u0027name\u0027,"},{"line_number":331,"context_line":"                                       self.bridge)"},{"line_number":332,"context_line":"            try:"},{"line_number":333,"context_line":"                idlutils.sorted_row_find(br.ports, port)"},{"line_number":334,"context_line":"            except ValueError:"},{"line_number":335,"context_line":"                if not self.if_exists:"},{"line_number":336,"context_line":"                    # TODO(twilson) Make real errors across implementations"}],"source_content_type":"text/x-python","patch_set":7,"id":"7aa08908_4649285f","line":333,"range":{"start_line":333,"start_character":25,"end_line":333,"end_character":56},"updated":"2016-06-06 13:34:26.000000000","message":"Can you add a #NOTE that we rely on OVS lib functionality here (preferably with a link to a code and/or documentation that would tell that it is indeed sorted).","commit_id":"9eb14ced6a5193a8a87a01c2d8788488328beb6e"},{"author":{"_account_id":20378,"name":"Trevor McCasland","email":"TM2086@att.com","username":"twm2016"},"change_message_id":"25f74e34881229bb6f5576bb03f8947826158dee","unresolved":false,"context_lines":[{"line_number":330,"context_line":"            br \u003d idlutils.row_by_value(self.api.idl, \u0027Bridge\u0027, \u0027name\u0027,"},{"line_number":331,"context_line":"                                       self.bridge)"},{"line_number":332,"context_line":"            try:"},{"line_number":333,"context_line":"                idlutils.sorted_row_find(br.ports, port)"},{"line_number":334,"context_line":"            except ValueError:"},{"line_number":335,"context_line":"                if not self.if_exists:"},{"line_number":336,"context_line":"                    # TODO(twilson) Make real errors across implementations"}],"source_content_type":"text/x-python","patch_set":7,"id":"7aa08908_c7feaf6a","line":333,"range":{"start_line":333,"start_character":25,"end_line":333,"end_character":56},"in_reply_to":"7aa08908_4649285f","updated":"2016-06-06 14:34:14.000000000","message":"If you push another patch set, a note here would be nice too.","commit_id":"9eb14ced6a5193a8a87a01c2d8788488328beb6e"},{"author":{"_account_id":21273,"name":"Ilya Chukhnakov","email":"Ilya.chukhnakov@gmail.com","username":"ichukhnakov"},"change_message_id":"178fdc7618df3d232b439ef2275c440147b7462d","unresolved":false,"context_lines":[{"line_number":329,"context_line":"        if self.bridge:"},{"line_number":330,"context_line":"            br \u003d idlutils.row_by_value(self.api.idl, \u0027Bridge\u0027, \u0027name\u0027,"},{"line_number":331,"context_line":"                                       self.bridge)"},{"line_number":332,"context_line":"            try:"},{"line_number":333,"context_line":"                idlutils.sorted_row_find(br.ports, port)"},{"line_number":334,"context_line":"            except ValueError:"},{"line_number":335,"context_line":"                if not self.if_exists:"},{"line_number":336,"context_line":"                    # TODO(twilson) Make real errors across implementations"},{"line_number":337,"context_line":"                    msg \u003d _(\"Port %(port)s does not exist on %(bridge)s!\") % {"}],"source_content_type":"text/x-python","patch_set":7,"id":"7aa08908_a3ac41ee","line":334,"range":{"start_line":332,"start_character":12,"end_line":334,"end_character":30},"updated":"2016-06-06 13:34:26.000000000","message":"nit: I\u0027d rather use \u0027if not\u0027 here similar to L344 instead of \u0027try\u0027.","commit_id":"9eb14ced6a5193a8a87a01c2d8788488328beb6e"},{"author":{"_account_id":5756,"name":"Terry Wilson","email":"twilson@redhat.com","username":"otherwiseguy"},"change_message_id":"e0537db30b8d0fd41fb0b8afdbfdfe778c4155b2","unresolved":false,"context_lines":[{"line_number":329,"context_line":"        if self.bridge:"},{"line_number":330,"context_line":"            br \u003d idlutils.row_by_value(self.api.idl, \u0027Bridge\u0027, \u0027name\u0027,"},{"line_number":331,"context_line":"                                       self.bridge)"},{"line_number":332,"context_line":"            try:"},{"line_number":333,"context_line":"                idlutils.sorted_row_find(br.ports, port)"},{"line_number":334,"context_line":"            except ValueError:"},{"line_number":335,"context_line":"                if not self.if_exists:"},{"line_number":336,"context_line":"                    # TODO(twilson) Make real errors across implementations"},{"line_number":337,"context_line":"                    msg \u003d _(\"Port %(port)s does not exist on %(bridge)s!\") % {"}],"source_content_type":"text/x-python","patch_set":7,"id":"7aa08908_efe4670e","line":334,"range":{"start_line":332,"start_character":12,"end_line":334,"end_character":30},"in_reply_to":"7aa08908_a3ac41ee","updated":"2016-06-06 14:24:16.000000000","message":"I wouldn\u0027t. :) And in general Python encourages the \"Easier to ask for forgiveness than permission\" philosophy.","commit_id":"9eb14ced6a5193a8a87a01c2d8788488328beb6e"},{"author":{"_account_id":8655,"name":"Jakub Libosvar","email":"libosvar@redhat.com","username":"jlibosva"},"change_message_id":"f813ab7f07436d0fa1303ee24ecbfa01839c131a","unresolved":false,"context_lines":[{"line_number":329,"context_line":"        if self.bridge:"},{"line_number":330,"context_line":"            br \u003d idlutils.row_by_value(self.api.idl, \u0027Bridge\u0027, \u0027name\u0027,"},{"line_number":331,"context_line":"                                       self.bridge)"},{"line_number":332,"context_line":"            try:"},{"line_number":333,"context_line":"                idlutils.sorted_row_find(br.ports, port)"},{"line_number":334,"context_line":"            except ValueError:"},{"line_number":335,"context_line":"                if not self.if_exists:"},{"line_number":336,"context_line":"                    # TODO(twilson) Make real errors across implementations"},{"line_number":337,"context_line":"                    msg \u003d _(\"Port %(port)s does not exist on %(bridge)s!\") % {"}],"source_content_type":"text/x-python","patch_set":7,"id":"7aa08908_6f36b704","line":334,"range":{"start_line":332,"start_character":12,"end_line":334,"end_character":30},"in_reply_to":"7aa08908_a3ac41ee","updated":"2016-06-06 13:58:42.000000000","message":"Using \"if\" here is definitely not the python way. \nhttps://docs.python.org/2.7/glossary.html#term-eafp","commit_id":"9eb14ced6a5193a8a87a01c2d8788488328beb6e"},{"author":{"_account_id":21273,"name":"Ilya Chukhnakov","email":"Ilya.chukhnakov@gmail.com","username":"ichukhnakov"},"change_message_id":"3fb0c383bd7c99d6362679929ba86822344f7e98","unresolved":false,"context_lines":[{"line_number":329,"context_line":"        if self.bridge:"},{"line_number":330,"context_line":"            br \u003d idlutils.row_by_value(self.api.idl, \u0027Bridge\u0027, \u0027name\u0027,"},{"line_number":331,"context_line":"                                       self.bridge)"},{"line_number":332,"context_line":"            try:"},{"line_number":333,"context_line":"                idlutils.sorted_row_find(br.ports, port)"},{"line_number":334,"context_line":"            except ValueError:"},{"line_number":335,"context_line":"                if not self.if_exists:"},{"line_number":336,"context_line":"                    # TODO(twilson) Make real errors across implementations"},{"line_number":337,"context_line":"                    msg \u003d _(\"Port %(port)s does not exist on %(bridge)s!\") % {"}],"source_content_type":"text/x-python","patch_set":7,"id":"7aa08908_89d795ec","line":334,"range":{"start_line":332,"start_character":12,"end_line":334,"end_character":30},"in_reply_to":"7aa08908_efe4670e","updated":"2016-06-06 16:43:38.000000000","message":"That \u0027forgiveness/permission\u0027 philosophy would apply here if \u0027sorted_row_find\u0027 had side effects or returned a value into some variable. But here it is just an optimised \u0027port in br.ports\u0027 statement. Also consider that L333 and L344 do exactly the same thing but using different code paths. I find it inconsistent, but its just a \u0027nit\u0027 :)","commit_id":"9eb14ced6a5193a8a87a01c2d8788488328beb6e"}],"neutron/agent/ovsdb/native/idlutils.py":[{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"change_message_id":"eb1947065134ea1b52d1da9e7a65870ef3e85cc2","unresolved":false,"context_lines":[{"line_number":65,"context_line":"    i \u003d bisect.bisect_left(rows, match)"},{"line_number":66,"context_line":"    if i !\u003d len(rows) and rows[i] \u003d\u003d match:"},{"line_number":67,"context_line":"        return rows[i]"},{"line_number":68,"context_line":"    return None"},{"line_number":69,"context_line":""},{"line_number":70,"context_line":""},{"line_number":71,"context_line":"def row_by_record(idl_, table, record):"}],"source_content_type":"text/x-python","patch_set":1,"id":"bab6814e_e6621c3d","line":68,"updated":"2016-05-23 14:47:37.000000000","message":"you do not need this. by default a method returns None","commit_id":"a2886bdd73c8ebe1bce7486259e2d2d9b8c1ccfa"},{"author":{"_account_id":8655,"name":"Jakub Libosvar","email":"libosvar@redhat.com","username":"jlibosva"},"change_message_id":"ee91f9ba4db2be268c33487545fd064ce18326e5","unresolved":false,"context_lines":[{"line_number":61,"context_line":"    raise RowNotFound(table\u003dtable, col\u003dcolumn, match\u003dmatch)"},{"line_number":62,"context_line":""},{"line_number":63,"context_line":""},{"line_number":64,"context_line":"def sorted_row_find(rows, match):"},{"line_number":65,"context_line":"    i \u003d bisect.bisect_left(rows, match)"},{"line_number":66,"context_line":"    if i !\u003d len(rows) and rows[i] \u003d\u003d match:"},{"line_number":67,"context_line":"        return rows[i]"}],"source_content_type":"text/x-python","patch_set":2,"id":"9abb7d3a_6402900d","line":64,"range":{"start_line":64,"start_character":4,"end_line":64,"end_character":19},"updated":"2016-06-02 09:55:49.000000000","message":"Should we have a unittest to validate its functionality?","commit_id":"6d48af08af601b2941513403e9d1db6956964a9d"},{"author":{"_account_id":5756,"name":"Terry Wilson","email":"twilson@redhat.com","username":"otherwiseguy"},"change_message_id":"f3370220a7ca9eaac27c1f8fb96d67392f004f46","unresolved":false,"context_lines":[{"line_number":61,"context_line":"    raise RowNotFound(table\u003dtable, col\u003dcolumn, match\u003dmatch)"},{"line_number":62,"context_line":""},{"line_number":63,"context_line":""},{"line_number":64,"context_line":"def sorted_row_find(rows, match):"},{"line_number":65,"context_line":"    i \u003d bisect.bisect_left(rows, match)"},{"line_number":66,"context_line":"    if i !\u003d len(rows) and rows[i] \u003d\u003d match:"},{"line_number":67,"context_line":"        return rows[i]"}],"source_content_type":"text/x-python","patch_set":2,"id":"9abb7d3a_eafbd845","line":64,"range":{"start_line":64,"start_character":4,"end_line":64,"end_character":19},"in_reply_to":"9abb7d3a_6402900d","updated":"2016-06-02 15:17:02.000000000","message":"I rejected unit tests in a previous comment, but I guess since it is actually a real function that takes input and produces output, it would be a shame not to write one. :)","commit_id":"6d48af08af601b2941513403e9d1db6956964a9d"},{"author":{"_account_id":8655,"name":"Jakub Libosvar","email":"libosvar@redhat.com","username":"jlibosva"},"change_message_id":"268f074d663a7c18adb46051b67652d9f2223fed","unresolved":false,"context_lines":[{"line_number":63,"context_line":""},{"line_number":64,"context_line":"def sorted_row_find(rows, match):"},{"line_number":65,"context_line":"    i \u003d bisect.bisect_left(rows, match)"},{"line_number":66,"context_line":"    if i !\u003d len(rows) and rows[i] \u003d\u003d match:"},{"line_number":67,"context_line":"        return rows[i]"},{"line_number":68,"context_line":""},{"line_number":69,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"9abb7d3a_27a36051","line":66,"range":{"start_line":66,"start_character":7,"end_line":66,"end_character":21},"updated":"2016-06-02 13:09:16.000000000","message":"[","commit_id":"6d48af08af601b2941513403e9d1db6956964a9d"},{"author":{"_account_id":5756,"name":"Terry Wilson","email":"twilson@redhat.com","username":"otherwiseguy"},"change_message_id":"f3370220a7ca9eaac27c1f8fb96d67392f004f46","unresolved":false,"context_lines":[{"line_number":63,"context_line":""},{"line_number":64,"context_line":"def sorted_row_find(rows, match):"},{"line_number":65,"context_line":"    i \u003d bisect.bisect_left(rows, match)"},{"line_number":66,"context_line":"    if i !\u003d len(rows) and rows[i] \u003d\u003d match:"},{"line_number":67,"context_line":"        return rows[i]"},{"line_number":68,"context_line":""},{"line_number":69,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"9abb7d3a_8064ade5","line":66,"range":{"start_line":66,"start_character":7,"end_line":66,"end_character":21},"in_reply_to":"9abb7d3a_27a36051","updated":"2016-06-02 15:17:02.000000000","message":"eh?","commit_id":"6d48af08af601b2941513403e9d1db6956964a9d"},{"author":{"_account_id":8655,"name":"Jakub Libosvar","email":"libosvar@redhat.com","username":"jlibosva"},"change_message_id":"c7952daa5b796e57ba700941302bb48d3421da21","unresolved":false,"context_lines":[{"line_number":63,"context_line":""},{"line_number":64,"context_line":"def sorted_row_find(rows, match):"},{"line_number":65,"context_line":"    i \u003d bisect.bisect_left(rows, match)"},{"line_number":66,"context_line":"    if i !\u003d len(rows) and rows[i] \u003d\u003d match:"},{"line_number":67,"context_line":"        return rows[i]"},{"line_number":68,"context_line":""},{"line_number":69,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"9abb7d3a_59a47c07","line":66,"range":{"start_line":66,"start_character":7,"end_line":66,"end_character":21},"in_reply_to":"9abb7d3a_8064ade5","updated":"2016-06-02 15:23:30.000000000","message":"That\u0027s probably when I wanted to write something and then wanted to go to previous file - \"[\" shortcut but focus was still in the comment field and I missed that I wrote it. Sorry :)","commit_id":"6d48af08af601b2941513403e9d1db6956964a9d"},{"author":{"_account_id":20378,"name":"Trevor McCasland","email":"TM2086@att.com","username":"twm2016"},"change_message_id":"0ecf22e9aa79d17538e084f08833ea1086f19d01","unresolved":false,"context_lines":[{"line_number":62,"context_line":""},{"line_number":63,"context_line":""},{"line_number":64,"context_line":"def sorted_row_find(rows, match):"},{"line_number":65,"context_line":"    i \u003d bisect.bisect_left(rows, match)"},{"line_number":66,"context_line":"    if i !\u003d len(rows) and rows[i] \u003d\u003d match:"},{"line_number":67,"context_line":"        return rows[i]"},{"line_number":68,"context_line":""},{"line_number":69,"context_line":""},{"line_number":70,"context_line":"def row_by_record(idl_, table, record):"}],"source_content_type":"text/x-python","patch_set":2,"id":"bab6814e_54adce99","line":67,"range":{"start_line":65,"start_character":4,"end_line":67,"end_character":22},"updated":"2016-05-26 16:08:34.000000000","message":"Would it make more sense to wrap this in a try: except ValueError: to declare the object couldn\u0027t be found?","commit_id":"6d48af08af601b2941513403e9d1db6956964a9d"},{"author":{"_account_id":5756,"name":"Terry Wilson","email":"twilson@redhat.com","username":"otherwiseguy"},"change_message_id":"66f80f30411d5fe44ee120dc610dd567d67fc142","unresolved":false,"context_lines":[{"line_number":62,"context_line":""},{"line_number":63,"context_line":""},{"line_number":64,"context_line":"def sorted_row_find(rows, match):"},{"line_number":65,"context_line":"    i \u003d bisect.bisect_left(rows, match)"},{"line_number":66,"context_line":"    if i !\u003d len(rows) and rows[i] \u003d\u003d match:"},{"line_number":67,"context_line":"        return rows[i]"},{"line_number":68,"context_line":""},{"line_number":69,"context_line":""},{"line_number":70,"context_line":"def row_by_record(idl_, table, record):"}],"source_content_type":"text/x-python","patch_set":2,"id":"bab6814e_57add099","line":67,"range":{"start_line":65,"start_character":4,"end_line":67,"end_character":22},"in_reply_to":"bab6814e_54adce99","updated":"2016-05-26 16:15:58.000000000","message":"All of the usages are like (x for x in y if sorted_row_find()), throwing an Exception would make that unusable.","commit_id":"6d48af08af601b2941513403e9d1db6956964a9d"},{"author":{"_account_id":8655,"name":"Jakub Libosvar","email":"libosvar@redhat.com","username":"jlibosva"},"change_message_id":"91364932268c955fd16c75f3cea1456f34643b5a","unresolved":false,"context_lines":[{"line_number":65,"context_line":"    i \u003d bisect.bisect_left(rows, match)"},{"line_number":66,"context_line":"    if i !\u003d len(rows) and rows[i] \u003d\u003d match:"},{"line_number":67,"context_line":"        return rows[i]"},{"line_number":68,"context_line":""},{"line_number":69,"context_line":""},{"line_number":70,"context_line":"def row_by_record(idl_, table, record):"},{"line_number":71,"context_line":"    t \u003d idl_.tables[table]"}],"source_content_type":"text/x-python","patch_set":2,"id":"9abb7d3a_ea2f5d3c","line":68,"updated":"2016-06-02 13:15:21.000000000","message":"By my comment in previous file I meant whether following is missing:\n \n raise ValueError","commit_id":"6d48af08af601b2941513403e9d1db6956964a9d"},{"author":{"_account_id":5756,"name":"Terry Wilson","email":"twilson@redhat.com","username":"otherwiseguy"},"change_message_id":"f3370220a7ca9eaac27c1f8fb96d67392f004f46","unresolved":false,"context_lines":[{"line_number":65,"context_line":"    i \u003d bisect.bisect_left(rows, match)"},{"line_number":66,"context_line":"    if i !\u003d len(rows) and rows[i] \u003d\u003d match:"},{"line_number":67,"context_line":"        return rows[i]"},{"line_number":68,"context_line":""},{"line_number":69,"context_line":""},{"line_number":70,"context_line":"def row_by_record(idl_, table, record):"},{"line_number":71,"context_line":"    t \u003d idl_.tables[table]"}],"source_content_type":"text/x-python","patch_set":2,"id":"9abb7d3a_a0957189","line":68,"in_reply_to":"9abb7d3a_ea2f5d3c","updated":"2016-06-02 15:17:02.000000000","message":"I changed how this function worked at one point and didn\u0027t remember to change that usage. Thanks for catching my goof. :)","commit_id":"6d48af08af601b2941513403e9d1db6956964a9d"},{"author":{"_account_id":8655,"name":"Jakub Libosvar","email":"libosvar@redhat.com","username":"jlibosva"},"change_message_id":"8e8cad0131b16badf18c7a3891b53637ce21ded7","unresolved":false,"context_lines":[{"line_number":67,"context_line":"        return rows[i]"},{"line_number":68,"context_line":"    if default is not _NO_DEFAULT:"},{"line_number":69,"context_line":"        return default"},{"line_number":70,"context_line":"    raise ValueError(\"%s is not in %s\" % (i, rows.__class__.__name__))"},{"line_number":71,"context_line":""},{"line_number":72,"context_line":""},{"line_number":73,"context_line":"def row_by_record(idl_, table, record):"}],"source_content_type":"text/x-python","patch_set":5,"id":"9abb7d3a_834e6094","line":70,"range":{"start_line":70,"start_character":21,"end_line":70,"end_character":38},"updated":"2016-06-02 22:01:08.000000000","message":"Shouldn\u0027t we use _() from i18n here?","commit_id":"c018d1aa087ac7dd783748b0df8bda325b832208"},{"author":{"_account_id":8655,"name":"Jakub Libosvar","email":"libosvar@redhat.com","username":"jlibosva"},"change_message_id":"9ff8c99de460aad222be86563f4523d36ac71954","unresolved":false,"context_lines":[{"line_number":67,"context_line":"        return rows[i]"},{"line_number":68,"context_line":"    if default is not _NO_DEFAULT:"},{"line_number":69,"context_line":"        return default"},{"line_number":70,"context_line":"    raise ValueError(\"%s is not in %s\" % (i, rows.__class__.__name__))"},{"line_number":71,"context_line":""},{"line_number":72,"context_line":""},{"line_number":73,"context_line":"def row_by_record(idl_, table, record):"}],"source_content_type":"text/x-python","patch_set":5,"id":"9abb7d3a_33419e3a","line":70,"range":{"start_line":70,"start_character":21,"end_line":70,"end_character":38},"in_reply_to":"9abb7d3a_0309d031","updated":"2016-06-03 13:45:05.000000000","message":"I\u0027m not really sure here but I saw translations on several places in exceptions in Neutron. http://docs.openstack.org/developer/hacking/#internationalization-i18n-strings doesn\u0027t explicitly say we should do the translation.","commit_id":"c018d1aa087ac7dd783748b0df8bda325b832208"},{"author":{"_account_id":20378,"name":"Trevor McCasland","email":"TM2086@att.com","username":"twm2016"},"change_message_id":"723d1a2d56df5017de0058cc5420e6bc93c4b2c4","unresolved":false,"context_lines":[{"line_number":67,"context_line":"        return rows[i]"},{"line_number":68,"context_line":"    if default is not _NO_DEFAULT:"},{"line_number":69,"context_line":"        return default"},{"line_number":70,"context_line":"    raise ValueError(\"%s is not in %s\" % (i, rows.__class__.__name__))"},{"line_number":71,"context_line":""},{"line_number":72,"context_line":""},{"line_number":73,"context_line":"def row_by_record(idl_, table, record):"}],"source_content_type":"text/x-python","patch_set":5,"id":"9abb7d3a_6c4dfb98","line":70,"range":{"start_line":70,"start_character":21,"end_line":70,"end_character":38},"in_reply_to":"9abb7d3a_33419e3a","updated":"2016-06-03 15:38:58.000000000","message":"You can see in this file that they do translate exceptions so to match the style of the rest of the file, we should include _() from _i18n. get_schema_helper and row_by_record for example use it.","commit_id":"c018d1aa087ac7dd783748b0df8bda325b832208"},{"author":{"_account_id":5756,"name":"Terry Wilson","email":"twilson@redhat.com","username":"otherwiseguy"},"change_message_id":"ca973af9dc7d6f615b52f9f3c58459653fd8e92c","unresolved":false,"context_lines":[{"line_number":67,"context_line":"        return rows[i]"},{"line_number":68,"context_line":"    if default is not _NO_DEFAULT:"},{"line_number":69,"context_line":"        return default"},{"line_number":70,"context_line":"    raise ValueError(\"%s is not in %s\" % (i, rows.__class__.__name__))"},{"line_number":71,"context_line":""},{"line_number":72,"context_line":""},{"line_number":73,"context_line":"def row_by_record(idl_, table, record):"}],"source_content_type":"text/x-python","patch_set":5,"id":"9abb7d3a_0c470a4c","line":70,"range":{"start_line":70,"start_character":21,"end_line":70,"end_character":38},"in_reply_to":"9abb7d3a_6c4dfb98","updated":"2016-06-03 16:33:18.000000000","message":"Then I shall make sure that the words \"is not in\" get translated. I don\u0027t think Python itself translates them when it throws the same ValueError for list.index (https://github.com/python/cpython/blob/2.7/Objects/listobject.c#L2305), but I am happy to be better than cpython.","commit_id":"c018d1aa087ac7dd783748b0df8bda325b832208"},{"author":{"_account_id":5756,"name":"Terry Wilson","email":"twilson@redhat.com","username":"otherwiseguy"},"change_message_id":"0ae6cc9ed3828af5193cc83063f0e16a384e0c2e","unresolved":false,"context_lines":[{"line_number":67,"context_line":"        return rows[i]"},{"line_number":68,"context_line":"    if default is not _NO_DEFAULT:"},{"line_number":69,"context_line":"        return default"},{"line_number":70,"context_line":"    raise ValueError(\"%s is not in %s\" % (i, rows.__class__.__name__))"},{"line_number":71,"context_line":""},{"line_number":72,"context_line":""},{"line_number":73,"context_line":"def row_by_record(idl_, table, record):"}],"source_content_type":"text/x-python","patch_set":5,"id":"9abb7d3a_0309d031","line":70,"range":{"start_line":70,"start_character":21,"end_line":70,"end_character":38},"in_reply_to":"9abb7d3a_834e6094","updated":"2016-06-02 22:02:36.000000000","message":"For Exceptions? I didn\u0027t think we translated exceptions?","commit_id":"c018d1aa087ac7dd783748b0df8bda325b832208"},{"author":{"_account_id":8655,"name":"Jakub Libosvar","email":"libosvar@redhat.com","username":"jlibosva"},"change_message_id":"e255920d85a7433ce4a3c5a733e97c14d39405c4","unresolved":false,"context_lines":[{"line_number":67,"context_line":"        return rows[i]"},{"line_number":68,"context_line":"    if default is not _NO_DEFAULT:"},{"line_number":69,"context_line":"        return default"},{"line_number":70,"context_line":"    raise ValueError(_(\"%(match)s is not in %(cls)s\" % {"},{"line_number":71,"context_line":"        \"match\": match, \"cls\": rows.__class__.__name__}))"},{"line_number":72,"context_line":""},{"line_number":73,"context_line":""}],"source_content_type":"text/x-python","patch_set":6,"id":"9abb7d3a_f189b7cb","line":70,"range":{"start_line":70,"start_character":21,"end_line":70,"end_character":52},"updated":"2016-06-03 18:50:31.000000000","message":"I can swear that when I run pep8 job locally, I get error that formatting should be done outside of translation function.\n\n _(\u003cmessage\u003e) % params","commit_id":"3f8ecb1f6bed711e629f21740f7f61acd96bac2d"},{"author":{"_account_id":20378,"name":"Trevor McCasland","email":"TM2086@att.com","username":"twm2016"},"change_message_id":"15e5ce5fcc18449a3a700598053b073d1477e494","unresolved":false,"context_lines":[{"line_number":67,"context_line":"        return rows[i]"},{"line_number":68,"context_line":"    if default is not _NO_DEFAULT:"},{"line_number":69,"context_line":"        return default"},{"line_number":70,"context_line":"    raise ValueError(_(\"%(match)s is not in %(cls)s\" % {"},{"line_number":71,"context_line":"        \"match\": match, \"cls\": rows.__class__.__name__}))"},{"line_number":72,"context_line":""},{"line_number":73,"context_line":""}],"source_content_type":"text/x-python","patch_set":6,"id":"9abb7d3a_d56d7e33","line":70,"range":{"start_line":70,"start_character":21,"end_line":70,"end_character":52},"in_reply_to":"9abb7d3a_f189b7cb","updated":"2016-06-03 19:11:49.000000000","message":"Hmm yeah it\u0027s weird that it passed the tests but does anyone know what the difference is? I guess if match and cls are not translatable then they are ignored? The get_schema_helper function has an example on how Jakub is suggesting on how to do it.","commit_id":"3f8ecb1f6bed711e629f21740f7f61acd96bac2d"}],"neutron/tests/functional/agent/test_ovs_lib.py":[{"author":{"_account_id":21273,"name":"Ilya Chukhnakov","email":"Ilya.chukhnakov@gmail.com","username":"ichukhnakov"},"change_message_id":"178fdc7618df3d232b439ef2275c440147b7462d","unresolved":false,"context_lines":[{"line_number":345,"context_line":"                txn.add(ovsdb.add_port(self.br.br_name, pname))"},{"line_number":346,"context_line":"                txn.add(ovsdb.db_set(\"Interface\", pname, (\u0027type\u0027, \u0027internal\u0027)))"},{"line_number":347,"context_line":"        self.assertEqual(set(pnames), set(self.br.get_port_name_list()))"},{"line_number":348,"context_line":"        self.br.delete_port(pnames[5])"},{"line_number":349,"context_line":"        pnames.remove(pnames[5])"},{"line_number":350,"context_line":"        self.assertEqual(set(pnames), set(self.br.get_port_name_list()))"},{"line_number":351,"context_line":""},{"line_number":352,"context_line":""}],"source_content_type":"text/x-python","patch_set":7,"id":"7aa08908_a3ad6133","line":349,"range":{"start_line":348,"start_character":28,"end_line":349,"end_character":32},"updated":"2016-06-06 13:34:26.000000000","message":"nit: that could be replaced with \u0027delete_port(pnames.pop(5))\u0027","commit_id":"9eb14ced6a5193a8a87a01c2d8788488328beb6e"},{"author":{"_account_id":5756,"name":"Terry Wilson","email":"twilson@redhat.com","username":"otherwiseguy"},"change_message_id":"e0537db30b8d0fd41fb0b8afdbfdfe778c4155b2","unresolved":false,"context_lines":[{"line_number":345,"context_line":"                txn.add(ovsdb.add_port(self.br.br_name, pname))"},{"line_number":346,"context_line":"                txn.add(ovsdb.db_set(\"Interface\", pname, (\u0027type\u0027, \u0027internal\u0027)))"},{"line_number":347,"context_line":"        self.assertEqual(set(pnames), set(self.br.get_port_name_list()))"},{"line_number":348,"context_line":"        self.br.delete_port(pnames[5])"},{"line_number":349,"context_line":"        pnames.remove(pnames[5])"},{"line_number":350,"context_line":"        self.assertEqual(set(pnames), set(self.br.get_port_name_list()))"},{"line_number":351,"context_line":""},{"line_number":352,"context_line":""}],"source_content_type":"text/x-python","patch_set":7,"id":"7aa08908_2ff02f90","line":349,"range":{"start_line":348,"start_character":28,"end_line":349,"end_character":32},"in_reply_to":"7aa08908_a3ad6133","updated":"2016-06-06 14:24:16.000000000","message":"Good point. If, for some reason I have to spin another version, I\u0027ll change this.","commit_id":"9eb14ced6a5193a8a87a01c2d8788488328beb6e"}]}
