)]}'
{"nova/hacking/checks.py":[{"author":{"_account_id":679,"name":"Kevin L. Mitchell","email":"klmitch@mit.edu","username":"klmitch"},"change_message_id":"b62431f3beca4e189654099e29a62137b7ce310e","unresolved":false,"context_lines":[{"line_number":577,"context_line":""},{"line_number":578,"context_line":""},{"line_number":579,"context_line":"def check_python3_no_iteritems(logical_line):"},{"line_number":580,"context_line":"    msg \u003d (\"N343: Use six.iteritems() instead of dict.iteritems().\")"},{"line_number":581,"context_line":""},{"line_number":582,"context_line":"    if re.search(r\".*\\.iteritems\\(\\)\", logical_line):"},{"line_number":583,"context_line":"        yield(0, msg)"}],"source_content_type":"text/x-python","patch_set":1,"id":"da6ed579_19a91c24","line":580,"range":{"start_line":580,"start_character":54,"end_line":580,"end_character":63},"updated":"2016-01-15 19:25:28.000000000","message":"This could also check iterkeys() and itervalues().","commit_id":"92212145138cab4f14fb345f5cdbbb77cf99e319"},{"author":{"_account_id":679,"name":"Kevin L. Mitchell","email":"klmitch@mit.edu","username":"klmitch"},"change_message_id":"c94139e8cd0b0b4423f83600568c36bee19ec669","unresolved":false,"context_lines":[{"line_number":577,"context_line":""},{"line_number":578,"context_line":""},{"line_number":579,"context_line":"def check_python3_no_iteritems(logical_line):"},{"line_number":580,"context_line":"    msg \u003d (\"N343: Use six.iteritems() instead of dict.iteritems().\")"},{"line_number":581,"context_line":""},{"line_number":582,"context_line":"    if re.search(r\".*\\.iteritems\\(\\)\", logical_line):"},{"line_number":583,"context_line":"        yield(0, msg)"}],"source_content_type":"text/x-python","patch_set":5,"id":"9a68dd71_16a46b55","line":580,"range":{"start_line":580,"start_character":10,"end_line":580,"end_character":11},"updated":"2016-01-20 19:36:05.000000000","message":"attonit: Since you\u0027re not breaking the string across lines, the parentheses aren\u0027t required.  No big deal, I just wanted to point it out.","commit_id":"2431f651830ee5299545f3fffc069d50e7fe6005"}],"nova/tests/unit/db/test_db_api.py":[{"author":{"_account_id":679,"name":"Kevin L. Mitchell","email":"klmitch@mit.edu","username":"klmitch"},"change_message_id":"b62431f3beca4e189654099e29a62137b7ce310e","unresolved":false,"context_lines":[{"line_number":1515,"context_line":"        if isinstance(obj, dict):"},{"line_number":1516,"context_line":"            obj_items \u003d obj.items()"},{"line_number":1517,"context_line":"        else:"},{"line_number":1518,"context_line":"            obj_items \u003d six.iteritems(obj)"},{"line_number":1519,"context_line":"        return {k: v for k, v in obj_items"},{"line_number":1520,"context_line":"                if k not in ignored_keys}"},{"line_number":1521,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"da6ed579_49958186","line":1518,"updated":"2016-01-15 19:25:28.000000000","message":"1. Is there any need at all to use iteritems here?\n\n2. We are guaranteed that \"obj\" is *not* a dict here, due to the test in line 1515, so that means that the original code was explicitly designed to call the \"iteritems()\" method on some non-dict object.  Thus, this change could actually break tests under Python 3, rather than fixing them, as the underlying six code returns the result of \"iter(obj.items())\" for Python 3.  There\u0027s got to be *some* reason that iteritems() was wanted in this case…and if there isn\u0027t, then the entire \u0027if\u0027 should be removed and we should go with just line 1516, or even update 1519 to use obj.items() directly.","commit_id":"92212145138cab4f14fb345f5cdbbb77cf99e319"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"ddcd55c95760239ad00b398e2ee6330ca8d461c1","unresolved":false,"context_lines":[{"line_number":1515,"context_line":"        if isinstance(obj, dict):"},{"line_number":1516,"context_line":"            obj_items \u003d obj.items()"},{"line_number":1517,"context_line":"        else:"},{"line_number":1518,"context_line":"            obj_items \u003d six.iteritems(obj)"},{"line_number":1519,"context_line":"        return {k: v for k, v in obj_items"},{"line_number":1520,"context_line":"                if k not in ignored_keys}"},{"line_number":1521,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"da6ed579_e8f0b9cb","line":1518,"in_reply_to":"da6ed579_49958186","updated":"2016-01-18 09:23:08.000000000","message":"Hi Kevin,\n\nIMO there is no need of using iteritems here, as per your point 2 we can directly use obj.items here. I have verified that obj can either be dict or instance of nova.db.sqlalchemy.models.\u003cClass\u003e and both have items method. \n\nI will do these changes and upload new patch set asap.","commit_id":"92212145138cab4f14fb345f5cdbbb77cf99e319"},{"author":{"_account_id":679,"name":"Kevin L. Mitchell","email":"klmitch@mit.edu","username":"klmitch"},"change_message_id":"74516d1e13fb5dc9156d42d6107c2317634ee542","unresolved":false,"context_lines":[{"line_number":7355,"context_line":"        service_data[\u0027host\u0027] \u003d \u0027host2\u0027"},{"line_number":7356,"context_line":"        service \u003d db.service_create(self.ctxt, service_data)"},{"line_number":7357,"context_line":""},{"line_number":7358,"context_line":"        existing_node \u003d dict(six.iteritems(self.item))"},{"line_number":7359,"context_line":"        expected \u003d [existing_node]"},{"line_number":7360,"context_line":""},{"line_number":7361,"context_line":"        for name in [\u0027bm_node1\u0027, \u0027bm_node2\u0027]:"}],"source_content_type":"text/x-python","patch_set":2,"id":"ba63e191_321d0d67","line":7358,"updated":"2016-01-18 19:40:35.000000000","message":"This could probably also be converted to just:\n\n    dict(self.item.items())","commit_id":"eb8bd4426f3533c801ca8448e61b84798e1b9baf"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"33aa8e69b24a6ecc0036cdff1fee86b0ff4c20bf","unresolved":false,"context_lines":[{"line_number":7355,"context_line":"        service_data[\u0027host\u0027] \u003d \u0027host2\u0027"},{"line_number":7356,"context_line":"        service \u003d db.service_create(self.ctxt, service_data)"},{"line_number":7357,"context_line":""},{"line_number":7358,"context_line":"        existing_node \u003d dict(six.iteritems(self.item))"},{"line_number":7359,"context_line":"        expected \u003d [existing_node]"},{"line_number":7360,"context_line":""},{"line_number":7361,"context_line":"        for name in [\u0027bm_node1\u0027, \u0027bm_node2\u0027]:"}],"source_content_type":"text/x-python","patch_set":2,"id":"ba63e191_1040ef55","line":7358,"in_reply_to":"ba63e191_321d0d67","updated":"2016-01-19 06:03:14.000000000","message":"Done","commit_id":"eb8bd4426f3533c801ca8448e61b84798e1b9baf"}],"nova/tests/unit/test_hacking.py":[{"author":{"_account_id":679,"name":"Kevin L. Mitchell","email":"klmitch@mit.edu","username":"klmitch"},"change_message_id":"c94139e8cd0b0b4423f83600568c36bee19ec669","unresolved":false,"context_lines":[{"line_number":630,"context_line":"                                expected_errors\u003derrors)"},{"line_number":631,"context_line":""},{"line_number":632,"context_line":"    def test_dict_iteritems(self):"},{"line_number":633,"context_line":"        self.assertEqual(1, len(list(checks.check_python3_no_iteritems("},{"line_number":634,"context_line":"            \"obj.iteritems()\"))))"},{"line_number":635,"context_line":""},{"line_number":636,"context_line":"        self.assertEqual(0, len(list(checks.check_python3_no_iteritems("},{"line_number":637,"context_line":"            \"six.iteritems(ob))\"))))"}],"source_content_type":"text/x-python","patch_set":5,"id":"9a68dd71_714b715a","line":634,"range":{"start_line":633,"start_character":0,"end_line":634,"end_character":33},"updated":"2016-01-20 19:36:05.000000000","message":"Hmmm…this has precedent—some tests toward the beginning use this sort of idiom—but I do wonder whether this could use the _assert_has_errors() and _assert_has_no_errors() methods, as are used in test_check_config_option_in_central_place()…","commit_id":"2431f651830ee5299545f3fffc069d50e7fe6005"}]}
