)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":2733,"name":"Darragh O\u0027Reilly","email":"doreilly@suse.com","username":"darragh-oreilly"},"change_message_id":"4cd34ceb6d1ce73f535d6e40b94ff74d0d96ccc1","unresolved":false,"context_lines":[{"line_number":25,"context_line":"updated, but in that case the main loop will identify this port"},{"line_number":26,"context_line":"as \u0027added\u0027 thus processing it anyway. L2 wiring for updated"},{"line_number":27,"context_line":"ports won\u0027t be necessary until updates to provider network"},{"line_number":28,"context_line":"attributes are not supported."},{"line_number":29,"context_line":""},{"line_number":30,"context_line":"The update_ports method has been renamed to scan_ports as the latter"},{"line_number":31,"context_line":"name appear to be more in line with what the method actually does."}],"source_content_type":"text/x-gerrit-commit-message","patch_set":4,"id":"AAAATn%2F9LVw%3D","line":28,"updated":"2013-12-15 19:06:58.000000000","message":"I\u0027m not sure, should this be: \"... are supported.\"","commit_id":"9449e483b4891cc5d38cf724d17aba300e0ef8a9"},{"author":{"_account_id":261,"name":"Salvatore Orlando","email":"salv.orlando@gmail.com","username":"salvatore-orlando"},"change_message_id":"11fb4120d092370b5e56574b5f73abadc996bede","unresolved":false,"context_lines":[{"line_number":25,"context_line":"updated, but in that case the main loop will identify this port"},{"line_number":26,"context_line":"as \u0027added\u0027 thus processing it anyway. L2 wiring for updated"},{"line_number":27,"context_line":"ports won\u0027t be necessary until updates to provider network"},{"line_number":28,"context_line":"attributes are not supported."},{"line_number":29,"context_line":""},{"line_number":30,"context_line":"The update_ports method has been renamed to scan_ports as the latter"},{"line_number":31,"context_line":"name appear to be more in line with what the method actually does."}],"source_content_type":"text/x-gerrit-commit-message","patch_set":4,"id":"AAAATn%2F9LNM%3D","line":28,"in_reply_to":"AAAATn%2F9LVw%3D","updated":"2013-12-15 22:24:45.000000000","message":"I don\u0027t know either. I don\u0027t know english.\nI use until in the same sense as \nrepeat\n  \u003c...\u003e\nuntil (condition is true)","commit_id":"9449e483b4891cc5d38cf724d17aba300e0ef8a9"},{"author":{"_account_id":2733,"name":"Darragh O\u0027Reilly","email":"doreilly@suse.com","username":"darragh-oreilly"},"change_message_id":"7ff2ce23b528665b2d97c5e3d93105ce56e663e4","unresolved":false,"context_lines":[{"line_number":20,"context_line":"differs from the desired one."},{"line_number":21,"context_line":""},{"line_number":22,"context_line":"This patch still performs L2 wiring for updated ports even if it"},{"line_number":23,"context_line":"won\u0027t be necessary unless the administrative state of a port changes."},{"line_number":24,"context_line":""},{"line_number":25,"context_line":"The update_ports method has been renamed to scan_ports as the latter"},{"line_number":26,"context_line":"name appear to be more in line with what the method actually does."}],"source_content_type":"text/x-gerrit-commit-message","patch_set":7,"id":"AAAATn%2F9F8A%3D","line":23,"updated":"2013-12-16 21:22:58.000000000","message":"... even though it is only necessary when the ...","commit_id":"a2bfaf55ee49239edc4008680e75a9c0c9760782"},{"author":{"_account_id":2733,"name":"Darragh O\u0027Reilly","email":"doreilly@suse.com","username":"darragh-oreilly"},"change_message_id":"7ff2ce23b528665b2d97c5e3d93105ce56e663e4","unresolved":false,"context_lines":[{"line_number":23,"context_line":"won\u0027t be necessary unless the administrative state of a port changes."},{"line_number":24,"context_line":""},{"line_number":25,"context_line":"The update_ports method has been renamed to scan_ports as the latter"},{"line_number":26,"context_line":"name appear to be more in line with what the method actually does."},{"line_number":27,"context_line":""},{"line_number":28,"context_line":"Partial-Bug: #1253993"},{"line_number":29,"context_line":"Partially implements blueprint: neutron-tempest-parallel"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":7,"id":"AAAATn%2F9F8g%3D","line":26,"updated":"2013-12-16 21:22:58.000000000","message":"nit: appears to be","commit_id":"a2bfaf55ee49239edc4008680e75a9c0c9760782"},{"author":{"_account_id":261,"name":"Salvatore Orlando","email":"salv.orlando@gmail.com","username":"salvatore-orlando"},"change_message_id":"3194b82702750f6be20608e03641f3561c86ddcb","unresolved":false,"context_lines":[{"line_number":23,"context_line":"won\u0027t be necessary unless the administrative state of a port changes."},{"line_number":24,"context_line":""},{"line_number":25,"context_line":"The update_ports method has been renamed to scan_ports as the latter"},{"line_number":26,"context_line":"name appear to be more in line with what the method actually does."},{"line_number":27,"context_line":""},{"line_number":28,"context_line":"Partial-Bug: #1253993"},{"line_number":29,"context_line":"Partially implements blueprint: neutron-tempest-parallel"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":7,"id":"AAAATn%2F9FNs%3D","line":26,"in_reply_to":"AAAATn%2F9F8g%3D","updated":"2013-12-16 23:43:06.000000000","message":"Done","commit_id":"a2bfaf55ee49239edc4008680e75a9c0c9760782"}],"neutron/plugins/openvswitch/agent/ovs_neutron_agent.py":[{"author":{"_account_id":6659,"name":"Paul Michali","email":"pc@michali.net","username":"pcm"},"change_message_id":"6144fcd077e7726abe6baace7ab175abc0aacfcb","unresolved":false,"context_lines":[{"line_number":823,"context_line":"            # port_info. These ports should be marked as down"},{"line_number":824,"context_line":"            # Find ports which were removed in the meanwhile,"},{"line_number":825,"context_line":"            updated_ports_missing \u003d (updated_ports -"},{"line_number":826,"context_line":"                                     port_info.get(\u0027current \u0027, ports))"},{"line_number":827,"context_line":"            updated_ports \u003d updated_ports - updated_ports_missing"},{"line_number":828,"context_line":"            port_info[\u0027updated\u0027] \u003d updated_ports"},{"line_number":829,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAATn%2F9QkU%3D","line":826,"updated":"2013-12-13 12:21:04.000000000","message":"Typo, with extra space on \u0027current \u0027?\n\nThat said, is there a UT that is demonstrating that update_ports_missing is getting the right \"set\" of ports?","commit_id":"1468eb92da64b929b226544412d4df62a3e70002"},{"author":{"_account_id":261,"name":"Salvatore Orlando","email":"salv.orlando@gmail.com","username":"salvatore-orlando"},"change_message_id":"d241680b3b17f510d79563260a2d87f41ab34b2b","unresolved":false,"context_lines":[{"line_number":823,"context_line":"            # port_info. These ports should be marked as down"},{"line_number":824,"context_line":"            # Find ports which were removed in the meanwhile,"},{"line_number":825,"context_line":"            updated_ports_missing \u003d (updated_ports -"},{"line_number":826,"context_line":"                                     port_info.get(\u0027current \u0027, ports))"},{"line_number":827,"context_line":"            updated_ports \u003d updated_ports - updated_ports_missing"},{"line_number":828,"context_line":"            port_info[\u0027updated\u0027] \u003d updated_ports"},{"line_number":829,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAATn%2F9QdE%3D","line":826,"in_reply_to":"AAAATn%2F9QkU%3D","updated":"2013-12-13 12:37:06.000000000","message":"ah good point.\nThere are unit tests for scan ports and updated ports, but we might want to add one to cover this specific cafes.","commit_id":"1468eb92da64b929b226544412d4df62a3e70002"},{"author":{"_account_id":6659,"name":"Paul Michali","email":"pc@michali.net","username":"pcm"},"change_message_id":"6144fcd077e7726abe6baace7ab175abc0aacfcb","unresolved":false,"context_lines":[{"line_number":824,"context_line":"            # Find ports which were removed in the meanwhile,"},{"line_number":825,"context_line":"            updated_ports_missing \u003d (updated_ports -"},{"line_number":826,"context_line":"                                     port_info.get(\u0027current \u0027, ports))"},{"line_number":827,"context_line":"            updated_ports \u003d updated_ports - updated_ports_missing"},{"line_number":828,"context_line":"            port_info[\u0027updated\u0027] \u003d updated_ports"},{"line_number":829,"context_line":""},{"line_number":830,"context_line":"        if ports \u003d\u003d registered_ports and not updated_ports_missing:"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAATn%2F9QjY%3D","line":827,"updated":"2013-12-13 12:21:04.000000000","message":"Isn\u0027t this equivalent to port_info.get(\u0027current\u0027, ports)?","commit_id":"1468eb92da64b929b226544412d4df62a3e70002"},{"author":{"_account_id":261,"name":"Salvatore Orlando","email":"salv.orlando@gmail.com","username":"salvatore-orlando"},"change_message_id":"d241680b3b17f510d79563260a2d87f41ab34b2b","unresolved":false,"context_lines":[{"line_number":824,"context_line":"            # Find ports which were removed in the meanwhile,"},{"line_number":825,"context_line":"            updated_ports_missing \u003d (updated_ports -"},{"line_number":826,"context_line":"                                     port_info.get(\u0027current \u0027, ports))"},{"line_number":827,"context_line":"            updated_ports \u003d updated_ports - updated_ports_missing"},{"line_number":828,"context_line":"            port_info[\u0027updated\u0027] \u003d updated_ports"},{"line_number":829,"context_line":""},{"line_number":830,"context_line":"        if ports \u003d\u003d registered_ports and not updated_ports_missing:"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAATn%2F9Qdk%3D","line":827,"in_reply_to":"AAAATn%2F9QjY%3D","updated":"2013-12-13 12:37:06.000000000","message":"This is supposed to remove from updated_ports the ids of the ports which were removed in the meanwhile so filter rules won\u0027t be applied for them in process_network_ports","commit_id":"1468eb92da64b929b226544412d4df62a3e70002"},{"author":{"_account_id":6670,"name":"Amir Sadoughi","email":"amir.sadoughi@rackspace.com","username":"amir-sadoughi"},"change_message_id":"167e4c1e58429a7a7102355079037c27b079e3ec","unresolved":false,"context_lines":[{"line_number":302,"context_line":"            return"},{"line_number":303,"context_line":""},{"line_number":304,"context_line":"        if ext_sg.SECURITYGROUPS in port:"},{"line_number":305,"context_line":"            self.sg_agent.refresh_firewall()"},{"line_number":306,"context_line":"        network_type \u003d kwargs.get(\u0027network_type\u0027)"},{"line_number":307,"context_line":"        segmentation_id \u003d kwargs.get(\u0027segmentation_id\u0027)"},{"line_number":308,"context_line":"        physical_network \u003d kwargs.get(\u0027physical_network\u0027)"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAATn%2F9PQY%3D","side":"PARENT","line":305,"updated":"2013-12-13 16:35:41.000000000","message":"Was this invocation supposed to be removed entirely?","commit_id":"3b4233873539bad62d202025529678a5b0add412"},{"author":{"_account_id":261,"name":"Salvatore Orlando","email":"salv.orlando@gmail.com","username":"salvatore-orlando"},"change_message_id":"0f38340e921bf8be18b25cbbb8fc6d45eb13eb70","unresolved":false,"context_lines":[{"line_number":302,"context_line":"            return"},{"line_number":303,"context_line":""},{"line_number":304,"context_line":"        if ext_sg.SECURITYGROUPS in port:"},{"line_number":305,"context_line":"            self.sg_agent.refresh_firewall()"},{"line_number":306,"context_line":"        network_type \u003d kwargs.get(\u0027network_type\u0027)"},{"line_number":307,"context_line":"        segmentation_id \u003d kwargs.get(\u0027segmentation_id\u0027)"},{"line_number":308,"context_line":"        physical_network \u003d kwargs.get(\u0027physical_network\u0027)"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAATn%2F9LdU%3D","side":"PARENT","line":305,"in_reply_to":"AAAATn%2F9PQY%3D","updated":"2013-12-15 16:50:05.000000000","message":"yes it was.\nIt is the main goal of the patch actually.\n\nThe rpc call s still there, but now instead of reacting, stores the information about notification and processes it in the main rpc loop.\n\nThe reasons for the change are in the commit msg","commit_id":"3b4233873539bad62d202025529678a5b0add412"},{"author":{"_account_id":6659,"name":"Paul Michali","email":"pc@michali.net","username":"pcm"},"change_message_id":"97a763c6ab94df069938d4ba980c6298eda50e70","unresolved":false,"context_lines":[{"line_number":824,"context_line":"            # Find ports which were removed in the meanwhile,"},{"line_number":825,"context_line":"            updated_ports_missing \u003d (updated_ports -"},{"line_number":826,"context_line":"                                     port_info.get(\u0027current\u0027, ports))"},{"line_number":827,"context_line":"            updated_ports \u003d updated_ports - updated_ports_missing"},{"line_number":828,"context_line":"            port_info[\u0027updated\u0027] \u003d updated_ports"},{"line_number":829,"context_line":""},{"line_number":830,"context_line":"        if ports \u003d\u003d registered_ports and not updated_ports_missing:"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAATn%2F9QZ8%3D","line":827,"updated":"2013-12-13 12:50:47.000000000","message":"Isn\u0027t the equivalent of this:\n\nupdated_ports \u003d port_info.get(\u0027current\u0027, ports)\n\nOr did you want it to explicitly show the set difference operation?","commit_id":"c141b9b12f59536ff19423032a7182446d71a84a"},{"author":{"_account_id":6659,"name":"Paul Michali","email":"pc@michali.net","username":"pcm"},"change_message_id":"032ac4392b370b16e1b304fd472b68353c18cf25","unresolved":false,"context_lines":[{"line_number":824,"context_line":"            # Find ports which were removed in the meanwhile,"},{"line_number":825,"context_line":"            updated_ports_missing \u003d (updated_ports -"},{"line_number":826,"context_line":"                                     port_info.get(\u0027current\u0027, ports))"},{"line_number":827,"context_line":"            updated_ports \u003d updated_ports - updated_ports_missing"},{"line_number":828,"context_line":"            port_info[\u0027updated\u0027] \u003d updated_ports"},{"line_number":829,"context_line":""},{"line_number":830,"context_line":"        if ports \u003d\u003d registered_ports and not updated_ports_missing:"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAATn%2F9PjY%3D","line":827,"in_reply_to":"AAAATn%2F9QDo%3D","updated":"2013-12-13 15:40:24.000000000","message":"Didn\u0027t realize that. Interesting!","commit_id":"c141b9b12f59536ff19423032a7182446d71a84a"},{"author":{"_account_id":261,"name":"Salvatore Orlando","email":"salv.orlando@gmail.com","username":"salvatore-orlando"},"change_message_id":"90c4488d0dc99a712bdf7e75fdb09382a5437d35","unresolved":false,"context_lines":[{"line_number":824,"context_line":"            # Find ports which were removed in the meanwhile,"},{"line_number":825,"context_line":"            updated_ports_missing \u003d (updated_ports -"},{"line_number":826,"context_line":"                                     port_info.get(\u0027current\u0027, ports))"},{"line_number":827,"context_line":"            updated_ports \u003d updated_ports - updated_ports_missing"},{"line_number":828,"context_line":"            port_info[\u0027updated\u0027] \u003d updated_ports"},{"line_number":829,"context_line":""},{"line_number":830,"context_line":"        if ports \u003d\u003d registered_ports and not updated_ports_missing:"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAATn%2F9QDo%3D","line":827,"in_reply_to":"AAAATn%2F9QZ8%3D","updated":"2013-12-13 14:05:32.000000000","message":"This is how I think it would work.\nAssume current\u003dset(a,b,c,) and updated_ports\u003dset(a,d)\n\nupdated_port_missing \u003d (a,d) - (a,b,c) \u003d set(d)\nupdated_ports \u003d (a,d) - (d) \u003d set(a)\n\nI think it could be simplified by doing\nupdated_ports \u0026 port_info.get(\u0027current\u0027, ports)\n\nBut I am not sure about your proposal; I understand that in general A - ( A - B) \u003d B but this does not apply to python sets as the difference is not symmetric (the ^ operator does that)","commit_id":"c141b9b12f59536ff19423032a7182446d71a84a"},{"author":{"_account_id":2733,"name":"Darragh O\u0027Reilly","email":"doreilly@suse.com","username":"darragh-oreilly"},"change_message_id":"4cd34ceb6d1ce73f535d6e40b94ff74d0d96ccc1","unresolved":false,"context_lines":[{"line_number":820,"context_line":"            # Filter out updated ports which are not anymore in"},{"line_number":821,"context_line":"            # port_info, as they were removed in the meanwhile."},{"line_number":822,"context_line":"            # Store missing ports to be sure they will be removed"},{"line_number":823,"context_line":"            cur_ports \u003d port_info.get(\u0027current\u0027, ports)"},{"line_number":824,"context_line":"            updated_ports_missing \u003d updated_ports - cur_ports"},{"line_number":825,"context_line":"            updated_ports \u003d updated_ports \u0026 cur_ports"},{"line_number":826,"context_line":"            port_info[\u0027updated\u0027] \u003d updated_ports"}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAATn%2F9LVs%3D","line":823,"updated":"2013-12-15 19:06:58.000000000","message":"why not just set cur_ports in line 812 instead of having 2 variables for the same thing?","commit_id":"9449e483b4891cc5d38cf724d17aba300e0ef8a9"},{"author":{"_account_id":261,"name":"Salvatore Orlando","email":"salv.orlando@gmail.com","username":"salvatore-orlando"},"change_message_id":"11fb4120d092370b5e56574b5f73abadc996bede","unresolved":false,"context_lines":[{"line_number":820,"context_line":"            # Filter out updated ports which are not anymore in"},{"line_number":821,"context_line":"            # port_info, as they were removed in the meanwhile."},{"line_number":822,"context_line":"            # Store missing ports to be sure they will be removed"},{"line_number":823,"context_line":"            cur_ports \u003d port_info.get(\u0027current\u0027, ports)"},{"line_number":824,"context_line":"            updated_ports_missing \u003d updated_ports - cur_ports"},{"line_number":825,"context_line":"            updated_ports \u003d updated_ports \u0026 cur_ports"},{"line_number":826,"context_line":"            port_info[\u0027updated\u0027] \u003d updated_ports"}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAATn%2F9LNE%3D","line":823,"in_reply_to":"AAAATn%2F9LVs%3D","updated":"2013-12-15 22:24:45.000000000","message":"makes sense, I focused only on this few lines in my latest patchset and forgot about the initial variable, ending up doing this stupid thing","commit_id":"9449e483b4891cc5d38cf724d17aba300e0ef8a9"},{"author":{"_account_id":2733,"name":"Darragh O\u0027Reilly","email":"doreilly@suse.com","username":"darragh-oreilly"},"change_message_id":"4cd34ceb6d1ce73f535d6e40b94ff74d0d96ccc1","unresolved":false,"context_lines":[{"line_number":1025,"context_line":"        # there is a host binding update, the updated device will be retrieved"},{"line_number":1026,"context_line":"        # anyway through ovs polling."},{"line_number":1027,"context_line":"        # NOTE(salv-orlando): This assumption might not be valid anymore when"},{"line_number":1028,"context_line":"        # it will be possible to update provider attributes for a network."},{"line_number":1029,"context_line":"        if \u0027added\u0027 in port_info:"},{"line_number":1030,"context_line":"            start \u003d time.time()"},{"line_number":1031,"context_line":"            resync_a \u003d self.treat_devices_added(port_info[\u0027added\u0027])"}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAATn%2F9LVY%3D","line":1028,"updated":"2013-12-15 19:06:58.000000000","message":"ports that had their admin_state_up attribute changed are not going to be processed now.","commit_id":"9449e483b4891cc5d38cf724d17aba300e0ef8a9"},{"author":{"_account_id":2733,"name":"Darragh O\u0027Reilly","email":"doreilly@suse.com","username":"darragh-oreilly"},"change_message_id":"4cd34ceb6d1ce73f535d6e40b94ff74d0d96ccc1","unresolved":false,"context_lines":[{"line_number":1141,"context_line":"                              {\u0027iter_num\u0027: self.iter_num,"},{"line_number":1142,"context_line":"                               \u0027elapsed\u0027: time.time() - start})"},{"line_number":1143,"context_line":"                    # notify plugin about port deltas"},{"line_number":1144,"context_line":"                    if port_info:"},{"line_number":1145,"context_line":"                        LOG.debug(_(\"Agent loop has new devices!\"))"},{"line_number":1146,"context_line":"                        # If treat devices fails - must resync with plugin"},{"line_number":1147,"context_line":"                        sync \u003d self.process_network_ports(port_info)"}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAATn%2F9LVQ%3D","line":1144,"updated":"2013-12-15 19:06:58.000000000","message":"port_info will always be True.","commit_id":"9449e483b4891cc5d38cf724d17aba300e0ef8a9"},{"author":{"_account_id":261,"name":"Salvatore Orlando","email":"salv.orlando@gmail.com","username":"salvatore-orlando"},"change_message_id":"11fb4120d092370b5e56574b5f73abadc996bede","unresolved":false,"context_lines":[{"line_number":1141,"context_line":"                              {\u0027iter_num\u0027: self.iter_num,"},{"line_number":1142,"context_line":"                               \u0027elapsed\u0027: time.time() - start})"},{"line_number":1143,"context_line":"                    # notify plugin about port deltas"},{"line_number":1144,"context_line":"                    if port_info:"},{"line_number":1145,"context_line":"                        LOG.debug(_(\"Agent loop has new devices!\"))"},{"line_number":1146,"context_line":"                        # If treat devices fails - must resync with plugin"},{"line_number":1147,"context_line":"                        sync \u003d self.process_network_ports(port_info)"}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAATn%2F9LM8%3D","line":1144,"in_reply_to":"AAAATn%2F9LVQ%3D","updated":"2013-12-15 22:24:45.000000000","message":"That\u0027s a good point as well; I changed scan_ports logic at the last time. It should be easy to deal with this.","commit_id":"9449e483b4891cc5d38cf724d17aba300e0ef8a9"},{"author":{"_account_id":2733,"name":"Darragh O\u0027Reilly","email":"doreilly@suse.com","username":"darragh-oreilly"},"change_message_id":"4cd34ceb6d1ce73f535d6e40b94ff74d0d96ccc1","unresolved":false,"context_lines":[{"line_number":1142,"context_line":"                               \u0027elapsed\u0027: time.time() - start})"},{"line_number":1143,"context_line":"                    # notify plugin about port deltas"},{"line_number":1144,"context_line":"                    if port_info:"},{"line_number":1145,"context_line":"                        LOG.debug(_(\"Agent loop has new devices!\"))"},{"line_number":1146,"context_line":"                        # If treat devices fails - must resync with plugin"},{"line_number":1147,"context_line":"                        sync \u003d self.process_network_ports(port_info)"},{"line_number":1148,"context_line":"                        LOG.debug(_(\"Agent rpc_loop - iteration:%(iter_num)d -\""}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAATn%2F9LVI%3D","line":1145,"updated":"2013-12-15 19:06:58.000000000","message":"I don\u0027t thing this message is still accurate or useful.","commit_id":"9449e483b4891cc5d38cf724d17aba300e0ef8a9"},{"author":{"_account_id":261,"name":"Salvatore Orlando","email":"salv.orlando@gmail.com","username":"salvatore-orlando"},"change_message_id":"11fb4120d092370b5e56574b5f73abadc996bede","unresolved":false,"context_lines":[{"line_number":1142,"context_line":"                               \u0027elapsed\u0027: time.time() - start})"},{"line_number":1143,"context_line":"                    # notify plugin about port deltas"},{"line_number":1144,"context_line":"                    if port_info:"},{"line_number":1145,"context_line":"                        LOG.debug(_(\"Agent loop has new devices!\"))"},{"line_number":1146,"context_line":"                        # If treat devices fails - must resync with plugin"},{"line_number":1147,"context_line":"                        sync \u003d self.process_network_ports(port_info)"},{"line_number":1148,"context_line":"                        LOG.debug(_(\"Agent rpc_loop - iteration:%(iter_num)d -\""}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAATn%2F9LM0%3D","line":1145,"in_reply_to":"AAAATn%2F9LVI%3D","updated":"2013-12-15 22:24:45.000000000","message":"It never was. I did not remove it in this patch to avoid side-effects, but is obviously a really negligible change that we can do either here or in another patch.","commit_id":"9449e483b4891cc5d38cf724d17aba300e0ef8a9"},{"author":{"_account_id":6670,"name":"Amir Sadoughi","email":"amir.sadoughi@rackspace.com","username":"amir-sadoughi"},"change_message_id":"804177b088255cca2d527fd50a97812867d0659d","unresolved":false,"context_lines":[{"line_number":300,"context_line":"            return"},{"line_number":301,"context_line":""},{"line_number":302,"context_line":"        if ext_sg.SECURITYGROUPS in port:"},{"line_number":303,"context_line":"            self.sg_agent.refresh_firewall()"},{"line_number":304,"context_line":"        network_type \u003d kwargs.get(\u0027network_type\u0027)"},{"line_number":305,"context_line":"        segmentation_id \u003d kwargs.get(\u0027segmentation_id\u0027)"},{"line_number":306,"context_line":"        physical_network \u003d kwargs.get(\u0027physical_network\u0027)"}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAATn%2F9KsA%3D","side":"PARENT","line":303,"updated":"2013-12-16 02:54:26.000000000","message":"Reiterating my previous point, neutron/agent/securitygroups_rpc.SecurityGroupAgentRpcMixin.refresh_firewall does something different than neutron/agent/securitygroups_rpc.SecurityGroupAgentRpcMixin.prepare_devices_filter (invokes firewall.update_port_filter vs invokes firewall.prepare_port_filter) so I am not sure why refresh_firewall is never being invoked in the new code.","commit_id":"806c16044c7e9d4031cb5155a8d470314785ce4c"},{"author":{"_account_id":6598,"name":"Berezovsky Irena","email":"irenab.dev@gmail.com","username":"irenab"},"change_message_id":"295cfeef2e1d16d550952d34c3baff59ca7bf94e","unresolved":false,"context_lines":[{"line_number":294,"context_line":"    def port_update(self, context, **kwargs):"},{"line_number":295,"context_line":"        port \u003d kwargs.get(\u0027port\u0027)"},{"line_number":296,"context_line":"        LOG.debug(_(\"port_update received for port:%s\"), port[\u0027id\u0027])"},{"line_number":297,"context_line":"        # Put the port identier in the updated_ports set."},{"line_number":298,"context_line":"        # Do not store port details, as if they\u0027re used for processing"},{"line_number":299,"context_line":"        # notifications there is no guarantee the notifications are"},{"line_number":300,"context_line":"        # processed in the same order as the relevant API requests"}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAATn%2F9J7o%3D","line":297,"updated":"2013-12-16 08:52:51.000000000","message":"The method invocation below quite straight  forward. The comment seems redundant","commit_id":"30d584e12857616de6411e798c1ac6d884420aec"},{"author":{"_account_id":261,"name":"Salvatore Orlando","email":"salv.orlando@gmail.com","username":"salvatore-orlando"},"change_message_id":"a64cf445834c3d7bef3ac7f155376b29ec81b3e6","unresolved":false,"context_lines":[{"line_number":294,"context_line":"    def port_update(self, context, **kwargs):"},{"line_number":295,"context_line":"        port \u003d kwargs.get(\u0027port\u0027)"},{"line_number":296,"context_line":"        LOG.debug(_(\"port_update received for port:%s\"), port[\u0027id\u0027])"},{"line_number":297,"context_line":"        # Put the port identier in the updated_ports set."},{"line_number":298,"context_line":"        # Do not store port details, as if they\u0027re used for processing"},{"line_number":299,"context_line":"        # notifications there is no guarantee the notifications are"},{"line_number":300,"context_line":"        # processed in the same order as the relevant API requests"}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAATn%2F9Jqs%3D","line":297,"in_reply_to":"AAAATn%2F9J7o%3D","updated":"2013-12-16 09:38:12.000000000","message":"I felt it was important to leave a comment as why I\u0027m not storing port details. Indeed I\u0027d like to change the rpc interface in the future if this patch is accepted to avoid sending unnecessary payload over the wire.","commit_id":"30d584e12857616de6411e798c1ac6d884420aec"},{"author":{"_account_id":6670,"name":"Amir Sadoughi","email":"amir.sadoughi@rackspace.com","username":"amir-sadoughi"},"change_message_id":"804177b088255cca2d527fd50a97812867d0659d","unresolved":false,"context_lines":[{"line_number":1026,"context_line":"                                 set(port_info.get(\u0027updated\u0027, [])))"},{"line_number":1027,"context_line":"        # If there is an exception while processing security groups ports"},{"line_number":1028,"context_line":"        # will not be wired anyway, and a resync will be triggered"},{"line_number":1029,"context_line":"        self.sg_agent.prepare_devices_filter(devices_added_updated)"},{"line_number":1030,"context_line":"        # VIF wiring needs to be performed only for \u0027new\u0027 devices."},{"line_number":1031,"context_line":"        # For updated ports, re-wiring is not needed (even in the case when"},{"line_number":1032,"context_line":"        # there is a host binding update, the updated device will be retrieved"}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAATn%2F9Kr4%3D","line":1029,"updated":"2013-12-16 02:54:26.000000000","message":"With respect to my other comment in this patchset, I think self.sg_agent.refresh_firewall should be called for the updated ports and self.sg_agent.prepare_devices_filter should be called for the added ports; two separate invocations. \n\nIs your concern that calling refresh_firewall and prepare_devices_filter each make their own separate RPC calls? If so, removing the call to refresh_firewall isn\u0027t the appropriate way to handle that, IMO.","commit_id":"30d584e12857616de6411e798c1ac6d884420aec"},{"author":{"_account_id":261,"name":"Salvatore Orlando","email":"salv.orlando@gmail.com","username":"salvatore-orlando"},"change_message_id":"a64cf445834c3d7bef3ac7f155376b29ec81b3e6","unresolved":false,"context_lines":[{"line_number":1026,"context_line":"                                 set(port_info.get(\u0027updated\u0027, [])))"},{"line_number":1027,"context_line":"        # If there is an exception while processing security groups ports"},{"line_number":1028,"context_line":"        # will not be wired anyway, and a resync will be triggered"},{"line_number":1029,"context_line":"        self.sg_agent.prepare_devices_filter(devices_added_updated)"},{"line_number":1030,"context_line":"        # VIF wiring needs to be performed only for \u0027new\u0027 devices."},{"line_number":1031,"context_line":"        # For updated ports, re-wiring is not needed (even in the case when"},{"line_number":1032,"context_line":"        # there is a host binding update, the updated device will be retrieved"}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAATn%2F9Jpk%3D","line":1029,"in_reply_to":"AAAATn%2F9Kr4%3D","updated":"2013-12-16 09:38:12.000000000","message":"This can be easily handled. It is not a show-stopper for this patch;.","commit_id":"30d584e12857616de6411e798c1ac6d884420aec"},{"author":{"_account_id":841,"name":"Akihiro Motoki","email":"amotoki@gmail.com","username":"amotoki"},"change_message_id":"2ef55575214b8a6efa59893e3e77e3a77e1b6bb9","unresolved":false,"context_lines":[{"line_number":293,"context_line":""},{"line_number":294,"context_line":"    def port_update(self, context, **kwargs):"},{"line_number":295,"context_line":"        port \u003d kwargs.get(\u0027port\u0027)"},{"line_number":296,"context_line":"        LOG.debug(_(\"port_update received for port:%s\"), port[\u0027id\u0027])"},{"line_number":297,"context_line":"        # Put the port identier in the updated_ports set."},{"line_number":298,"context_line":"        # Do not store port details, as if they\u0027re used for processing"},{"line_number":299,"context_line":"        # notifications there is no guarantee the notifications are"}],"source_content_type":"text/x-python","patch_set":6,"id":"AAAATn%2F9Ikk%3D","line":296,"updated":"2013-12-16 14:42:28.000000000","message":"A colon looks unnecessary.","commit_id":"59d8764c4cfc94d2b404bbd89eb72333f78eb627"},{"author":{"_account_id":261,"name":"Salvatore Orlando","email":"salv.orlando@gmail.com","username":"salvatore-orlando"},"change_message_id":"e483308e35278ee604a78b5574409bd31bdbf005","unresolved":false,"context_lines":[{"line_number":293,"context_line":""},{"line_number":294,"context_line":"    def port_update(self, context, **kwargs):"},{"line_number":295,"context_line":"        port \u003d kwargs.get(\u0027port\u0027)"},{"line_number":296,"context_line":"        LOG.debug(_(\"port_update received for port:%s\"), port[\u0027id\u0027])"},{"line_number":297,"context_line":"        # Put the port identier in the updated_ports set."},{"line_number":298,"context_line":"        # Do not store port details, as if they\u0027re used for processing"},{"line_number":299,"context_line":"        # notifications there is no guarantee the notifications are"}],"source_content_type":"text/x-python","patch_set":6,"id":"AAAATn%2F9G7Q%3D","line":296,"in_reply_to":"AAAATn%2F9Ikk%3D","updated":"2013-12-16 18:30:05.000000000","message":"I like colons :)","commit_id":"59d8764c4cfc94d2b404bbd89eb72333f78eb627"},{"author":{"_account_id":841,"name":"Akihiro Motoki","email":"amotoki@gmail.com","username":"amotoki"},"change_message_id":"2ef55575214b8a6efa59893e3e77e3a77e1b6bb9","unresolved":false,"context_lines":[{"line_number":294,"context_line":"    def port_update(self, context, **kwargs):"},{"line_number":295,"context_line":"        port \u003d kwargs.get(\u0027port\u0027)"},{"line_number":296,"context_line":"        LOG.debug(_(\"port_update received for port:%s\"), port[\u0027id\u0027])"},{"line_number":297,"context_line":"        # Put the port identier in the updated_ports set."},{"line_number":298,"context_line":"        # Do not store port details, as if they\u0027re used for processing"},{"line_number":299,"context_line":"        # notifications there is no guarantee the notifications are"},{"line_number":300,"context_line":"        # processed in the same order as the relevant API requests"}],"source_content_type":"text/x-python","patch_set":6,"id":"AAAATn%2F9Ikc%3D","line":297,"updated":"2013-12-16 14:42:28.000000000","message":"identifier","commit_id":"59d8764c4cfc94d2b404bbd89eb72333f78eb627"},{"author":{"_account_id":261,"name":"Salvatore Orlando","email":"salv.orlando@gmail.com","username":"salvatore-orlando"},"change_message_id":"e483308e35278ee604a78b5574409bd31bdbf005","unresolved":false,"context_lines":[{"line_number":294,"context_line":"    def port_update(self, context, **kwargs):"},{"line_number":295,"context_line":"        port \u003d kwargs.get(\u0027port\u0027)"},{"line_number":296,"context_line":"        LOG.debug(_(\"port_update received for port:%s\"), port[\u0027id\u0027])"},{"line_number":297,"context_line":"        # Put the port identier in the updated_ports set."},{"line_number":298,"context_line":"        # Do not store port details, as if they\u0027re used for processing"},{"line_number":299,"context_line":"        # notifications there is no guarantee the notifications are"},{"line_number":300,"context_line":"        # processed in the same order as the relevant API requests"}],"source_content_type":"text/x-python","patch_set":6,"id":"AAAATn%2F9G7A%3D","line":297,"in_reply_to":"AAAATn%2F9Ikc%3D","updated":"2013-12-16 18:30:05.000000000","message":"you spotted my \"reviewer quality control mark\".\n\nNo seriously, it\u0027s just a typo :)","commit_id":"59d8764c4cfc94d2b404bbd89eb72333f78eb627"},{"author":{"_account_id":841,"name":"Akihiro Motoki","email":"amotoki@gmail.com","username":"amotoki"},"change_message_id":"2ef55575214b8a6efa59893e3e77e3a77e1b6bb9","unresolved":false,"context_lines":[{"line_number":833,"context_line":"        # all the ports for which an update was received but are not found"},{"line_number":834,"context_line":"        # anymore on the bridge. The latter case is rare but possible if a"},{"line_number":835,"context_line":"        # port is created, updated, and then destroyed during a single agent"},{"line_number":836,"context_line":"        # loop iteration"},{"line_number":837,"context_line":"        port_info[\u0027removed\u0027] \u003d registered_ports - ports | updated_ports_missing"},{"line_number":838,"context_line":"        return port_info"},{"line_number":839,"context_line":""}],"source_content_type":"text/x-python","patch_set":6,"id":"AAAATn%2F9Ifs%3D","line":836,"updated":"2013-12-16 14:42:28.000000000","message":"(just question) If we count the latter case as \"removed\", there is a case where the total numbers of \"added\" and \"removed\"  mismatch in debug logs. How about store these count as separate fields?","commit_id":"59d8764c4cfc94d2b404bbd89eb72333f78eb627"},{"author":{"_account_id":261,"name":"Salvatore Orlando","email":"salv.orlando@gmail.com","username":"salvatore-orlando"},"change_message_id":"e483308e35278ee604a78b5574409bd31bdbf005","unresolved":false,"context_lines":[{"line_number":833,"context_line":"        # all the ports for which an update was received but are not found"},{"line_number":834,"context_line":"        # anymore on the bridge. The latter case is rare but possible if a"},{"line_number":835,"context_line":"        # port is created, updated, and then destroyed during a single agent"},{"line_number":836,"context_line":"        # loop iteration"},{"line_number":837,"context_line":"        port_info[\u0027removed\u0027] \u003d registered_ports - ports | updated_ports_missing"},{"line_number":838,"context_line":"        return port_info"},{"line_number":839,"context_line":""}],"source_content_type":"text/x-python","patch_set":6,"id":"AAAATn%2F9G3g%3D","line":836,"in_reply_to":"AAAATn%2F9Ifs%3D","updated":"2013-12-16 18:30:05.000000000","message":"in 99.99% of the cases, a port in updated_port_missing is also in port_info[\u0027removed\u0027] and then the set union operation will have no effect.\n\nThe tiny case we are referring to here is when a port marked as updated was never processed for adding in the first place, so it is not in registered_ports, and also happens to be removed.\nThis might happen for very short-lived ports during long iterations.\n\nI\u0027ve always been kind of sketchy regarding this case; now that I think about it since the port never went up in the first place, probably there\u0027s no point in bringing it down.\n\nI think we can just remove the logic around updated_ports_missing","commit_id":"59d8764c4cfc94d2b404bbd89eb72333f78eb627"},{"author":{"_account_id":841,"name":"Akihiro Motoki","email":"amotoki@gmail.com","username":"amotoki"},"change_message_id":"2ef55575214b8a6efa59893e3e77e3a77e1b6bb9","unresolved":false,"context_lines":[{"line_number":940,"context_line":"                                    details[\u0027segmentation_id\u0027],"},{"line_number":941,"context_line":"                                    details[\u0027admin_state_up\u0027])"},{"line_number":942,"context_line":"                # update plugin about port status"},{"line_number":943,"context_line":"                if details.get(\u0027admin_state_up\u0027):"},{"line_number":944,"context_line":"                    LOG.debug(_(\"Setting status for:%s to UP\"), device)"},{"line_number":945,"context_line":"                    self.plugin_rpc.update_device_up("},{"line_number":946,"context_line":"                        self.context, device, self.agent_id, cfg.CONF.host)"}],"source_content_type":"text/x-python","patch_set":6,"id":"AAAATn%2F9IeA%3D","line":943,"updated":"2013-12-16 14:42:28.000000000","message":"It looks better to use details[\u0027admin_state_up\u0027] because \u0027admin_state_up\u0027 always exists.","commit_id":"59d8764c4cfc94d2b404bbd89eb72333f78eb627"},{"author":{"_account_id":261,"name":"Salvatore Orlando","email":"salv.orlando@gmail.com","username":"salvatore-orlando"},"change_message_id":"e483308e35278ee604a78b5574409bd31bdbf005","unresolved":false,"context_lines":[{"line_number":940,"context_line":"                                    details[\u0027segmentation_id\u0027],"},{"line_number":941,"context_line":"                                    details[\u0027admin_state_up\u0027])"},{"line_number":942,"context_line":"                # update plugin about port status"},{"line_number":943,"context_line":"                if details.get(\u0027admin_state_up\u0027):"},{"line_number":944,"context_line":"                    LOG.debug(_(\"Setting status for:%s to UP\"), device)"},{"line_number":945,"context_line":"                    self.plugin_rpc.update_device_up("},{"line_number":946,"context_line":"                        self.context, device, self.agent_id, cfg.CONF.host)"}],"source_content_type":"text/x-python","patch_set":6,"id":"AAAATn%2F9G3Q%3D","line":943,"in_reply_to":"AAAATn%2F9IeA%3D","updated":"2013-12-16 18:30:05.000000000","message":"actually some plugins in case of errors do not return it, so I\u0027m trying to stay safe here.","commit_id":"59d8764c4cfc94d2b404bbd89eb72333f78eb627"},{"author":{"_account_id":841,"name":"Akihiro Motoki","email":"amotoki@gmail.com","username":"amotoki"},"change_message_id":"2ef55575214b8a6efa59893e3e77e3a77e1b6bb9","unresolved":false,"context_lines":[{"line_number":941,"context_line":"                                    details[\u0027admin_state_up\u0027])"},{"line_number":942,"context_line":"                # update plugin about port status"},{"line_number":943,"context_line":"                if details.get(\u0027admin_state_up\u0027):"},{"line_number":944,"context_line":"                    LOG.debug(_(\"Setting status for:%s to UP\"), device)"},{"line_number":945,"context_line":"                    self.plugin_rpc.update_device_up("},{"line_number":946,"context_line":"                        self.context, device, self.agent_id, cfg.CONF.host)"},{"line_number":947,"context_line":"                else:"}],"source_content_type":"text/x-python","patch_set":6,"id":"AAAATn%2F9IeQ%3D","line":944,"updated":"2013-12-16 14:42:28.000000000","message":"colon looks unnecessary","commit_id":"59d8764c4cfc94d2b404bbd89eb72333f78eb627"},{"author":{"_account_id":261,"name":"Salvatore Orlando","email":"salv.orlando@gmail.com","username":"salvatore-orlando"},"change_message_id":"e483308e35278ee604a78b5574409bd31bdbf005","unresolved":false,"context_lines":[{"line_number":941,"context_line":"                                    details[\u0027admin_state_up\u0027])"},{"line_number":942,"context_line":"                # update plugin about port status"},{"line_number":943,"context_line":"                if details.get(\u0027admin_state_up\u0027):"},{"line_number":944,"context_line":"                    LOG.debug(_(\"Setting status for:%s to UP\"), device)"},{"line_number":945,"context_line":"                    self.plugin_rpc.update_device_up("},{"line_number":946,"context_line":"                        self.context, device, self.agent_id, cfg.CONF.host)"},{"line_number":947,"context_line":"                else:"}],"source_content_type":"text/x-python","patch_set":6,"id":"AAAATn%2F9G3M%3D","line":944,"in_reply_to":"AAAATn%2F9IeQ%3D","updated":"2013-12-16 18:30:05.000000000","message":"Done","commit_id":"59d8764c4cfc94d2b404bbd89eb72333f78eb627"},{"author":{"_account_id":841,"name":"Akihiro Motoki","email":"amotoki@gmail.com","username":"amotoki"},"change_message_id":"2ef55575214b8a6efa59893e3e77e3a77e1b6bb9","unresolved":false,"context_lines":[{"line_number":945,"context_line":"                    self.plugin_rpc.update_device_up("},{"line_number":946,"context_line":"                        self.context, device, self.agent_id, cfg.CONF.host)"},{"line_number":947,"context_line":"                else:"},{"line_number":948,"context_line":"                    LOG.debug(_(\"Setting status for:%s to DOWN\"), device)"},{"line_number":949,"context_line":"                    self.plugin_rpc.update_device_down("},{"line_number":950,"context_line":"                        self.context, device, self.agent_id, cfg.CONF.host)"},{"line_number":951,"context_line":"            else:"}],"source_content_type":"text/x-python","patch_set":6,"id":"AAAATn%2F9Iao%3D","line":948,"updated":"2013-12-16 14:42:28.000000000","message":"same as the above","commit_id":"59d8764c4cfc94d2b404bbd89eb72333f78eb627"},{"author":{"_account_id":261,"name":"Salvatore Orlando","email":"salv.orlando@gmail.com","username":"salvatore-orlando"},"change_message_id":"e483308e35278ee604a78b5574409bd31bdbf005","unresolved":false,"context_lines":[{"line_number":945,"context_line":"                    self.plugin_rpc.update_device_up("},{"line_number":946,"context_line":"                        self.context, device, self.agent_id, cfg.CONF.host)"},{"line_number":947,"context_line":"                else:"},{"line_number":948,"context_line":"                    LOG.debug(_(\"Setting status for:%s to DOWN\"), device)"},{"line_number":949,"context_line":"                    self.plugin_rpc.update_device_down("},{"line_number":950,"context_line":"                        self.context, device, self.agent_id, cfg.CONF.host)"},{"line_number":951,"context_line":"            else:"}],"source_content_type":"text/x-python","patch_set":6,"id":"AAAATn%2F9G3E%3D","line":948,"in_reply_to":"AAAATn%2F9Iao%3D","updated":"2013-12-16 18:30:05.000000000","message":"well, I think you now realize how much I love colons!","commit_id":"59d8764c4cfc94d2b404bbd89eb72333f78eb627"},{"author":{"_account_id":2733,"name":"Darragh O\u0027Reilly","email":"doreilly@suse.com","username":"darragh-oreilly"},"change_message_id":"7ff2ce23b528665b2d97c5e3d93105ce56e663e4","unresolved":false,"context_lines":[{"line_number":819,"context_line":"        updated_ports_missing \u003d set()"},{"line_number":820,"context_line":"        if updated_ports:"},{"line_number":821,"context_line":"            # Filter out updated ports which are not anymore in"},{"line_number":822,"context_line":"            # port_info, as they were removed in the meanwhile."},{"line_number":823,"context_line":"            # Store missing ports to be sure they will be removed"},{"line_number":824,"context_line":"            updated_ports \u003d updated_ports \u0026 ports"},{"line_number":825,"context_line":"            port_info[\u0027updated\u0027] \u003d updated_ports"}],"source_content_type":"text/x-python","patch_set":7,"id":"AAAATn%2F9GIA%3D","line":822,"updated":"2013-12-16 21:22:58.000000000","message":"this comment is difficult to understand.","commit_id":"a2bfaf55ee49239edc4008680e75a9c0c9760782"},{"author":{"_account_id":261,"name":"Salvatore Orlando","email":"salv.orlando@gmail.com","username":"salvatore-orlando"},"change_message_id":"3194b82702750f6be20608e03641f3561c86ddcb","unresolved":false,"context_lines":[{"line_number":819,"context_line":"        updated_ports_missing \u003d set()"},{"line_number":820,"context_line":"        if updated_ports:"},{"line_number":821,"context_line":"            # Filter out updated ports which are not anymore in"},{"line_number":822,"context_line":"            # port_info, as they were removed in the meanwhile."},{"line_number":823,"context_line":"            # Store missing ports to be sure they will be removed"},{"line_number":824,"context_line":"            updated_ports \u003d updated_ports \u0026 ports"},{"line_number":825,"context_line":"            port_info[\u0027updated\u0027] \u003d updated_ports"}],"source_content_type":"text/x-python","patch_set":7,"id":"AAAATn%2F9FOI%3D","line":822,"in_reply_to":"AAAATn%2F9GIA%3D","updated":"2013-12-16 23:43:06.000000000","message":"I will rephrase it (but it would generally help if you point out how you would like to see it simplified)","commit_id":"a2bfaf55ee49239edc4008680e75a9c0c9760782"},{"author":{"_account_id":2733,"name":"Darragh O\u0027Reilly","email":"doreilly@suse.com","username":"darragh-oreilly"},"change_message_id":"7ff2ce23b528665b2d97c5e3d93105ce56e663e4","unresolved":false,"context_lines":[{"line_number":820,"context_line":"        if updated_ports:"},{"line_number":821,"context_line":"            # Filter out updated ports which are not anymore in"},{"line_number":822,"context_line":"            # port_info, as they were removed in the meanwhile."},{"line_number":823,"context_line":"            # Store missing ports to be sure they will be removed"},{"line_number":824,"context_line":"            updated_ports \u003d updated_ports \u0026 ports"},{"line_number":825,"context_line":"            port_info[\u0027updated\u0027] \u003d updated_ports"},{"line_number":826,"context_line":""}],"source_content_type":"text/x-python","patch_set":7,"id":"AAAATn%2F9GGk%3D","line":823,"updated":"2013-12-16 21:22:58.000000000","message":"updated_ports_missing is no longer being used with this patchset","commit_id":"a2bfaf55ee49239edc4008680e75a9c0c9760782"},{"author":{"_account_id":261,"name":"Salvatore Orlando","email":"salv.orlando@gmail.com","username":"salvatore-orlando"},"change_message_id":"3194b82702750f6be20608e03641f3561c86ddcb","unresolved":false,"context_lines":[{"line_number":820,"context_line":"        if updated_ports:"},{"line_number":821,"context_line":"            # Filter out updated ports which are not anymore in"},{"line_number":822,"context_line":"            # port_info, as they were removed in the meanwhile."},{"line_number":823,"context_line":"            # Store missing ports to be sure they will be removed"},{"line_number":824,"context_line":"            updated_ports \u003d updated_ports \u0026 ports"},{"line_number":825,"context_line":"            port_info[\u0027updated\u0027] \u003d updated_ports"},{"line_number":826,"context_line":""}],"source_content_type":"text/x-python","patch_set":7,"id":"AAAATn%2F9FOM%3D","line":823,"in_reply_to":"AAAATn%2F9GGk%3D","updated":"2013-12-16 23:43:06.000000000","message":"Done","commit_id":"a2bfaf55ee49239edc4008680e75a9c0c9760782"},{"author":{"_account_id":6524,"name":"Henry Gessau","email":"HenryG@gessau.net","username":"gessau"},"change_message_id":"61cb4c09d6d7e0eaac054c0d5a97d612c4b86d96","unresolved":false,"context_lines":[{"line_number":822,"context_line":"            # port_info, as they were removed in the meanwhile."},{"line_number":823,"context_line":"            # Store missing ports to be sure they will be removed"},{"line_number":824,"context_line":"            updated_ports \u003d updated_ports \u0026 ports"},{"line_number":825,"context_line":"            port_info[\u0027updated\u0027] \u003d updated_ports"},{"line_number":826,"context_line":""},{"line_number":827,"context_line":"        if ports \u003d\u003d registered_ports and not updated_ports_missing:"},{"line_number":828,"context_line":"            # No added or removed ports to set, just return here"}],"source_content_type":"text/x-python","patch_set":7,"id":"AAAATn%2F9FJA%3D","line":825,"updated":"2013-12-17 00:13:00.000000000","message":"Theoretically this could be an empty set? As far as I can tell this will not cause a problem, but it might be better to not create an \u0027updated\u0027 entry if it is the empty set.","commit_id":"a2bfaf55ee49239edc4008680e75a9c0c9760782"},{"author":{"_account_id":261,"name":"Salvatore Orlando","email":"salv.orlando@gmail.com","username":"salvatore-orlando"},"change_message_id":"9e7baa6beafdf5c7e50fa859a4efbff3dff611ec","unresolved":false,"context_lines":[{"line_number":822,"context_line":"            # port_info, as they were removed in the meanwhile."},{"line_number":823,"context_line":"            # Store missing ports to be sure they will be removed"},{"line_number":824,"context_line":"            updated_ports \u003d updated_ports \u0026 ports"},{"line_number":825,"context_line":"            port_info[\u0027updated\u0027] \u003d updated_ports"},{"line_number":826,"context_line":""},{"line_number":827,"context_line":"        if ports \u003d\u003d registered_ports and not updated_ports_missing:"},{"line_number":828,"context_line":"            # No added or removed ports to set, just return here"}],"source_content_type":"text/x-python","patch_set":7,"id":"AAAATn%2F9E%2Bg%3D","line":825,"in_reply_to":"AAAATn%2F9FJA%3D","updated":"2013-12-17 00:58:11.000000000","message":"I\u0027ll do as you suggest, but, as you say, it won\u0027t create a problem as the caller treats an empty set and a missing set in the same way.","commit_id":"a2bfaf55ee49239edc4008680e75a9c0c9760782"},{"author":{"_account_id":6524,"name":"Henry Gessau","email":"HenryG@gessau.net","username":"gessau"},"change_message_id":"f3368aba67c4ea65879f156b3fa329af235a8e5c","unresolved":false,"context_lines":[{"line_number":831,"context_line":"        port_info[\u0027added\u0027] \u003d ports - registered_ports"},{"line_number":832,"context_line":"        # Remove all the known ports not found on the integration bridge"},{"line_number":833,"context_line":"        port_info[\u0027removed\u0027] \u003d registered_ports - ports"},{"line_number":834,"context_line":"        return port_info"},{"line_number":835,"context_line":""},{"line_number":836,"context_line":"    def update_ancillary_ports(self, registered_ports):"},{"line_number":837,"context_line":"        ports \u003d set()"}],"source_content_type":"text/x-python","patch_set":7,"id":"AAAATn%2F9FM0%3D","line":834,"updated":"2013-12-16 23:55:01.000000000","message":"Following up on Darragh\u0027s comments, you could use descriptive variable names and make this method compact and easy to follow. E.g.\n\n    def scan_ports(self, registered_ports, updated_ports\u003dNone):\n        bridge_ports \u003d self.int_br.get_vif_port_set()\n        # TODO(salv-orlando): Consider moving the following statement\n        # out of this method to avoid side effects\n        self.int_br_device_count \u003d len(bridge_ports or [])\n        port_info \u003d {\u0027current\u0027: bridge_ports}\n        if updated_ports:\n            # Filter out updated ports which are not on the bridge\n            port_info[\u0027updated\u0027] \u003d updated_ports \u0026 bridge_ports\n        if bridge_ports !\u003d registered_ports:\n            port_info[\u0027added\u0027] \u003d bridge_ports - registered_ports\n            port_info[\u0027removed\u0027] \u003d registered_ports - bridge_ports\n        return port_info","commit_id":"a2bfaf55ee49239edc4008680e75a9c0c9760782"},{"author":{"_account_id":2733,"name":"Darragh O\u0027Reilly","email":"doreilly@suse.com","username":"darragh-oreilly"},"change_message_id":"7ff2ce23b528665b2d97c5e3d93105ce56e663e4","unresolved":false,"context_lines":[{"line_number":912,"context_line":"    def treat_devices_added_or_updated(self, devices):"},{"line_number":913,"context_line":"        resync \u003d False"},{"line_number":914,"context_line":"        for device in devices:"},{"line_number":915,"context_line":"            LOG.info(_(\"Processing port:%s\"), device)"},{"line_number":916,"context_line":"            try:"},{"line_number":917,"context_line":"                # TODO(salv-orlando): Provide bulk API for retrieving"},{"line_number":918,"context_line":"                # details for all devices in one call"}],"source_content_type":"text/x-python","patch_set":7,"id":"AAAATn%2F9GGE%3D","line":915,"updated":"2013-12-16 21:22:58.000000000","message":"does this need to be at level INFO?","commit_id":"a2bfaf55ee49239edc4008680e75a9c0c9760782"},{"author":{"_account_id":261,"name":"Salvatore Orlando","email":"salv.orlando@gmail.com","username":"salvatore-orlando"},"change_message_id":"3194b82702750f6be20608e03641f3561c86ddcb","unresolved":false,"context_lines":[{"line_number":912,"context_line":"    def treat_devices_added_or_updated(self, devices):"},{"line_number":913,"context_line":"        resync \u003d False"},{"line_number":914,"context_line":"        for device in devices:"},{"line_number":915,"context_line":"            LOG.info(_(\"Processing port:%s\"), device)"},{"line_number":916,"context_line":"            try:"},{"line_number":917,"context_line":"                # TODO(salv-orlando): Provide bulk API for retrieving"},{"line_number":918,"context_line":"                # details for all devices in one call"}],"source_content_type":"text/x-python","patch_set":7,"id":"AAAATn%2F9FOA%3D","line":915,"in_reply_to":"AAAATn%2F9GGE%3D","updated":"2013-12-16 23:43:06.000000000","message":"It was INFO and I kept at the same level, but  I guess it can be downgraded to debug - no big deal.","commit_id":"a2bfaf55ee49239edc4008680e75a9c0c9760782"},{"author":{"_account_id":6524,"name":"Henry Gessau","email":"HenryG@gessau.net","username":"gessau"},"change_message_id":"6a5c500ab94c54c2494b58ddea5a11fef412a1c0","unresolved":false,"context_lines":[{"line_number":821,"context_line":"            # meanwhile, and therefore should not be processed."},{"line_number":822,"context_line":"            # In this case the updated port won\u0027t be found among"},{"line_number":823,"context_line":"            # current ports."},{"line_number":824,"context_line":"            updated_ports \u003d updated_ports \u0026 cur_ports"},{"line_number":825,"context_line":"            if updated_ports:"},{"line_number":826,"context_line":"                port_info[\u0027updated\u0027] \u003d updated_ports"},{"line_number":827,"context_line":""}],"source_content_type":"text/x-python","patch_set":8,"id":"AAAATn%2F9Ez4%3D","line":824,"updated":"2013-12-17 02:16:38.000000000","message":"This can be moved to line 818.","commit_id":"b6b7b8d37fb656488aae694938a99eaa0131f199"},{"author":{"_account_id":261,"name":"Salvatore Orlando","email":"salv.orlando@gmail.com","username":"salvatore-orlando"},"change_message_id":"e8696c7c0a0e58e78950061c9ae7a23c27230dca","unresolved":false,"context_lines":[{"line_number":821,"context_line":"            # meanwhile, and therefore should not be processed."},{"line_number":822,"context_line":"            # In this case the updated port won\u0027t be found among"},{"line_number":823,"context_line":"            # current ports."},{"line_number":824,"context_line":"            updated_ports \u003d updated_ports \u0026 cur_ports"},{"line_number":825,"context_line":"            if updated_ports:"},{"line_number":826,"context_line":"                port_info[\u0027updated\u0027] \u003d updated_ports"},{"line_number":827,"context_line":""}],"source_content_type":"text/x-python","patch_set":8,"id":"AAAATn%2F9Dvk%3D","line":824,"in_reply_to":"AAAATn%2F9Ez4%3D","updated":"2013-12-17 07:40:55.000000000","message":"I think it will crash if updated_ports is None:\n\n\u003e\u003e\u003e updated_ports\u003dNone\n\u003e\u003e\u003e \n\u003e\u003e\u003e cur_ports \u003d set([3])\n\u003e\u003e\u003e cur_ports \u0026 updated_ports\nTraceback (most recent call last):\n  File \"\u003cstdin\u003e\", line 1, in \u003cmodule\u003e\nTypeError: unsupported operand type(s) for \u0026: \u0027set\u0027 and \u0027NoneType\u0027","commit_id":"b6b7b8d37fb656488aae694938a99eaa0131f199"},{"author":{"_account_id":2733,"name":"Darragh O\u0027Reilly","email":"doreilly@suse.com","username":"darragh-oreilly"},"change_message_id":"ac87bae5cf0cbd305c6c69a08a2b93831eaffe4c","unresolved":false,"context_lines":[{"line_number":294,"context_line":""},{"line_number":295,"context_line":"    def port_update(self, context, **kwargs):"},{"line_number":296,"context_line":"        port \u003d kwargs.get(\u0027port\u0027)"},{"line_number":297,"context_line":"        LOG.debug(_(\"port_update received for port %s\"), port[\u0027id\u0027])"},{"line_number":298,"context_line":"        # Put the port identifier in the updated_ports set."},{"line_number":299,"context_line":"        # Do not store port details, as if they\u0027re used for processing"},{"line_number":300,"context_line":"        # notifications there is no guarantee the notifications are"}],"source_content_type":"text/x-python","patch_set":11,"id":"AAAATn%2F87ZI%3D","line":297,"updated":"2013-12-18 18:29:36.000000000","message":"Maybe this LOG.debug() should be moved to after the self.updated_ports.add(port[\u0027id\u0027]) call. The disk io provides a chance for greenthread switching. Suppose the main loop thread was waiting to be rescheduled near its read self.updated_ports line. It probably doesn\u0027t matter as the update will be picked up by the following loop iteration anyway. But it may cause slightly different behaviour in the Jenkins/Tempest tests with debug enabled than production systems where it would be disabled.","commit_id":"96d0f7ae297906609edf7ca29da4f677bcfc629f"},{"author":{"_account_id":261,"name":"Salvatore Orlando","email":"salv.orlando@gmail.com","username":"salvatore-orlando"},"change_message_id":"0ba32d7ec4a6bb268a6f2adfeaaac16d289bd439","unresolved":false,"context_lines":[{"line_number":294,"context_line":""},{"line_number":295,"context_line":"    def port_update(self, context, **kwargs):"},{"line_number":296,"context_line":"        port \u003d kwargs.get(\u0027port\u0027)"},{"line_number":297,"context_line":"        LOG.debug(_(\"port_update received for port %s\"), port[\u0027id\u0027])"},{"line_number":298,"context_line":"        # Put the port identifier in the updated_ports set."},{"line_number":299,"context_line":"        # Do not store port details, as if they\u0027re used for processing"},{"line_number":300,"context_line":"        # notifications there is no guarantee the notifications are"}],"source_content_type":"text/x-python","patch_set":11,"id":"AAAATn%2F85eg%3D","line":297,"in_reply_to":"AAAATn%2F87ZI%3D","updated":"2013-12-19 01:52:25.000000000","message":"Done","commit_id":"96d0f7ae297906609edf7ca29da4f677bcfc629f"},{"author":{"_account_id":6598,"name":"Berezovsky Irena","email":"irenab.dev@gmail.com","username":"irenab"},"change_message_id":"d91f9615676ba09c15c6b5124a9a604228cabdde","unresolved":false,"context_lines":[{"line_number":815,"context_line":"        # out of this method to avoid side effects"},{"line_number":816,"context_line":"        self.int_br_device_count \u003d len(cur_ports or [])"},{"line_number":817,"context_line":"        port_info \u003d {\u0027current\u0027: cur_ports}"},{"line_number":818,"context_line":"        # If there are updated ports, process them"},{"line_number":819,"context_line":"        if updated_ports:"},{"line_number":820,"context_line":"            # Some updated ports might have been removed in the"},{"line_number":821,"context_line":"            # meanwhile, and therefore should not be processed."}],"source_content_type":"text/x-python","patch_set":11,"id":"AAAATn%2F86gU%3D","line":818,"updated":"2013-12-18 21:23:37.000000000","message":"This comment seems not accurate. There is no ports processing here, just update of the port_info","commit_id":"96d0f7ae297906609edf7ca29da4f677bcfc629f"},{"author":{"_account_id":261,"name":"Salvatore Orlando","email":"salv.orlando@gmail.com","username":"salvatore-orlando"},"change_message_id":"0ba32d7ec4a6bb268a6f2adfeaaac16d289bd439","unresolved":false,"context_lines":[{"line_number":815,"context_line":"        # out of this method to avoid side effects"},{"line_number":816,"context_line":"        self.int_br_device_count \u003d len(cur_ports or [])"},{"line_number":817,"context_line":"        port_info \u003d {\u0027current\u0027: cur_ports}"},{"line_number":818,"context_line":"        # If there are updated ports, process them"},{"line_number":819,"context_line":"        if updated_ports:"},{"line_number":820,"context_line":"            # Some updated ports might have been removed in the"},{"line_number":821,"context_line":"            # meanwhile, and therefore should not be processed."}],"source_content_type":"text/x-python","patch_set":11,"id":"AAAATn%2F85ew%3D","line":818,"in_reply_to":"AAAATn%2F86gU%3D","updated":"2013-12-19 01:52:25.000000000","message":"Done","commit_id":"96d0f7ae297906609edf7ca29da4f677bcfc629f"},{"author":{"_account_id":333,"name":"Isaku Yamahata","email":"isaku.yamahata@gmail.com","username":"yamahata"},"change_message_id":"4e37e41d3f4643721f1dfa5d34b015bbb06650d5","unresolved":false,"context_lines":[{"line_number":813,"context_line":"        cur_ports \u003d self.int_br.get_vif_port_set()"},{"line_number":814,"context_line":"        # TODO(salv-orlando): Consider moving the following statement"},{"line_number":815,"context_line":"        # out of this method to avoid side effects"},{"line_number":816,"context_line":"        self.int_br_device_count \u003d len(cur_ports or [])"},{"line_number":817,"context_line":"        port_info \u003d {\u0027current\u0027: cur_ports}"},{"line_number":818,"context_line":"        if updated_ports:"},{"line_number":819,"context_line":"            # Some updated ports might have been removed in the"}],"source_content_type":"text/x-python","patch_set":13,"id":"AAAAUH%2F%2F9F4%3D","line":816,"updated":"2014-01-06 09:29:05.000000000","message":"nitpick: get_vif_port_set() always return set. doesn\u0027t return None.\nmock in unittests needs to be fixed though.","commit_id":"e5ef5942560893df00e2e0becaa6c119ed6bb2ee"},{"author":{"_account_id":261,"name":"Salvatore Orlando","email":"salv.orlando@gmail.com","username":"salvatore-orlando"},"change_message_id":"95ef8ebe03f13701601bdaa7c4709099a154b900","unresolved":false,"context_lines":[{"line_number":813,"context_line":"        cur_ports \u003d self.int_br.get_vif_port_set()"},{"line_number":814,"context_line":"        # TODO(salv-orlando): Consider moving the following statement"},{"line_number":815,"context_line":"        # out of this method to avoid side effects"},{"line_number":816,"context_line":"        self.int_br_device_count \u003d len(cur_ports or [])"},{"line_number":817,"context_line":"        port_info \u003d {\u0027current\u0027: cur_ports}"},{"line_number":818,"context_line":"        if updated_ports:"},{"line_number":819,"context_line":"            # Some updated ports might have been removed in the"}],"source_content_type":"text/x-python","patch_set":13,"id":"AAAAUH%2F%2F6uA%3D","line":816,"in_reply_to":"AAAAUH%2F%2F9F4%3D","updated":"2014-01-06 20:13:34.000000000","message":"You\u0027re right but I wonder if I did this there should be a reason...","commit_id":"e5ef5942560893df00e2e0becaa6c119ed6bb2ee"},{"author":{"_account_id":333,"name":"Isaku Yamahata","email":"isaku.yamahata@gmail.com","username":"yamahata"},"change_message_id":"4e37e41d3f4643721f1dfa5d34b015bbb06650d5","unresolved":false,"context_lines":[{"line_number":1118,"context_line":"        while True:"},{"line_number":1119,"context_line":"            try:"},{"line_number":1120,"context_line":"                start \u003d time.time()"},{"line_number":1121,"context_line":"                port_stats \u003d {\u0027regular\u0027: {\u0027added\u0027: 0, \u0027removed\u0027: 0},"},{"line_number":1122,"context_line":"                              \u0027ancillary\u0027: {\u0027added\u0027: 0, \u0027removed\u0027: 0}}"},{"line_number":1123,"context_line":"                LOG.debug(_(\"Agent rpc_loop - iteration:%d started\"),"},{"line_number":1124,"context_line":"                          self.iter_num)"}],"source_content_type":"text/x-python","patch_set":13,"id":"AAAAUH%2F%2F9CI%3D","line":1121,"updated":"2014-01-06 09:29:05.000000000","message":"\u0027updated\u0027: 0 as line 1167 just for consistency.","commit_id":"e5ef5942560893df00e2e0becaa6c119ed6bb2ee"},{"author":{"_account_id":261,"name":"Salvatore Orlando","email":"salv.orlando@gmail.com","username":"salvatore-orlando"},"change_message_id":"95ef8ebe03f13701601bdaa7c4709099a154b900","unresolved":false,"context_lines":[{"line_number":1118,"context_line":"        while True:"},{"line_number":1119,"context_line":"            try:"},{"line_number":1120,"context_line":"                start \u003d time.time()"},{"line_number":1121,"context_line":"                port_stats \u003d {\u0027regular\u0027: {\u0027added\u0027: 0, \u0027removed\u0027: 0},"},{"line_number":1122,"context_line":"                              \u0027ancillary\u0027: {\u0027added\u0027: 0, \u0027removed\u0027: 0}}"},{"line_number":1123,"context_line":"                LOG.debug(_(\"Agent rpc_loop - iteration:%d started\"),"},{"line_number":1124,"context_line":"                          self.iter_num)"}],"source_content_type":"text/x-python","patch_set":13,"id":"AAAAUH%2F%2F6t8%3D","line":1121,"in_reply_to":"AAAAUH%2F%2F9CI%3D","updated":"2014-01-06 20:13:34.000000000","message":"Done","commit_id":"e5ef5942560893df00e2e0becaa6c119ed6bb2ee"},{"author":{"_account_id":333,"name":"Isaku Yamahata","email":"isaku.yamahata@gmail.com","username":"yamahata"},"change_message_id":"4e37e41d3f4643721f1dfa5d34b015bbb06650d5","unresolved":false,"context_lines":[{"line_number":1197,"context_line":""},{"line_number":1198,"context_line":"            except Exception:"},{"line_number":1199,"context_line":"                LOG.exception(_(\"Error in agent event loop\"))"},{"line_number":1200,"context_line":"                if updated_ports_copy:"},{"line_number":1201,"context_line":"                    # Put the ports back in self.updated_port"},{"line_number":1202,"context_line":"                    self.updated_ports |\u003d updated_ports_copy"},{"line_number":1203,"context_line":""}],"source_content_type":"text/x-python","patch_set":13,"id":"AAAAUH%2F%2F9As%3D","line":1200,"updated":"2014-01-06 09:29:05.000000000","message":"This line can be removed because \"|\u003d set()\" is nop.\nIt\u0027s just a matter of taste and I\u0027m not sure which is faster.","commit_id":"e5ef5942560893df00e2e0becaa6c119ed6bb2ee"},{"author":{"_account_id":261,"name":"Salvatore Orlando","email":"salv.orlando@gmail.com","username":"salvatore-orlando"},"change_message_id":"95ef8ebe03f13701601bdaa7c4709099a154b900","unresolved":false,"context_lines":[{"line_number":1197,"context_line":""},{"line_number":1198,"context_line":"            except Exception:"},{"line_number":1199,"context_line":"                LOG.exception(_(\"Error in agent event loop\"))"},{"line_number":1200,"context_line":"                if updated_ports_copy:"},{"line_number":1201,"context_line":"                    # Put the ports back in self.updated_port"},{"line_number":1202,"context_line":"                    self.updated_ports |\u003d updated_ports_copy"},{"line_number":1203,"context_line":""}],"source_content_type":"text/x-python","patch_set":13,"id":"AAAAUH%2F%2F6to%3D","line":1200,"in_reply_to":"AAAAUH%2F%2F9As%3D","updated":"2014-01-06 20:13:34.000000000","message":"Done","commit_id":"e5ef5942560893df00e2e0becaa6c119ed6bb2ee"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"34e6235cc1f38af0bec6d2c4015455a66e17b299","unresolved":false,"context_lines":[{"line_number":820,"context_line":"            # meanwhile, and therefore should not be processed."},{"line_number":821,"context_line":"            # In this case the updated port won\u0027t be found among"},{"line_number":822,"context_line":"            # current ports."},{"line_number":823,"context_line":"            updated_ports \u003d updated_ports \u0026 cur_ports"},{"line_number":824,"context_line":"            if updated_ports:"},{"line_number":825,"context_line":"                port_info[\u0027updated\u0027] \u003d updated_ports"},{"line_number":826,"context_line":""}],"source_content_type":"text/x-python","patch_set":14,"id":"AAAAUH%2F%2F2g0%3D","line":823,"updated":"2014-01-07 17:36:36.000000000","message":"Nit: updated_ports \u0026\u003d","commit_id":"45b563a501fc915d09e0dbf3c42641d51d69a143"},{"author":{"_account_id":261,"name":"Salvatore Orlando","email":"salv.orlando@gmail.com","username":"salvatore-orlando"},"change_message_id":"69332217f812997d9927c3c52c965cf19e670770","unresolved":false,"context_lines":[{"line_number":820,"context_line":"            # meanwhile, and therefore should not be processed."},{"line_number":821,"context_line":"            # In this case the updated port won\u0027t be found among"},{"line_number":822,"context_line":"            # current ports."},{"line_number":823,"context_line":"            updated_ports \u003d updated_ports \u0026 cur_ports"},{"line_number":824,"context_line":"            if updated_ports:"},{"line_number":825,"context_line":"                port_info[\u0027updated\u0027] \u003d updated_ports"},{"line_number":826,"context_line":""}],"source_content_type":"text/x-python","patch_set":14,"id":"AAAAUH%2F%2Fwwc%3D","line":823,"in_reply_to":"AAAAUH%2F%2F2g0%3D","updated":"2014-01-08 19:03:31.000000000","message":"Done","commit_id":"45b563a501fc915d09e0dbf3c42641d51d69a143"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"34e6235cc1f38af0bec6d2c4015455a66e17b299","unresolved":false,"context_lines":[{"line_number":826,"context_line":""},{"line_number":827,"context_line":"        if cur_ports \u003d\u003d registered_ports:"},{"line_number":828,"context_line":"            # No added or removed ports to set, just return here"},{"line_number":829,"context_line":"            return port_info"},{"line_number":830,"context_line":""},{"line_number":831,"context_line":"        port_info[\u0027added\u0027] \u003d cur_ports - registered_ports"},{"line_number":832,"context_line":"        # Remove all the known ports not found on the integration bridge"}],"source_content_type":"text/x-python","patch_set":14,"id":"AAAAUH%2F%2F2cA%3D","line":829,"updated":"2014-01-07 17:36:36.000000000","message":"The value of returning here is dubious.  The test is only true if there is neither added nor removed ports.  If either is non-empty then both are added to port_info.\n\nThe only value is if it is far more common that there are none added nor removed and this saves one set operation below.\n\nIf this test were removed then other code maybe wouldn\u0027t have to worry about testing \"if \u0027added\u0027 in port_info\".","commit_id":"45b563a501fc915d09e0dbf3c42641d51d69a143"},{"author":{"_account_id":261,"name":"Salvatore Orlando","email":"salv.orlando@gmail.com","username":"salvatore-orlando"},"change_message_id":"69332217f812997d9927c3c52c965cf19e670770","unresolved":false,"context_lines":[{"line_number":826,"context_line":""},{"line_number":827,"context_line":"        if cur_ports \u003d\u003d registered_ports:"},{"line_number":828,"context_line":"            # No added or removed ports to set, just return here"},{"line_number":829,"context_line":"            return port_info"},{"line_number":830,"context_line":""},{"line_number":831,"context_line":"        port_info[\u0027added\u0027] \u003d cur_ports - registered_ports"},{"line_number":832,"context_line":"        # Remove all the known ports not found on the integration bridge"}],"source_content_type":"text/x-python","patch_set":14,"id":"AAAAUH%2F%2Fwx0%3D","line":829,"in_reply_to":"AAAAUH%2F%2F2cA%3D","updated":"2014-01-08 19:03:31.000000000","message":"This has little value, agreed.\nI tried to respect the original logic as much as possible when it was unrelated to the change in this patch.\n\nI can do it in a follow up patch - and to this aim I will file a low-hanging-fruit bug as soon as this patch merge.","commit_id":"45b563a501fc915d09e0dbf3c42641d51d69a143"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"34e6235cc1f38af0bec6d2c4015455a66e17b299","unresolved":false,"context_lines":[{"line_number":831,"context_line":"        port_info[\u0027added\u0027] \u003d cur_ports - registered_ports"},{"line_number":832,"context_line":"        # Remove all the known ports not found on the integration bridge"},{"line_number":833,"context_line":"        port_info[\u0027removed\u0027] \u003d registered_ports - cur_ports"},{"line_number":834,"context_line":"        return port_info"},{"line_number":835,"context_line":""},{"line_number":836,"context_line":"    def update_ancillary_ports(self, registered_ports):"},{"line_number":837,"context_line":"        ports \u003d set()"}],"source_content_type":"text/x-python","patch_set":14,"id":"AAAAUH%2F%2F2aw%3D","line":834,"updated":"2014-01-07 17:36:36.000000000","message":"If the return above came out this could be:\n\nreturn {\u0027current\u0027: cur_ports,\n\u0027updated\u0027: updated_ports,\n\u0027added\u0027: cur_ports - registered_ports,\n\u0027removed\u0027: registered_ports - cur_ports}\n\nOr some such.  Might be a little simpler, more readable.","commit_id":"45b563a501fc915d09e0dbf3c42641d51d69a143"},{"author":{"_account_id":261,"name":"Salvatore Orlando","email":"salv.orlando@gmail.com","username":"salvatore-orlando"},"change_message_id":"69332217f812997d9927c3c52c965cf19e670770","unresolved":false,"context_lines":[{"line_number":831,"context_line":"        port_info[\u0027added\u0027] \u003d cur_ports - registered_ports"},{"line_number":832,"context_line":"        # Remove all the known ports not found on the integration bridge"},{"line_number":833,"context_line":"        port_info[\u0027removed\u0027] \u003d registered_ports - cur_ports"},{"line_number":834,"context_line":"        return port_info"},{"line_number":835,"context_line":""},{"line_number":836,"context_line":"    def update_ancillary_ports(self, registered_ports):"},{"line_number":837,"context_line":"        ports \u003d set()"}],"source_content_type":"text/x-python","patch_set":14,"id":"AAAAUH%2F%2Fwxc%3D","line":834,"in_reply_to":"AAAAUH%2F%2F2aw%3D","updated":"2014-01-08 19:03:31.000000000","message":"might be. I would defer it to another patch if you agree.\n\nfor the reasons exposed above (not because I\u0027m lazy!)","commit_id":"45b563a501fc915d09e0dbf3c42641d51d69a143"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"34e6235cc1f38af0bec6d2c4015455a66e17b299","unresolved":false,"context_lines":[{"line_number":1054,"context_line":"        resync_b \u003d False"},{"line_number":1055,"context_line":"        # TODO(salv-orlando): refactor repeated code in process_networks_ports"},{"line_number":1056,"context_line":"        # and process_ancillary_network_ports"},{"line_number":1057,"context_line":"        if \u0027added\u0027 in port_info:"},{"line_number":1058,"context_line":"            start \u003d time.time()"},{"line_number":1059,"context_line":"            resync_a \u003d self.treat_ancillary_devices_added(port_info[\u0027added\u0027])"},{"line_number":1060,"context_line":"            LOG.debug(_(\"process_ancillary_network_ports - iteration: \""}],"source_content_type":"text/x-python","patch_set":14,"id":"AAAAUH%2F%2F2Z4%3D","line":1057,"updated":"2014-01-07 17:36:36.000000000","message":"port_info[\u0027added\u0027] could be present but an empty set.  Would it be worth it to test \"if port_info.get(\u0027added\u0027):\"","commit_id":"45b563a501fc915d09e0dbf3c42641d51d69a143"},{"author":{"_account_id":261,"name":"Salvatore Orlando","email":"salv.orlando@gmail.com","username":"salvatore-orlando"},"change_message_id":"69332217f812997d9927c3c52c965cf19e670770","unresolved":false,"context_lines":[{"line_number":1054,"context_line":"        resync_b \u003d False"},{"line_number":1055,"context_line":"        # TODO(salv-orlando): refactor repeated code in process_networks_ports"},{"line_number":1056,"context_line":"        # and process_ancillary_network_ports"},{"line_number":1057,"context_line":"        if \u0027added\u0027 in port_info:"},{"line_number":1058,"context_line":"            start \u003d time.time()"},{"line_number":1059,"context_line":"            resync_a \u003d self.treat_ancillary_devices_added(port_info[\u0027added\u0027])"},{"line_number":1060,"context_line":"            LOG.debug(_(\"process_ancillary_network_ports - iteration: \""}],"source_content_type":"text/x-python","patch_set":14,"id":"AAAAUH%2F%2FwwU%3D","line":1057,"in_reply_to":"AAAAUH%2F%2F2Z4%3D","updated":"2014-01-08 19:03:31.000000000","message":"Done","commit_id":"45b563a501fc915d09e0dbf3c42641d51d69a143"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"34e6235cc1f38af0bec6d2c4015455a66e17b299","unresolved":false,"context_lines":[{"line_number":1062,"context_line":"                        \"completed in %(elapsed).3f\"),"},{"line_number":1063,"context_line":"                      {\u0027iter_num\u0027: self.iter_num,"},{"line_number":1064,"context_line":"                       \u0027elapsed\u0027: time.time() - start})"},{"line_number":1065,"context_line":"        if \u0027removed\u0027 in port_info:"},{"line_number":1066,"context_line":"            start \u003d time.time()"},{"line_number":1067,"context_line":"            resync_b \u003d self.treat_ancillary_devices_removed("},{"line_number":1068,"context_line":"                port_info[\u0027removed\u0027])"}],"source_content_type":"text/x-python","patch_set":14,"id":"AAAAUH%2F%2F2Z0%3D","line":1065,"updated":"2014-01-07 17:36:36.000000000","message":"Same as line 1057","commit_id":"45b563a501fc915d09e0dbf3c42641d51d69a143"},{"author":{"_account_id":261,"name":"Salvatore Orlando","email":"salv.orlando@gmail.com","username":"salvatore-orlando"},"change_message_id":"69332217f812997d9927c3c52c965cf19e670770","unresolved":false,"context_lines":[{"line_number":1062,"context_line":"                        \"completed in %(elapsed).3f\"),"},{"line_number":1063,"context_line":"                      {\u0027iter_num\u0027: self.iter_num,"},{"line_number":1064,"context_line":"                       \u0027elapsed\u0027: time.time() - start})"},{"line_number":1065,"context_line":"        if \u0027removed\u0027 in port_info:"},{"line_number":1066,"context_line":"            start \u003d time.time()"},{"line_number":1067,"context_line":"            resync_b \u003d self.treat_ancillary_devices_removed("},{"line_number":1068,"context_line":"                port_info[\u0027removed\u0027])"}],"source_content_type":"text/x-python","patch_set":14,"id":"AAAAUH%2F%2FwwQ%3D","line":1065,"in_reply_to":"AAAAUH%2F%2F2Z0%3D","updated":"2014-01-08 19:03:31.000000000","message":"Done","commit_id":"45b563a501fc915d09e0dbf3c42641d51d69a143"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"34e6235cc1f38af0bec6d2c4015455a66e17b299","unresolved":false,"context_lines":[{"line_number":1147,"context_line":"                    # between these two statements, this will should be"},{"line_number":1148,"context_line":"                    # thread-safe"},{"line_number":1149,"context_line":"                    updated_ports_copy \u003d self.updated_ports.copy()"},{"line_number":1150,"context_line":"                    self.updated_ports.clear()"},{"line_number":1151,"context_line":"                    port_info \u003d self.scan_ports(ports, updated_ports_copy)"},{"line_number":1152,"context_line":"                    ports \u003d port_info[\u0027current\u0027]"},{"line_number":1153,"context_line":"                    LOG.debug(_(\"Agent rpc_loop - iteration:%(iter_num)d - \""}],"source_content_type":"text/x-python","patch_set":14,"id":"AAAAUH%2F%2F53c%3D","line":1150,"updated":"2014-01-07 17:36:36.000000000","message":"Nit:  Maybe avoid a deep copy:\n\nupdated_ports_copy \u003d self.updated_ports\n\nself.updated_ports \u003d set()","commit_id":"45b563a501fc915d09e0dbf3c42641d51d69a143"},{"author":{"_account_id":261,"name":"Salvatore Orlando","email":"salv.orlando@gmail.com","username":"salvatore-orlando"},"change_message_id":"69332217f812997d9927c3c52c965cf19e670770","unresolved":false,"context_lines":[{"line_number":1147,"context_line":"                    # between these two statements, this will should be"},{"line_number":1148,"context_line":"                    # thread-safe"},{"line_number":1149,"context_line":"                    updated_ports_copy \u003d self.updated_ports.copy()"},{"line_number":1150,"context_line":"                    self.updated_ports.clear()"},{"line_number":1151,"context_line":"                    port_info \u003d self.scan_ports(ports, updated_ports_copy)"},{"line_number":1152,"context_line":"                    ports \u003d port_info[\u0027current\u0027]"},{"line_number":1153,"context_line":"                    LOG.debug(_(\"Agent rpc_loop - iteration:%(iter_num)d - \""}],"source_content_type":"text/x-python","patch_set":14,"id":"AAAAUH%2F%2Fwwo%3D","line":1150,"in_reply_to":"AAAAUH%2F%2F53c%3D","updated":"2014-01-08 19:03:31.000000000","message":"the copy does a shallow copy.\nI will do as you suggest anyway, as it seems better.\nI don\u0027t think this will cause any unexpected behaviour","commit_id":"45b563a501fc915d09e0dbf3c42641d51d69a143"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"34e6235cc1f38af0bec6d2c4015455a66e17b299","unresolved":false,"context_lines":[{"line_number":1157,"context_line":"                               \u0027elapsed\u0027: time.time() - start})"},{"line_number":1158,"context_line":"                    # notify plugin about port deltas"},{"line_number":1159,"context_line":"                    if self._port_info_has_changes(port_info):"},{"line_number":1160,"context_line":"                        LOG.debug(_(\"Starting processing devices in:%s\"),"},{"line_number":1161,"context_line":"                                  port_info)"},{"line_number":1162,"context_line":"                        # If treat devices fails - must resync with plugin"},{"line_number":1163,"context_line":"                        sync \u003d self.process_network_ports(port_info)"}],"source_content_type":"text/x-python","patch_set":14,"id":"AAAAUH%2F%2F55Q%3D","line":1160,"updated":"2014-01-07 17:36:36.000000000","message":"Nit: \"Starting processing\" probably should be \"Start processing\" or \"Starting to process\"","commit_id":"45b563a501fc915d09e0dbf3c42641d51d69a143"},{"author":{"_account_id":261,"name":"Salvatore Orlando","email":"salv.orlando@gmail.com","username":"salvatore-orlando"},"change_message_id":"69332217f812997d9927c3c52c965cf19e670770","unresolved":false,"context_lines":[{"line_number":1157,"context_line":"                               \u0027elapsed\u0027: time.time() - start})"},{"line_number":1158,"context_line":"                    # notify plugin about port deltas"},{"line_number":1159,"context_line":"                    if self._port_info_has_changes(port_info):"},{"line_number":1160,"context_line":"                        LOG.debug(_(\"Starting processing devices in:%s\"),"},{"line_number":1161,"context_line":"                                  port_info)"},{"line_number":1162,"context_line":"                        # If treat devices fails - must resync with plugin"},{"line_number":1163,"context_line":"                        sync \u003d self.process_network_ports(port_info)"}],"source_content_type":"text/x-python","patch_set":14,"id":"AAAAUH%2F%2Fwwg%3D","line":1160,"in_reply_to":"AAAAUH%2F%2F55Q%3D","updated":"2014-01-08 19:03:31.000000000","message":"I will fixing according to your advice ;)","commit_id":"45b563a501fc915d09e0dbf3c42641d51d69a143"},{"author":{"_account_id":6524,"name":"Henry Gessau","email":"HenryG@gessau.net","username":"gessau"},"change_message_id":"f7ac0a056c2599e5ae80499e73c117cc428a3ea9","unresolved":false,"context_lines":[{"line_number":297,"context_line":"        # Put the port identifier in the updated_ports set."},{"line_number":298,"context_line":"        # Do not store port details, as if they\u0027re used for processing"},{"line_number":299,"context_line":"        # notifications there is no guarantee the notifications are"},{"line_number":300,"context_line":"        # processed in the same order as the relevant API requests"},{"line_number":301,"context_line":"        self.updated_ports.add(port[\u0027id\u0027])"},{"line_number":302,"context_line":"        LOG.debug(_(\"port_update message processed for port %s\"), port[\u0027id\u0027])"},{"line_number":303,"context_line":""}],"source_content_type":"text/x-python","patch_set":17,"id":"AAAAUH%2F%2FvJE%3D","line":300,"updated":"2014-01-09 02:31:46.000000000","message":"Nit: feels like this comment is apologizing for history. Suggest:\n\n\"Here we simply accumulate the ports to be updated. The actual updates will be done in the next iteration of the rpc_loop().\"","commit_id":"85a40daf3e5d5aa3b3309f63f340b6490f28fb1f"},{"author":{"_account_id":6524,"name":"Henry Gessau","email":"HenryG@gessau.net","username":"gessau"},"change_message_id":"900ad41beea2e0db4298e963b4a9c46701e8a7e2","unresolved":false,"context_lines":[{"line_number":297,"context_line":"        # Put the port identifier in the updated_ports set."},{"line_number":298,"context_line":"        # Do not store port details, as if they\u0027re used for processing"},{"line_number":299,"context_line":"        # notifications there is no guarantee the notifications are"},{"line_number":300,"context_line":"        # processed in the same order as the relevant API requests"},{"line_number":301,"context_line":"        self.updated_ports.add(port[\u0027id\u0027])"},{"line_number":302,"context_line":"        LOG.debug(_(\"port_update message processed for port %s\"), port[\u0027id\u0027])"},{"line_number":303,"context_line":""}],"source_content_type":"text/x-python","patch_set":17,"id":"AAAAUH%2F%2Frp8%3D","line":300,"in_reply_to":"AAAAUH%2F%2Fr7w%3D","updated":"2014-01-09 17:00:48.000000000","message":"Ah, ok, I retract my comment.","commit_id":"85a40daf3e5d5aa3b3309f63f340b6490f28fb1f"},{"author":{"_account_id":261,"name":"Salvatore Orlando","email":"salv.orlando@gmail.com","username":"salvatore-orlando"},"change_message_id":"cda2c744707059949f5f13943170e2d97726fe32","unresolved":false,"context_lines":[{"line_number":297,"context_line":"        # Put the port identifier in the updated_ports set."},{"line_number":298,"context_line":"        # Do not store port details, as if they\u0027re used for processing"},{"line_number":299,"context_line":"        # notifications there is no guarantee the notifications are"},{"line_number":300,"context_line":"        # processed in the same order as the relevant API requests"},{"line_number":301,"context_line":"        self.updated_ports.add(port[\u0027id\u0027])"},{"line_number":302,"context_line":"        LOG.debug(_(\"port_update message processed for port %s\"), port[\u0027id\u0027])"},{"line_number":303,"context_line":""}],"source_content_type":"text/x-python","patch_set":17,"id":"AAAAUH%2F%2Fr7w%3D","line":300,"in_reply_to":"AAAAUH%2F%2FvJE%3D","updated":"2014-01-09 16:09:26.000000000","message":"the comment is actually explaining why we are not storing the details even if they\u0027re supplied among the paramaters.\nI will rephrase anyway.","commit_id":"85a40daf3e5d5aa3b3309f63f340b6490f28fb1f"},{"author":{"_account_id":6524,"name":"Henry Gessau","email":"HenryG@gessau.net","username":"gessau"},"change_message_id":"f7ac0a056c2599e5ae80499e73c117cc428a3ea9","unresolved":false,"context_lines":[{"line_number":812,"context_line":"    def scan_ports(self, registered_ports, updated_ports\u003dNone):"},{"line_number":813,"context_line":"        cur_ports \u003d self.int_br.get_vif_port_set()"},{"line_number":814,"context_line":"        # TODO(salv-orlando): Consider moving the following statement"},{"line_number":815,"context_line":"        # out of this method to avoid side effects"},{"line_number":816,"context_line":"        self.int_br_device_count \u003d len(cur_ports)"},{"line_number":817,"context_line":"        port_info \u003d {\u0027current\u0027: cur_ports}"},{"line_number":818,"context_line":"        if updated_ports:"}],"source_content_type":"text/x-python","patch_set":17,"id":"AAAAUH%2F%2FvA8%3D","line":815,"updated":"2014-01-09 02:31:46.000000000","message":"Can you put it at line 1154?","commit_id":"85a40daf3e5d5aa3b3309f63f340b6490f28fb1f"},{"author":{"_account_id":6524,"name":"Henry Gessau","email":"HenryG@gessau.net","username":"gessau"},"change_message_id":"f7ac0a056c2599e5ae80499e73c117cc428a3ea9","unresolved":false,"context_lines":[{"line_number":1146,"context_line":"                    # Save updated ports dict to perform rollback in"},{"line_number":1147,"context_line":"                    # case resync would be needed, and then clear"},{"line_number":1148,"context_line":"                    # self.updated_ports. As the greenthread should not yield"},{"line_number":1149,"context_line":"                    # between these two statements, this will should be"},{"line_number":1150,"context_line":"                    # thread-safe"},{"line_number":1151,"context_line":"                    updated_ports_copy \u003d self.updated_ports"},{"line_number":1152,"context_line":"                    self.updated_ports \u003d set()"}],"source_content_type":"text/x-python","patch_set":17,"id":"AAAAUH%2F%2FvEc%3D","line":1149,"updated":"2014-01-09 02:31:46.000000000","message":"Nit: \u0027will be thread-safe\u0027, or \u0027should be thread\u0027 safe? Please decide. :)","commit_id":"85a40daf3e5d5aa3b3309f63f340b6490f28fb1f"},{"author":{"_account_id":6659,"name":"Paul Michali","email":"pc@michali.net","username":"pcm"},"change_message_id":"20723b0f2c3b3ceb6aceaf0c12aeedf74c51971f","unresolved":false,"context_lines":[{"line_number":296,"context_line":"        port \u003d kwargs.get(\u0027port\u0027)"},{"line_number":297,"context_line":"        # Put the port identifier in the updated_ports set."},{"line_number":298,"context_line":"        # Even if full port details might be provided to this call,"},{"line_number":299,"context_line":"        # they are not used sincethere is no guarantee the notifications"},{"line_number":300,"context_line":"        # are processed in the same order as the relevant API requests"},{"line_number":301,"context_line":"        self.updated_ports.add(port[\u0027id\u0027])"},{"line_number":302,"context_line":"        LOG.debug(_(\"port_update message processed for port %s\"), port[\u0027id\u0027])"}],"source_content_type":"text/x-python","patch_set":18,"id":"AAAAUH%2F%2Fnd8%3D","line":299,"updated":"2014-01-10 13:05:51.000000000","message":"since there","commit_id":"9f5aeb7258905adf37a76f47a16c4559e75a86bf"},{"author":{"_account_id":261,"name":"Salvatore Orlando","email":"salv.orlando@gmail.com","username":"salvatore-orlando"},"change_message_id":"5ffde44f9089d7641aa823108c903f54d5f3fccc","unresolved":false,"context_lines":[{"line_number":296,"context_line":"        port \u003d kwargs.get(\u0027port\u0027)"},{"line_number":297,"context_line":"        # Put the port identifier in the updated_ports set."},{"line_number":298,"context_line":"        # Even if full port details might be provided to this call,"},{"line_number":299,"context_line":"        # they are not used sincethere is no guarantee the notifications"},{"line_number":300,"context_line":"        # are processed in the same order as the relevant API requests"},{"line_number":301,"context_line":"        self.updated_ports.add(port[\u0027id\u0027])"},{"line_number":302,"context_line":"        LOG.debug(_(\"port_update message processed for port %s\"), port[\u0027id\u0027])"}],"source_content_type":"text/x-python","patch_set":18,"id":"AAAAUH%2F%2FMPg%3D","line":299,"in_reply_to":"AAAAUH%2F%2Fnd8%3D","updated":"2014-01-16 16:00:50.000000000","message":"Done","commit_id":"9f5aeb7258905adf37a76f47a16c4559e75a86bf"},{"author":{"_account_id":2035,"name":"Maru Newby","email":"marun@redhat.com","username":"maru"},"change_message_id":"0bdc8fc5c15cbb0b154c27db2755e1a72e705da4","unresolved":false,"context_lines":[{"line_number":1054,"context_line":"        resync_b \u003d False"},{"line_number":1055,"context_line":"        # TODO(salv-orlando): refactor repeated code in process_networks_ports"},{"line_number":1056,"context_line":"        # and process_ancillary_network_ports"},{"line_number":1057,"context_line":"        if port_info.get(\u0027added\u0027):"},{"line_number":1058,"context_line":"            start \u003d time.time()"},{"line_number":1059,"context_line":"            resync_a \u003d self.treat_ancillary_devices_added(port_info[\u0027added\u0027])"},{"line_number":1060,"context_line":"            LOG.debug(_(\"process_ancillary_network_ports - iteration: \""}],"source_content_type":"text/x-python","patch_set":18,"id":"AAAAUH%2F%2FQb4%3D","line":1057,"updated":"2014-01-15 21:08:21.000000000","message":"(Suggestion only) Consider reverting this non-functional change","commit_id":"9f5aeb7258905adf37a76f47a16c4559e75a86bf"},{"author":{"_account_id":261,"name":"Salvatore Orlando","email":"salv.orlando@gmail.com","username":"salvatore-orlando"},"change_message_id":"5ffde44f9089d7641aa823108c903f54d5f3fccc","unresolved":false,"context_lines":[{"line_number":1054,"context_line":"        resync_b \u003d False"},{"line_number":1055,"context_line":"        # TODO(salv-orlando): refactor repeated code in process_networks_ports"},{"line_number":1056,"context_line":"        # and process_ancillary_network_ports"},{"line_number":1057,"context_line":"        if port_info.get(\u0027added\u0027):"},{"line_number":1058,"context_line":"            start \u003d time.time()"},{"line_number":1059,"context_line":"            resync_a \u003d self.treat_ancillary_devices_added(port_info[\u0027added\u0027])"},{"line_number":1060,"context_line":"            LOG.debug(_(\"process_ancillary_network_ports - iteration: \""}],"source_content_type":"text/x-python","patch_set":18,"id":"AAAAUH%2F%2FMOY%3D","line":1057,"in_reply_to":"AAAAUH%2F%2FQb4%3D","updated":"2014-01-16 16:00:50.000000000","message":"Done","commit_id":"9f5aeb7258905adf37a76f47a16c4559e75a86bf"},{"author":{"_account_id":2035,"name":"Maru Newby","email":"marun@redhat.com","username":"maru"},"change_message_id":"0bdc8fc5c15cbb0b154c27db2755e1a72e705da4","unresolved":false,"context_lines":[{"line_number":1062,"context_line":"                        \"completed in %(elapsed).3f\"),"},{"line_number":1063,"context_line":"                      {\u0027iter_num\u0027: self.iter_num,"},{"line_number":1064,"context_line":"                       \u0027elapsed\u0027: time.time() - start})"},{"line_number":1065,"context_line":"        if port_info.get(\u0027removed\u0027):"},{"line_number":1066,"context_line":"            start \u003d time.time()"},{"line_number":1067,"context_line":"            resync_b \u003d self.treat_ancillary_devices_removed("},{"line_number":1068,"context_line":"                port_info[\u0027removed\u0027])"}],"source_content_type":"text/x-python","patch_set":18,"id":"AAAAUH%2F%2FQb0%3D","line":1065,"updated":"2014-01-15 21:08:21.000000000","message":"(Suggestion only) Consider reverting this non-functional change","commit_id":"9f5aeb7258905adf37a76f47a16c4559e75a86bf"},{"author":{"_account_id":261,"name":"Salvatore Orlando","email":"salv.orlando@gmail.com","username":"salvatore-orlando"},"change_message_id":"5ffde44f9089d7641aa823108c903f54d5f3fccc","unresolved":false,"context_lines":[{"line_number":1062,"context_line":"                        \"completed in %(elapsed).3f\"),"},{"line_number":1063,"context_line":"                      {\u0027iter_num\u0027: self.iter_num,"},{"line_number":1064,"context_line":"                       \u0027elapsed\u0027: time.time() - start})"},{"line_number":1065,"context_line":"        if port_info.get(\u0027removed\u0027):"},{"line_number":1066,"context_line":"            start \u003d time.time()"},{"line_number":1067,"context_line":"            resync_b \u003d self.treat_ancillary_devices_removed("},{"line_number":1068,"context_line":"                port_info[\u0027removed\u0027])"}],"source_content_type":"text/x-python","patch_set":18,"id":"AAAAUH%2F%2FMOU%3D","line":1065,"in_reply_to":"AAAAUH%2F%2FQb0%3D","updated":"2014-01-16 16:00:50.000000000","message":"Thanks I think I have mixed up two commits.","commit_id":"9f5aeb7258905adf37a76f47a16c4559e75a86bf"},{"author":{"_account_id":2035,"name":"Maru Newby","email":"marun@redhat.com","username":"maru"},"change_message_id":"0bdc8fc5c15cbb0b154c27db2755e1a72e705da4","unresolved":false,"context_lines":[{"line_number":1200,"context_line":"            except Exception:"},{"line_number":1201,"context_line":"                LOG.exception(_(\"Error in agent event loop\"))"},{"line_number":1202,"context_line":"                # Put the ports back in self.updated_port"},{"line_number":1203,"context_line":"                self.updated_ports |\u003d updated_ports_copy"},{"line_number":1204,"context_line":""},{"line_number":1205,"context_line":"                sync \u003d True"},{"line_number":1206,"context_line":"                tunnel_sync \u003d True"}],"source_content_type":"text/x-python","patch_set":18,"id":"AAAAUH%2F%2FQMw%3D","line":1203,"updated":"2014-01-15 21:08:21.000000000","message":"If an error occurs in tunnel_sync() (line 1138), this line is probably undesirable because there is no guarantee that  updated_ports_copy will be the desired value.","commit_id":"9f5aeb7258905adf37a76f47a16c4559e75a86bf"},{"author":{"_account_id":261,"name":"Salvatore Orlando","email":"salv.orlando@gmail.com","username":"salvatore-orlando"},"change_message_id":"5ffde44f9089d7641aa823108c903f54d5f3fccc","unresolved":false,"context_lines":[{"line_number":1200,"context_line":"            except Exception:"},{"line_number":1201,"context_line":"                LOG.exception(_(\"Error in agent event loop\"))"},{"line_number":1202,"context_line":"                # Put the ports back in self.updated_port"},{"line_number":1203,"context_line":"                self.updated_ports |\u003d updated_ports_copy"},{"line_number":1204,"context_line":""},{"line_number":1205,"context_line":"                sync \u003d True"},{"line_number":1206,"context_line":"                tunnel_sync \u003d True"}],"source_content_type":"text/x-python","patch_set":18,"id":"AAAAUH%2F%2FMNU%3D","line":1203,"in_reply_to":"AAAAUH%2F%2FQMw%3D","updated":"2014-01-16 16:00:50.000000000","message":"Your comment makes sense.\nI will break the try...except block in smaller blocks","commit_id":"9f5aeb7258905adf37a76f47a16c4559e75a86bf"}],"neutron/tests/unit/openvswitch/test_ovs_neutron_agent.py":[{"author":{"_account_id":6598,"name":"Berezovsky Irena","email":"irenab.dev@gmail.com","username":"irenab"},"change_message_id":"295cfeef2e1d16d550952d34c3baff59ca7bf94e","unresolved":false,"context_lines":[{"line_number":328,"context_line":"                               port\u003dport,"},{"line_number":329,"context_line":"                               network_type\u003d\"vlan\","},{"line_number":330,"context_line":"                               segmentation_id\u003d\"1\","},{"line_number":331,"context_line":"                               physical_network\u003d\"physnet\")"},{"line_number":332,"context_line":""},{"line_number":333,"context_line":"    def test_setup_physical_bridges(self):"},{"line_number":334,"context_line":"        with contextlib.nested("}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAATn%2F9J2g%3D","line":331,"updated":"2013-12-16 08:52:51.000000000","message":"Missing validation checks","commit_id":"30d584e12857616de6411e798c1ac6d884420aec"},{"author":{"_account_id":261,"name":"Salvatore Orlando","email":"salv.orlando@gmail.com","username":"salvatore-orlando"},"change_message_id":"a64cf445834c3d7bef3ac7f155376b29ec81b3e6","unresolved":false,"context_lines":[{"line_number":328,"context_line":"                               port\u003dport,"},{"line_number":329,"context_line":"                               network_type\u003d\"vlan\","},{"line_number":330,"context_line":"                               segmentation_id\u003d\"1\","},{"line_number":331,"context_line":"                               physical_network\u003d\"physnet\")"},{"line_number":332,"context_line":""},{"line_number":333,"context_line":"    def test_setup_physical_bridges(self):"},{"line_number":334,"context_line":"        with contextlib.nested("}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAATn%2F9JpU%3D","line":331,"in_reply_to":"AAAATn%2F9J2g%3D","updated":"2013-12-16 09:38:12.000000000","message":"thanks, I forgot to add them!","commit_id":"30d584e12857616de6411e798c1ac6d884420aec"},{"author":{"_account_id":841,"name":"Akihiro Motoki","email":"amotoki@gmail.com","username":"amotoki"},"change_message_id":"2ef55575214b8a6efa59893e3e77e3a77e1b6bb9","unresolved":false,"context_lines":[{"line_number":330,"context_line":"                               port\u003dport,"},{"line_number":331,"context_line":"                               network_type\u003d\"vlan\","},{"line_number":332,"context_line":"                               segmentation_id\u003d\"1\","},{"line_number":333,"context_line":"                               physical_network\u003d\"physnet\")"},{"line_number":334,"context_line":""},{"line_number":335,"context_line":"    def test_setup_physical_bridges(self):"},{"line_number":336,"context_line":"        with contextlib.nested("}],"source_content_type":"text/x-python","patch_set":6,"id":"AAAATn%2F9IV8%3D","line":333,"updated":"2013-12-16 14:42:28.000000000","message":"No checks here. It must be very simple.\n\n  self.assertEqual(set([\u0027123\u0027]), self.agent.updated_ports)","commit_id":"59d8764c4cfc94d2b404bbd89eb72333f78eb627"},{"author":{"_account_id":261,"name":"Salvatore Orlando","email":"salv.orlando@gmail.com","username":"salvatore-orlando"},"change_message_id":"e483308e35278ee604a78b5574409bd31bdbf005","unresolved":false,"context_lines":[{"line_number":330,"context_line":"                               port\u003dport,"},{"line_number":331,"context_line":"                               network_type\u003d\"vlan\","},{"line_number":332,"context_line":"                               segmentation_id\u003d\"1\","},{"line_number":333,"context_line":"                               physical_network\u003d\"physnet\")"},{"line_number":334,"context_line":""},{"line_number":335,"context_line":"    def test_setup_physical_bridges(self):"},{"line_number":336,"context_line":"        with contextlib.nested("}],"source_content_type":"text/x-python","patch_set":6,"id":"AAAATn%2F9G3A%3D","line":333,"in_reply_to":"AAAATn%2F9IV8%3D","updated":"2013-12-16 18:30:05.000000000","message":"Yeah Irena told me this too.\nI keep forgetting about adding it.","commit_id":"59d8764c4cfc94d2b404bbd89eb72333f78eb627"},{"author":{"_account_id":6524,"name":"Henry Gessau","email":"HenryG@gessau.net","username":"gessau"},"change_message_id":"6a5c500ab94c54c2494b58ddea5a11fef412a1c0","unresolved":false,"context_lines":[{"line_number":201,"context_line":"        actual \u003d self.mock_scan_ports(vif_port_set, registered_ports,"},{"line_number":202,"context_line":"                                      updated_ports)"},{"line_number":203,"context_line":"        self.assertEqual(expected, actual)"},{"line_number":204,"context_line":""},{"line_number":205,"context_line":"    def test_treat_devices_added_returns_true_for_missing_device(self):"},{"line_number":206,"context_line":"        with mock.patch.object(self.agent.plugin_rpc, \u0027get_device_details\u0027,"},{"line_number":207,"context_line":"                               side_effect\u003dException()):"}],"source_content_type":"text/x-python","patch_set":8,"id":"AAAATn%2F9Exc%3D","line":204,"updated":"2013-12-17 02:16:38.000000000","message":"Can you add a test for the case where none of the updated_ports are in the vif_port_set?","commit_id":"b6b7b8d37fb656488aae694938a99eaa0131f199"},{"author":{"_account_id":2733,"name":"Darragh O\u0027Reilly","email":"doreilly@suse.com","username":"darragh-oreilly"},"change_message_id":"c40c10243aa13ba95b18fa857c508e04ba768c7a","unresolved":false,"context_lines":[{"line_number":201,"context_line":"        actual \u003d self.mock_scan_ports(vif_port_set, registered_ports,"},{"line_number":202,"context_line":"                                      updated_ports)"},{"line_number":203,"context_line":"        self.assertEqual(expected, actual)"},{"line_number":204,"context_line":""},{"line_number":205,"context_line":"    def test_treat_devices_added_returns_true_for_missing_device(self):"},{"line_number":206,"context_line":"        with mock.patch.object(self.agent.plugin_rpc, \u0027get_device_details\u0027,"},{"line_number":207,"context_line":"                               side_effect\u003dException()):"}],"source_content_type":"text/x-python","patch_set":8,"id":"AAAATn%2F9Dao%3D","line":204,"in_reply_to":"AAAATn%2F9DuE%3D","updated":"2013-12-17 09:05:37.000000000","message":"I see this case when a router interface is added. A port update is received by the L2 agent before the L3 agent has created the interface. Here it was a whole 3 seconds (if the log timestamps are accurate). So with the polling interval of 2 seconds, it\u0027s possible.\n\n\nneutron router-create router2\n\nsleep 20 # give time for l3-agent to settle - donno if this really needed for this experiment\n\nneutron router-interface-add router2 sub2\n\n\nL2-log:\n\n2013-12-17 08:44:07.651 4328 DEBUG neutron.plugins.openvswitch.agent.ovs_neutron_agent [req-fb0b37d1-81f7-4759-8fb0-99df2597a7c4 None None] port_update received for port b2f8b5e4-c355-4061-9477-dcbd039a26fe\n\n\nL3-log:\n\n2013-12-17 08:44:10.879 4331 DEBUG neutron.agent.linux.utils [-] Running command: [\u0027sudo\u0027, \u0027/usr/local/bin/neutron-rootwrap\u0027, \u0027/etc/neutron/rootwrap.conf\u0027, \u0027ovs-vsctl\u0027, \u0027--\u0027, \u0027--may-exist\u0027, \u0027add-port\u0027, \u0027br-int\u0027, \u0027qr-b2f8b5e4-c3\u0027, \u0027--\u0027, \u0027set\u0027, \u0027Interface\u0027, \u0027qr-b2f8b5e4-c3\u0027, \u0027type\u003dinternal\u0027, \u0027--\u0027, \u0027set\u0027, \u0027Interface\u0027, \u0027qr-b2f8b5e4-c3\u0027, \u0027external-ids:iface-id\u003db2f8b5e4-c355-4061-9477-dcbd039a26fe\u0027, \u0027--\u0027, \u0027set\u0027, \u0027Interface\u0027, \u0027qr-b2f8b5e4-c3\u0027, \u0027external-ids:iface-status\u003dactive\u0027, \u0027--\u0027, \u0027set\u0027, \u0027Interface\u0027, \u0027qr-b2f8b5e4-c3\u0027, \u0027external-ids:attached-mac\u003dfa:16:3e:7e:7e:2b\u0027]","commit_id":"b6b7b8d37fb656488aae694938a99eaa0131f199"},{"author":{"_account_id":261,"name":"Salvatore Orlando","email":"salv.orlando@gmail.com","username":"salvatore-orlando"},"change_message_id":"e8696c7c0a0e58e78950061c9ae7a23c27230dca","unresolved":false,"context_lines":[{"line_number":201,"context_line":"        actual \u003d self.mock_scan_ports(vif_port_set, registered_ports,"},{"line_number":202,"context_line":"                                      updated_ports)"},{"line_number":203,"context_line":"        self.assertEqual(expected, actual)"},{"line_number":204,"context_line":""},{"line_number":205,"context_line":"    def test_treat_devices_added_returns_true_for_missing_device(self):"},{"line_number":206,"context_line":"        with mock.patch.object(self.agent.plugin_rpc, \u0027get_device_details\u0027,"},{"line_number":207,"context_line":"                               side_effect\u003dException()):"}],"source_content_type":"text/x-python","patch_set":8,"id":"AAAATn%2F9DuE%3D","line":204,"in_reply_to":"AAAATn%2F9Exc%3D","updated":"2013-12-17 07:40:55.000000000","message":"We had this use case, but it has been removed as it one which can\u0027t possibly happen (see a previous patch set and the comments from Akihiro)\n\nIf this condition happens, than it means that a port has been updated but not detected on the bridge. This can happen, but that would mean that there was a short-lived port which was deleted before it could be wired on the main loop (it probably existed for a brief time on the bridge, but was never processed). As it was never processed, the removal operation - which consists of bringing it down - is not necessary.\n\nKeeping this in mind, the unit test would still work, and I think it should not be a problem adding it.","commit_id":"b6b7b8d37fb656488aae694938a99eaa0131f199"},{"author":{"_account_id":2035,"name":"Maru Newby","email":"marun@redhat.com","username":"maru"},"change_message_id":"0bdc8fc5c15cbb0b154c27db2755e1a72e705da4","unresolved":false,"context_lines":[{"line_number":185,"context_line":"    def test_scan_ports_with_port_changes_and_updated_ports(self):"},{"line_number":186,"context_line":"        self._test_scan_ports_with_updated_ports(set([4]))"},{"line_number":187,"context_line":""},{"line_number":188,"context_line":"    def test_scan_ports_with_port_changes_and_unknown_updated_ports(self):"},{"line_number":189,"context_line":"        # the port \u00275\u0027 was not seen on current ports. Hence it has either"},{"line_number":190,"context_line":"        # never been wired or already removed and should be ignored"},{"line_number":191,"context_line":"        self._test_scan_ports_with_updated_ports(set([4, 5]))"}],"source_content_type":"text/x-python","patch_set":18,"id":"AAAAUH%2F%2FQaM%3D","line":188,"updated":"2014-01-15 21:08:21.000000000","message":"(Suggestion only) Consider using test names that describe the expected behavior rather than the inputs, e.g.\n\ntest_scan_ports_ignores_unknown_updated_ports","commit_id":"9f5aeb7258905adf37a76f47a16c4559e75a86bf"},{"author":{"_account_id":261,"name":"Salvatore Orlando","email":"salv.orlando@gmail.com","username":"salvatore-orlando"},"change_message_id":"5ffde44f9089d7641aa823108c903f54d5f3fccc","unresolved":false,"context_lines":[{"line_number":185,"context_line":"    def test_scan_ports_with_port_changes_and_updated_ports(self):"},{"line_number":186,"context_line":"        self._test_scan_ports_with_updated_ports(set([4]))"},{"line_number":187,"context_line":""},{"line_number":188,"context_line":"    def test_scan_ports_with_port_changes_and_unknown_updated_ports(self):"},{"line_number":189,"context_line":"        # the port \u00275\u0027 was not seen on current ports. Hence it has either"},{"line_number":190,"context_line":"        # never been wired or already removed and should be ignored"},{"line_number":191,"context_line":"        self._test_scan_ports_with_updated_ports(set([4, 5]))"}],"source_content_type":"text/x-python","patch_set":18,"id":"AAAAUH%2F%2FMN8%3D","line":188,"in_reply_to":"AAAAUH%2F%2FQaM%3D","updated":"2014-01-16 16:00:50.000000000","message":"Done","commit_id":"9f5aeb7258905adf37a76f47a16c4559e75a86bf"},{"author":{"_account_id":2035,"name":"Maru Newby","email":"marun@redhat.com","username":"maru"},"change_message_id":"0bdc8fc5c15cbb0b154c27db2755e1a72e705da4","unresolved":false,"context_lines":[{"line_number":260,"context_line":"                             \u0027physical_network\u0027: \u0027foo\u0027,"},{"line_number":261,"context_line":"                             \u0027segmentation_id\u0027: \u0027bar\u0027,"},{"line_number":262,"context_line":"                             \u0027network_type\u0027: \u0027baz\u0027}"},{"line_number":263,"context_line":"        with contextlib.nested("},{"line_number":264,"context_line":"            mock.patch.object(self.agent.plugin_rpc, \u0027get_device_details\u0027,"},{"line_number":265,"context_line":"                              return_value\u003dfake_details_dict),"},{"line_number":266,"context_line":"            mock.patch.object(self.agent.int_br, \u0027get_vif_port_by_id\u0027,"}],"source_content_type":"text/x-python","patch_set":18,"id":"AAAAUH%2F%2FQZY%3D","line":263,"updated":"2014-01-15 21:08:21.000000000","message":"(Suggestion only) This many mocks has to be some kind of an anti-pattern.  Consider extracting the plugin update if/else clause out of treat_devices_added_or_updated() so that it can be tested in isolation.","commit_id":"9f5aeb7258905adf37a76f47a16c4559e75a86bf"},{"author":{"_account_id":261,"name":"Salvatore Orlando","email":"salv.orlando@gmail.com","username":"salvatore-orlando"},"change_message_id":"5ffde44f9089d7641aa823108c903f54d5f3fccc","unresolved":false,"context_lines":[{"line_number":260,"context_line":"                             \u0027physical_network\u0027: \u0027foo\u0027,"},{"line_number":261,"context_line":"                             \u0027segmentation_id\u0027: \u0027bar\u0027,"},{"line_number":262,"context_line":"                             \u0027network_type\u0027: \u0027baz\u0027}"},{"line_number":263,"context_line":"        with contextlib.nested("},{"line_number":264,"context_line":"            mock.patch.object(self.agent.plugin_rpc, \u0027get_device_details\u0027,"},{"line_number":265,"context_line":"                              return_value\u003dfake_details_dict),"},{"line_number":266,"context_line":"            mock.patch.object(self.agent.int_br, \u0027get_vif_port_by_id\u0027,"}],"source_content_type":"text/x-python","patch_set":18,"id":"AAAAUH%2F%2FMNg%3D","line":263,"in_reply_to":"AAAAUH%2F%2FQZY%3D","updated":"2014-01-16 16:00:50.000000000","message":"This is a valuable suggestion that I would like to defer to a follow up patch, if you don\u0027t mind.","commit_id":"9f5aeb7258905adf37a76f47a16c4559e75a86bf"}]}
