)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":1131,"name":"Brian Haley","email":"haleyb.dev@gmail.com","username":"brian-haley"},"change_message_id":"f4e9db891f35264d7573d56a4ea9e083f94b6d48","unresolved":false,"context_lines":[{"line_number":9,"context_line":"As the number of ports per default security group increases, the number of iptable entries in the CN increases."},{"line_number":10,"context_line":"Because of this, there is a gradual increase in the time taken to apply rules/chains related new ports."},{"line_number":11,"context_line":"Currently we are using list comprehensions to find if a new rule/chain to apply, matches with any existing rule/chain."},{"line_number":12,"context_line":"Instead of using list comprehensions, if we walk through the list and break when we find the required element, we save on the number of iterations."},{"line_number":13,"context_line":""},{"line_number":14,"context_line":"Added a new method _iterate_and_find to return the element we are searching for."},{"line_number":15,"context_line":""}],"source_content_type":"text/x-gerrit-commit-message","patch_set":3,"id":"AAAAVn%2F%2Fmtc%3D","line":12,"updated":"2014-03-05 04:11:39.000000000","message":"These lines are all too long","commit_id":"54bbbebb8e32cb0e781d572631e42e05aadb0f8c"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"ad6ee24c181a2b7623a05f22360cbdc7d8b18b7e","unresolved":false,"context_lines":[{"line_number":18,"context_line":"searching for."},{"line_number":19,"context_line":""},{"line_number":20,"context_line":"Change-Id: I3585479ffa00be556b8b21dc9dbd6b36ad37f4de"},{"line_number":21,"context_line":"Closes-Bug: #1253993"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":5,"id":"AAAAWH%2F%2Bb3M%3D","line":21,"updated":"2014-03-26 19:44:44.000000000","message":"This should probably be Related-Bug: #1253993\n\nI\u0027d file a new bug (or enhancement) for this performance enhancement and link this to the new bug.","commit_id":"d033fb6e5388dbeaaa42456991c8d4ff6ecaa9dd"},{"author":{"_account_id":1131,"name":"Brian Haley","email":"haleyb.dev@gmail.com","username":"brian-haley"},"change_message_id":"2bd14abd200b00eaece5c2de52fc52ec24f88c84","unresolved":false,"context_lines":[{"line_number":18,"context_line":"searching for."},{"line_number":19,"context_line":""},{"line_number":20,"context_line":"Change-Id: I3585479ffa00be556b8b21dc9dbd6b36ad37f4de"},{"line_number":21,"context_line":"Closes-Bug: #1253993"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":5,"id":"AAAAWH%2F9gzk%3D","line":21,"in_reply_to":"AAAAWH%2F%2Bb3M%3D","updated":"2014-04-04 01:25:57.000000000","message":"Done","commit_id":"d033fb6e5388dbeaaa42456991c8d4ff6ecaa9dd"}],"neutron/agent/linux/iptables_manager.py":[{"author":{"_account_id":1131,"name":"Brian Haley","email":"haleyb.dev@gmail.com","username":"brian-haley"},"change_message_id":"f4e9db891f35264d7573d56a4ea9e083f94b6d48","unresolved":false,"context_lines":[{"line_number":429,"context_line":""},{"line_number":430,"context_line":"        return rules_index"},{"line_number":431,"context_line":""},{"line_number":432,"context_line":"    def _iterate_and_find(self, filter_list, rule_str):"},{"line_number":433,"context_line":"        res_filter \u003d []"},{"line_number":434,"context_line":"        filter_list.reverse()"},{"line_number":435,"context_line":"        for s in filter_list:"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAAVn%2F%2Fm7k%3D","line":432,"updated":"2014-03-05 04:11:39.000000000","message":"should make rule_str more generic, maybe match_str?","commit_id":"54bbbebb8e32cb0e781d572631e42e05aadb0f8c"},{"author":{"_account_id":1131,"name":"Brian Haley","email":"haleyb.dev@gmail.com","username":"brian-haley"},"change_message_id":"f4e9db891f35264d7573d56a4ea9e083f94b6d48","unresolved":false,"context_lines":[{"line_number":437,"context_line":"                res_filter \u003d [s]"},{"line_number":438,"context_line":"                break"},{"line_number":439,"context_line":"        filter_list.reverse()"},{"line_number":440,"context_line":"        return res_filter"},{"line_number":441,"context_line":""},{"line_number":442,"context_line":"    def _modify_rules(self, current_lines, table, table_name):"},{"line_number":443,"context_line":"        unwrapped_chains \u003d table.unwrapped_chains"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAAVn%2F%2Fm7s%3D","line":440,"updated":"2014-03-05 04:11:39.000000000","message":"This loop can be simplified, and you can use reversed() instead.  Also, since we only care about a single line you don\u0027t need to return an array.","commit_id":"54bbbebb8e32cb0e781d572631e42e05aadb0f8c"},{"author":{"_account_id":1131,"name":"Brian Haley","email":"haleyb.dev@gmail.com","username":"brian-haley"},"change_message_id":"f4e9db891f35264d7573d56a4ea9e083f94b6d48","unresolved":false,"context_lines":[{"line_number":472,"context_line":"            chain_str \u003d str(chain).strip()"},{"line_number":473,"context_line":""},{"line_number":474,"context_line":"           # orig_filter \u003d [s for s in old_filter if chain_str in s.strip()]"},{"line_number":475,"context_line":"           # dup_filter \u003d [s for s in new_filter if chain_str in s.strip()]"},{"line_number":476,"context_line":"            orig_filter \u003d self._iterate_and_find(old_filter, chain_str)"},{"line_number":477,"context_line":"            if not orig_filter:"},{"line_number":478,"context_line":"                dup_filter \u003d self._iterate_and_find(new_filter, chain_str)"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAAVn%2F%2Fm6M%3D","line":475,"updated":"2014-03-05 04:11:39.000000000","message":"You can remove these two lines","commit_id":"54bbbebb8e32cb0e781d572631e42e05aadb0f8c"},{"author":{"_account_id":1131,"name":"Brian Haley","email":"haleyb.dev@gmail.com","username":"brian-haley"},"change_message_id":"f4e9db891f35264d7573d56a4ea9e083f94b6d48","unresolved":false,"context_lines":[{"line_number":481,"context_line":"            # if no old or duplicates, use original chain"},{"line_number":482,"context_line":"            if orig_filter:"},{"line_number":483,"context_line":"                # grab the last entry, if there is one"},{"line_number":484,"context_line":"                old \u003d orig_filter[-1]"},{"line_number":485,"context_line":"                chain_str \u003d str(old).strip()"},{"line_number":486,"context_line":"            elif dup_filter:"},{"line_number":487,"context_line":"                # grab the last entry, if there is one"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAAVn%2F%2Fm5s%3D","line":484,"updated":"2014-03-05 04:11:39.000000000","message":"_iterate_and _find() will only return a single entry, so this can be simplified.","commit_id":"54bbbebb8e32cb0e781d572631e42e05aadb0f8c"},{"author":{"_account_id":1131,"name":"Brian Haley","email":"haleyb.dev@gmail.com","username":"brian-haley"},"change_message_id":"f4e9db891f35264d7573d56a4ea9e083f94b6d48","unresolved":false,"context_lines":[{"line_number":503,"context_line":"            # list, so here we remove the dupes ahead of time."},{"line_number":504,"context_line":""},{"line_number":505,"context_line":"            #orig_filter \u003d [s for s in old_filter if rule_str in s.strip()]"},{"line_number":506,"context_line":"            #dup_filter \u003d [s for s in new_filter if rule_str in s.strip()]"},{"line_number":507,"context_line":"            orig_filter \u003d self._iterate_and_find(old_filter, rule_str)"},{"line_number":508,"context_line":"            if not orig_filter:"},{"line_number":509,"context_line":"                dup_filter \u003d self._iterate_and_find(new_filter, rule_str)"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAAVn%2F%2Fmww%3D","line":506,"updated":"2014-03-05 04:11:39.000000000","message":"All the same comments here as above.","commit_id":"54bbbebb8e32cb0e781d572631e42e05aadb0f8c"},{"author":{"_account_id":2592,"name":"Mark McClain","email":"mark@mcclain.xyz","username":"markmcclain"},"change_message_id":"4600219161e32cbf5e9028e30e73e65cc941a7f3","unresolved":false,"context_lines":[{"line_number":433,"context_line":"        # find a matching entry, starting from the bottom"},{"line_number":434,"context_line":"        for s in reversed(filter_list):"},{"line_number":435,"context_line":"            if match_str in s.strip():"},{"line_number":436,"context_line":"                return s"},{"line_number":437,"context_line":"        return None"},{"line_number":438,"context_line":""},{"line_number":439,"context_line":"    def _modify_rules(self, current_lines, table, table_name):"}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAAVn%2F%2FBnY%3D","line":436,"updated":"2014-03-10 16:09:36.000000000","message":"return strip()\n\nSeems like we should call() here instead of passing the burden to the caller.  This should remove several or the strip() calls later in the code.","commit_id":"9d11b2243f21e19fe9d29e654141a5a52991052a"},{"author":{"_account_id":2592,"name":"Mark McClain","email":"mark@mcclain.xyz","username":"markmcclain"},"change_message_id":"4600219161e32cbf5e9028e30e73e65cc941a7f3","unresolved":false,"context_lines":[{"line_number":434,"context_line":"        for s in reversed(filter_list):"},{"line_number":435,"context_line":"            if match_str in s.strip():"},{"line_number":436,"context_line":"                return s"},{"line_number":437,"context_line":"        return None"},{"line_number":438,"context_line":""},{"line_number":439,"context_line":"    def _modify_rules(self, current_lines, table, table_name):"},{"line_number":440,"context_line":"        unwrapped_chains \u003d table.unwrapped_chains"}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAAVn%2F%2FBr4%3D","line":437,"updated":"2014-03-10 16:09:36.000000000","message":"return","commit_id":"9d11b2243f21e19fe9d29e654141a5a52991052a"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"90f35700d849e8b4fed0c3ead920122a94c78fd8","unresolved":false,"context_lines":[{"line_number":462,"context_line":"            chain_str \u003d str(chain).strip()"},{"line_number":463,"context_line":""},{"line_number":464,"context_line":"            orig_filter \u003d [s for s in old_filter if chain_str in s.strip()]"},{"line_number":465,"context_line":"            dup_filter \u003d [s for s in new_filter if chain_str in s.strip()]"},{"line_number":466,"context_line":"            new_filter \u003d [s for s in new_filter if chain_str not in s.strip()]"},{"line_number":467,"context_line":""},{"line_number":468,"context_line":"            # if no old or duplicates, use original chain"}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAAWH%2F%2BigI%3D","side":"PARENT","line":465,"updated":"2014-03-26 03:26:29.000000000","message":"Won\u0027t the same optimization be achieved by wrapping old_filter and new_filter with reversed() and taking the first entry below instead of the last.  It would be a much easier change to review and less risk.  Just a thought.","commit_id":"fc766b661053740847070ea9e7d379cfcd135edd"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"539a6507eb4c47124220b7b3483d3f6eff05ed50","unresolved":false,"context_lines":[{"line_number":462,"context_line":"            chain_str \u003d str(chain).strip()"},{"line_number":463,"context_line":""},{"line_number":464,"context_line":"            orig_filter \u003d [s for s in old_filter if chain_str in s.strip()]"},{"line_number":465,"context_line":"            dup_filter \u003d [s for s in new_filter if chain_str in s.strip()]"},{"line_number":466,"context_line":"            new_filter \u003d [s for s in new_filter if chain_str not in s.strip()]"},{"line_number":467,"context_line":""},{"line_number":468,"context_line":"            # if no old or duplicates, use original chain"}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAAWH%2F%2Bb4g%3D","side":"PARENT","line":465,"in_reply_to":"AAAAWH%2F%2BhZc%3D","updated":"2014-03-26 19:42:33.000000000","message":"Right, I fell in to the trap of thinking that a list comprehension is implemented like a generator and doesn\u0027t actually create a list.  I stand corrected.","commit_id":"fc766b661053740847070ea9e7d379cfcd135edd"},{"author":{"_account_id":10571,"name":"Sudhakar","username":"Sudhakar","inactive":true},"change_message_id":"ec970156c293ae96aaba5307810f7ada24111943","unresolved":false,"context_lines":[{"line_number":462,"context_line":"            chain_str \u003d str(chain).strip()"},{"line_number":463,"context_line":""},{"line_number":464,"context_line":"            orig_filter \u003d [s for s in old_filter if chain_str in s.strip()]"},{"line_number":465,"context_line":"            dup_filter \u003d [s for s in new_filter if chain_str in s.strip()]"},{"line_number":466,"context_line":"            new_filter \u003d [s for s in new_filter if chain_str not in s.strip()]"},{"line_number":467,"context_line":""},{"line_number":468,"context_line":"            # if no old or duplicates, use original chain"}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAAWH%2F%2BhZc%3D","side":"PARENT","line":465,"in_reply_to":"AAAAWH%2F%2BigI%3D","updated":"2014-03-26 16:15:36.000000000","message":"Thanks for reviewing Carl.\nNo , that wouldnt be the same. The whole point of moving out of list comprehensions is to stop iteration as soon as we find the required element. reversing the list is required to fetch the latest entry in the list. \nI verified the time it takes to search a huge list (with more than 40k entries) in both approaches and list comprehensions take significantly more time than the proposed new approach.","commit_id":"fc766b661053740847070ea9e7d379cfcd135edd"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"90f35700d849e8b4fed0c3ead920122a94c78fd8","unresolved":false,"context_lines":[{"line_number":490,"context_line":"            # list, so here we remove the dupes ahead of time."},{"line_number":491,"context_line":""},{"line_number":492,"context_line":"            orig_filter \u003d [s for s in old_filter if rule_str in s.strip()]"},{"line_number":493,"context_line":"            dup_filter \u003d [s for s in new_filter if rule_str in s.strip()]"},{"line_number":494,"context_line":"            new_filter \u003d [s for s in new_filter if rule_str not in s.strip()]"},{"line_number":495,"context_line":""},{"line_number":496,"context_line":"            # if no old or duplicates, use original rule"}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAAWH%2F%2Bifo%3D","side":"PARENT","line":493,"updated":"2014-03-26 03:26:29.000000000","message":"Same comment here.","commit_id":"fc766b661053740847070ea9e7d379cfcd135edd"},{"author":{"_account_id":10571,"name":"Sudhakar","username":"Sudhakar","inactive":true},"change_message_id":"ec970156c293ae96aaba5307810f7ada24111943","unresolved":false,"context_lines":[{"line_number":490,"context_line":"            # list, so here we remove the dupes ahead of time."},{"line_number":491,"context_line":""},{"line_number":492,"context_line":"            orig_filter \u003d [s for s in old_filter if rule_str in s.strip()]"},{"line_number":493,"context_line":"            dup_filter \u003d [s for s in new_filter if rule_str in s.strip()]"},{"line_number":494,"context_line":"            new_filter \u003d [s for s in new_filter if rule_str not in s.strip()]"},{"line_number":495,"context_line":""},{"line_number":496,"context_line":"            # if no old or duplicates, use original rule"}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAAWH%2F%2BhaA%3D","side":"PARENT","line":493,"in_reply_to":"AAAAWH%2F%2Bifo%3D","updated":"2014-03-26 16:15:36.000000000","message":"Same response as above.","commit_id":"fc766b661053740847070ea9e7d379cfcd135edd"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"90f35700d849e8b4fed0c3ead920122a94c78fd8","unresolved":false,"context_lines":[{"line_number":433,"context_line":"        # find a matching entry, starting from the bottom"},{"line_number":434,"context_line":"        for s in reversed(filter_list):"},{"line_number":435,"context_line":"            if match_str in s.strip():"},{"line_number":436,"context_line":"                return s.strip()"},{"line_number":437,"context_line":""},{"line_number":438,"context_line":"    def _modify_rules(self, current_lines, table, table_name):"},{"line_number":439,"context_line":"        unwrapped_chains \u003d table.unwrapped_chains"}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAAWH%2F%2BilA%3D","line":436,"updated":"2014-03-26 03:26:29.000000000","message":"nit:  strip once.","commit_id":"d033fb6e5388dbeaaa42456991c8d4ff6ecaa9dd"},{"author":{"_account_id":1131,"name":"Brian Haley","email":"haleyb.dev@gmail.com","username":"brian-haley"},"change_message_id":"2bd14abd200b00eaece5c2de52fc52ec24f88c84","unresolved":false,"context_lines":[{"line_number":433,"context_line":"        # find a matching entry, starting from the bottom"},{"line_number":434,"context_line":"        for s in reversed(filter_list):"},{"line_number":435,"context_line":"            if match_str in s.strip():"},{"line_number":436,"context_line":"                return s.strip()"},{"line_number":437,"context_line":""},{"line_number":438,"context_line":"    def _modify_rules(self, current_lines, table, table_name):"},{"line_number":439,"context_line":"        unwrapped_chains \u003d table.unwrapped_chains"}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAAWH%2F9gzc%3D","line":436,"in_reply_to":"AAAAWH%2F%2BilA%3D","updated":"2014-04-04 01:25:57.000000000","message":"Done","commit_id":"d033fb6e5388dbeaaa42456991c8d4ff6ecaa9dd"},{"author":{"_account_id":2592,"name":"Mark McClain","email":"mark@mcclain.xyz","username":"markmcclain"},"change_message_id":"0e082ccc3cfd3cc9293ca6490e28d9d77db9bb2a","unresolved":false,"context_lines":[{"line_number":497,"context_line":"            new_filter \u003d [s for s in new_filter if rule_str not in s.strip()]"},{"line_number":498,"context_line":""},{"line_number":499,"context_line":"            # if no old or duplicates, use original rule"},{"line_number":500,"context_line":"            if old:"},{"line_number":501,"context_line":"                rule_str \u003d str(old)"},{"line_number":502,"context_line":"            elif dup:"},{"line_number":503,"context_line":"                rule_str \u003d str(dup)"}],"source_content_type":"text/x-python","patch_set":6,"id":"5adbc538_31fcca3e","line":500,"updated":"2014-05-26 08:40:24.000000000","message":"rule_str \u003d str(old or dup)","commit_id":"45549cc25ff53b69b4f29bbf3f6ec2f07b7d7453"},{"author":{"_account_id":10571,"name":"Sudhakar","username":"Sudhakar","inactive":true},"change_message_id":"730d7c022f4a02114468726a3ed135c940ec14e2","unresolved":false,"context_lines":[{"line_number":497,"context_line":"            new_filter \u003d [s for s in new_filter if rule_str not in s.strip()]"},{"line_number":498,"context_line":""},{"line_number":499,"context_line":"            # if no old or duplicates, use original rule"},{"line_number":500,"context_line":"            if old:"},{"line_number":501,"context_line":"                rule_str \u003d str(old)"},{"line_number":502,"context_line":"            elif dup:"},{"line_number":503,"context_line":"                rule_str \u003d str(dup)"}],"source_content_type":"text/x-python","patch_set":6,"id":"5adbc538_f4941046","line":500,"in_reply_to":"5adbc538_31fcca3e","updated":"2014-05-26 09:01:44.000000000","message":"Thanks for the comments Mark. \nin the elif loop we have another statement of decrementing the ruls_index.\nAlso we have an else condition which assigns different value for rule_str. \n\nSo making the suggested change will result in additional changes. \nCorrect??","commit_id":"45549cc25ff53b69b4f29bbf3f6ec2f07b7d7453"},{"author":{"_account_id":1131,"name":"Brian Haley","email":"haleyb.dev@gmail.com","username":"brian-haley"},"change_message_id":"d4df1856707078af45b686f4dd7642bd6375a76c","unresolved":false,"context_lines":[{"line_number":497,"context_line":"            new_filter \u003d [s for s in new_filter if rule_str not in s.strip()]"},{"line_number":498,"context_line":""},{"line_number":499,"context_line":"            # if no old or duplicates, use original rule"},{"line_number":500,"context_line":"            if old:"},{"line_number":501,"context_line":"                rule_str \u003d str(old)"},{"line_number":502,"context_line":"            elif dup:"},{"line_number":503,"context_line":"                rule_str \u003d str(dup)"}],"source_content_type":"text/x-python","patch_set":6,"id":"3ae8d1ca_7a37fcb0","line":500,"in_reply_to":"5adbc538_f4941046","updated":"2014-05-27 18:43:09.000000000","message":"I\u0027m not sure the resultant code with this change is any more readable, and it only removes one line:\n\n    if old or dup:\n        rule_str \u003d str(old or dup)\n        # backup one index so we write the array correctly\n        if not old:\n            rules_index -\u003d 1\n\nWe can\u0027t use \"if dup\" since it might not be assigned.\n\nI guess I can move \"rules_index -\u003d 1\" up to line 496+ but it also only saves one line of code.","commit_id":"45549cc25ff53b69b4f29bbf3f6ec2f07b7d7453"}],"neutron/tests/unit/test_iptables_manager.py":[{"author":{"_account_id":1131,"name":"Brian Haley","email":"haleyb.dev@gmail.com","username":"brian-haley"},"change_message_id":"f4e9db891f35264d7573d56a4ea9e083f94b6d48","unresolved":false,"context_lines":[{"line_number":608,"context_line":""},{"line_number":609,"context_line":"        tools.verify_mock_calls(self.execute, expected_calls_and_values)"},{"line_number":610,"context_line":""},{"line_number":611,"context_line":"    def test_iterate_and_find(self):"},{"line_number":612,"context_line":"        rule_str \u003d \u0027neutron-filter-top\u0027"},{"line_number":613,"context_line":""},{"line_number":614,"context_line":"        filter_list \u003d [\u0027-A FORWARD -j neutron-filter-top\u0027,"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAAVn%2F%2FmuU%3D","line":611,"updated":"2014-03-05 04:11:39.000000000","message":"There should be two tests - one to see if None is returned, the other with duplicate entries to make sure the last is returned.  You should also use the same \u0027iptables-save -c\u0027 format like the other tests.","commit_id":"54bbbebb8e32cb0e781d572631e42e05aadb0f8c"}]}
