)]}'
{"neutron/db/l3_dvr_db.py":[{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"418f591346181a4caf5dc383a8ed8a39ddd7148d","unresolved":false,"context_lines":[{"line_number":802,"context_line":"        self._notify_floating_ip_change(context, floating_ip)"},{"line_number":803,"context_line":""},{"line_number":804,"context_line":"    def update_unbound_allowed_address_pair_port("},{"line_number":805,"context_line":"            self, context, port_dict, host, port_addr_pair_ip, action):"},{"line_number":806,"context_line":"        \"\"\"Update allowed address pair port with host and device_owner"},{"line_number":807,"context_line":""},{"line_number":808,"context_line":"        This function sets the host and device_owner to the port"}],"source_content_type":"text/x-python","patch_set":9,"id":"fa69d971_33332816","line":805,"range":{"start_line":805,"start_character":63,"end_line":805,"end_character":69},"updated":"2016-01-05 22:17:33.000000000","message":"IMO, this isn\u0027t an effective way to reduce code duplication.  I think there should be two method calls, one for delete and the other for add.  If they need to share code, you can extract a method to implement the shared code.  In this example, you might have a shared method which returns (ip, port) tuples which meet the shared criteria.","commit_id":"2c361f716ec4415efced44446e583b5f2879e1c2"},{"author":{"_account_id":7016,"name":"Swaminathan Vasudevan","email":"swvasude@cisco.com","username":"souminathan"},"change_message_id":"59b35ee24db3f5bcb5d0e81dd742d3db77ef1543","unresolved":false,"context_lines":[{"line_number":802,"context_line":"        self._notify_floating_ip_change(context, floating_ip)"},{"line_number":803,"context_line":""},{"line_number":804,"context_line":"    def update_unbound_allowed_address_pair_port("},{"line_number":805,"context_line":"            self, context, port_dict, host, port_addr_pair_ip, action):"},{"line_number":806,"context_line":"        \"\"\"Update allowed address pair port with host and device_owner"},{"line_number":807,"context_line":""},{"line_number":808,"context_line":"        This function sets the host and device_owner to the port"}],"source_content_type":"text/x-python","patch_set":9,"id":"fa69d971_7a188c75","line":805,"range":{"start_line":805,"start_character":63,"end_line":805,"end_character":69},"in_reply_to":"fa69d971_33332816","updated":"2016-01-06 01:51:31.000000000","message":"Done","commit_id":"2c361f716ec4415efced44446e583b5f2879e1c2"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"418f591346181a4caf5dc383a8ed8a39ddd7148d","unresolved":false,"context_lines":[{"line_number":816,"context_line":"            #if so, go ahead updating host and device info"},{"line_number":817,"context_line":"            fip \u003d self._get_floatingip_on_port(context,"},{"line_number":818,"context_line":"                                               port_id\u003dport[\u0027id\u0027])"},{"line_number":819,"context_line":"            if fip:"},{"line_number":820,"context_line":"                for ip in port[\u0027fixed_ips\u0027]:"},{"line_number":821,"context_line":"                    port_ip \u003d ip[\u0027ip_address\u0027]"},{"line_number":822,"context_line":"                    if ((port_addr_pair_ip \u003d\u003d port_ip) and"}],"source_content_type":"text/x-python","patch_set":9,"id":"fa69d971_f3791083","line":819,"range":{"start_line":819,"start_character":12,"end_line":819,"end_character":18},"updated":"2016-01-05 22:17:33.000000000","message":"nit:  prefer this\n\n  if not fip:\n     continue","commit_id":"2c361f716ec4415efced44446e583b5f2879e1c2"},{"author":{"_account_id":7016,"name":"Swaminathan Vasudevan","email":"swvasude@cisco.com","username":"souminathan"},"change_message_id":"59b35ee24db3f5bcb5d0e81dd742d3db77ef1543","unresolved":false,"context_lines":[{"line_number":816,"context_line":"            #if so, go ahead updating host and device info"},{"line_number":817,"context_line":"            fip \u003d self._get_floatingip_on_port(context,"},{"line_number":818,"context_line":"                                               port_id\u003dport[\u0027id\u0027])"},{"line_number":819,"context_line":"            if fip:"},{"line_number":820,"context_line":"                for ip in port[\u0027fixed_ips\u0027]:"},{"line_number":821,"context_line":"                    port_ip \u003d ip[\u0027ip_address\u0027]"},{"line_number":822,"context_line":"                    if ((port_addr_pair_ip \u003d\u003d port_ip) and"}],"source_content_type":"text/x-python","patch_set":9,"id":"fa69d971_5a1b4873","line":819,"range":{"start_line":819,"start_character":12,"end_line":819,"end_character":18},"in_reply_to":"fa69d971_f3791083","updated":"2016-01-06 01:51:31.000000000","message":"Done","commit_id":"2c361f716ec4415efced44446e583b5f2879e1c2"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"418f591346181a4caf5dc383a8ed8a39ddd7148d","unresolved":false,"context_lines":[{"line_number":819,"context_line":"            if fip:"},{"line_number":820,"context_line":"                for ip in port[\u0027fixed_ips\u0027]:"},{"line_number":821,"context_line":"                    port_ip \u003d ip[\u0027ip_address\u0027]"},{"line_number":822,"context_line":"                    if ((port_addr_pair_ip \u003d\u003d port_ip) and"},{"line_number":823,"context_line":"                        (port_dict[\u0027admin_state_up\u0027] or"},{"line_number":824,"context_line":"                            (port_dict[\u0027status\u0027] \u003d\u003d"},{"line_number":825,"context_line":"                                l3_const.PORT_STATUS_ACTIVE))):"},{"line_number":826,"context_line":"                        try:"},{"line_number":827,"context_line":"                            if action \u003d\u003d \"add\":"},{"line_number":828,"context_line":"                                devOwner \u003d port_dict[\u0027device_owner\u0027]"}],"source_content_type":"text/x-python","patch_set":9,"id":"fa69d971_33d5681b","line":825,"range":{"start_line":822,"start_character":23,"end_line":825,"end_character":62},"updated":"2016-01-05 22:17:33.000000000","message":"nit:  Consider adding a local variable(s) to self-document the meaning of this boolean and to clean up the if formatting.  Off the top of my head, I might suggest:\n\n  port_addr_pair_matches_active_port \u003d (port_addr_pair_ip \u003d\u003d port_ip and\n      (port_dict[\u0027admin_state_up\u0027] or\n          (port_dict[\u0027status\u0027] \u003d\u003d l3_const.PORT_STATUS_ACTIVE)))\n  if not port_addr_pair_matches_active_port:\n      continue\n\n  try:\n      ...","commit_id":"2c361f716ec4415efced44446e583b5f2879e1c2"},{"author":{"_account_id":7016,"name":"Swaminathan Vasudevan","email":"swvasude@cisco.com","username":"souminathan"},"change_message_id":"59b35ee24db3f5bcb5d0e81dd742d3db77ef1543","unresolved":false,"context_lines":[{"line_number":819,"context_line":"            if fip:"},{"line_number":820,"context_line":"                for ip in port[\u0027fixed_ips\u0027]:"},{"line_number":821,"context_line":"                    port_ip \u003d ip[\u0027ip_address\u0027]"},{"line_number":822,"context_line":"                    if ((port_addr_pair_ip \u003d\u003d port_ip) and"},{"line_number":823,"context_line":"                        (port_dict[\u0027admin_state_up\u0027] or"},{"line_number":824,"context_line":"                            (port_dict[\u0027status\u0027] \u003d\u003d"},{"line_number":825,"context_line":"                                l3_const.PORT_STATUS_ACTIVE))):"},{"line_number":826,"context_line":"                        try:"},{"line_number":827,"context_line":"                            if action \u003d\u003d \"add\":"},{"line_number":828,"context_line":"                                devOwner \u003d port_dict[\u0027device_owner\u0027]"}],"source_content_type":"text/x-python","patch_set":9,"id":"fa69d971_ba128455","line":825,"range":{"start_line":822,"start_character":23,"end_line":825,"end_character":62},"in_reply_to":"fa69d971_33d5681b","updated":"2016-01-06 01:51:31.000000000","message":"Done","commit_id":"2c361f716ec4415efced44446e583b5f2879e1c2"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"59f09092d975066dd0cb7a19bed33323e4a99ead","unresolved":false,"context_lines":[{"line_number":812,"context_line":"        host \u003d port_dict[portbindings.HOST_ID]"},{"line_number":813,"context_line":"        port_addr_pair_ip \u003d port_address_pairs[0][\u0027ip_address\u0027]"},{"line_number":814,"context_line":"        filters \u003d {\u0027fixed_ips\u0027: {\u0027ip_address\u0027: [port_addr_pair_ip]}}"},{"line_number":815,"context_line":"        ports \u003d self._core_plugin.get_ports(context, filters\u003dfilters)"},{"line_number":816,"context_line":"        for port in ports:"},{"line_number":817,"context_line":"            #check if paired port in fip table."},{"line_number":818,"context_line":"            #if so, go ahead updating host and device info"}],"source_content_type":"text/x-python","patch_set":11,"id":"fa69d971_263e5d28","line":815,"updated":"2016-01-06 17:21:51.000000000","message":"I didn\u0027t mean to suggest we explode the method out in to two methods with lots of duplication.  I suggested an alternative in PS9.  Since the two methods share essentially L812 - L831, couldn\u0027t that just be extracted in to a method which returns the relevant list of (port, ip) pairs to iterate?","commit_id":"5b1f9821cd6eb7d45c85c9648238f66a812eadfb"},{"author":{"_account_id":7016,"name":"Swaminathan Vasudevan","email":"swvasude@cisco.com","username":"souminathan"},"change_message_id":"1a84759d1cb8e37b761b45212f04afa4014c5b39","unresolved":false,"context_lines":[{"line_number":812,"context_line":"        host \u003d port_dict[portbindings.HOST_ID]"},{"line_number":813,"context_line":"        port_addr_pair_ip \u003d port_address_pairs[0][\u0027ip_address\u0027]"},{"line_number":814,"context_line":"        filters \u003d {\u0027fixed_ips\u0027: {\u0027ip_address\u0027: [port_addr_pair_ip]}}"},{"line_number":815,"context_line":"        ports \u003d self._core_plugin.get_ports(context, filters\u003dfilters)"},{"line_number":816,"context_line":"        for port in ports:"},{"line_number":817,"context_line":"            #check if paired port in fip table."},{"line_number":818,"context_line":"            #if so, go ahead updating host and device info"}],"source_content_type":"text/x-python","patch_set":11,"id":"fa69d971_7c66282b","line":815,"in_reply_to":"fa69d971_263e5d28","updated":"2016-01-06 18:28:02.000000000","message":"Yes I was planning to get rid of the common code, but just pushed in with other changes.\nWill address it in the next patch.","commit_id":"5b1f9821cd6eb7d45c85c9648238f66a812eadfb"},{"author":{"_account_id":13667,"name":"ZongKai LI","email":"onionpiece@163.com","username":"lzklibj"},"change_message_id":"b89c51d06417177b5b04ccfa132bf1e125ea238d","unresolved":false,"context_lines":[{"line_number":814,"context_line":"            #check if paired port in fip table."},{"line_number":815,"context_line":"            #if so, go ahead updating host and device info"},{"line_number":816,"context_line":"            fip \u003d self._get_floatingip_on_port(context,"},{"line_number":817,"context_line":"                                               port_id\u003dport[\u0027id\u0027])"},{"line_number":818,"context_line":"            if not fip:"},{"line_number":819,"context_line":"                continue"},{"line_number":820,"context_line":"            for ip in port[\u0027fixed_ips\u0027]:"}],"source_content_type":"text/x-python","patch_set":16,"id":"9a68dd71_baf23005","line":817,"updated":"2016-01-20 16:10:07.000000000","message":"nit: since the floatingip been queried here is not going to be used indeed, just existence check in following two lines, would you mind overwrite it, or create a new method instead?","commit_id":"8a762d4643fea0e0fe77709c027441e815561a2d"},{"author":{"_account_id":7016,"name":"Swaminathan Vasudevan","email":"swvasude@cisco.com","username":"souminathan"},"change_message_id":"e9dd0b5cafad1d47294c0b830320e4df4162e6cf","unresolved":false,"context_lines":[{"line_number":814,"context_line":"            #check if paired port in fip table."},{"line_number":815,"context_line":"            #if so, go ahead updating host and device info"},{"line_number":816,"context_line":"            fip \u003d self._get_floatingip_on_port(context,"},{"line_number":817,"context_line":"                                               port_id\u003dport[\u0027id\u0027])"},{"line_number":818,"context_line":"            if not fip:"},{"line_number":819,"context_line":"                continue"},{"line_number":820,"context_line":"            for ip in port[\u0027fixed_ips\u0027]:"}],"source_content_type":"text/x-python","patch_set":16,"id":"9a68dd71_f1a07ca1","line":817,"in_reply_to":"9a68dd71_baf23005","updated":"2016-01-21 22:03:50.000000000","message":"I am not sure what you mean here to create another method. Already I am calling an existing method.\nI don\u0027t see any advantage in creating a new function for this two line.","commit_id":"8a762d4643fea0e0fe77709c027441e815561a2d"},{"author":{"_account_id":13667,"name":"ZongKai LI","email":"onionpiece@163.com","username":"lzklibj"},"change_message_id":"9d0fe43eee28d2e6a96e76e2119124543407dc87","unresolved":false,"context_lines":[{"line_number":814,"context_line":"            #check if paired port in fip table."},{"line_number":815,"context_line":"            #if so, go ahead updating host and device info"},{"line_number":816,"context_line":"            fip \u003d self._get_floatingip_on_port(context,"},{"line_number":817,"context_line":"                                               port_id\u003dport[\u0027id\u0027])"},{"line_number":818,"context_line":"            if not fip:"},{"line_number":819,"context_line":"                continue"},{"line_number":820,"context_line":"            for ip in port[\u0027fixed_ips\u0027]:"}],"source_content_type":"text/x-python","patch_set":16,"id":"9a68dd71_c81ca279","line":817,"in_reply_to":"9a68dd71_f1a07ca1","updated":"2016-01-22 02:49:05.000000000","message":"Well, my previous point is, the \"fip\" here we need could be just a boolean, while _get_floatingip_on_port will return a FloatingIP object, that\u0027s unnecessary. And it seems that except here, there is no place using _get_floatingip_on_port. So I would suggest you overwrite it. But that doesn\u0027t come important, so I mark my previous comments as \"nit\" one.","commit_id":"8a762d4643fea0e0fe77709c027441e815561a2d"},{"author":{"_account_id":13667,"name":"ZongKai LI","email":"onionpiece@163.com","username":"lzklibj"},"change_message_id":"b89c51d06417177b5b04ccfa132bf1e125ea238d","unresolved":false,"context_lines":[{"line_number":821,"context_line":"                port_ip \u003d ip[\u0027ip_address\u0027]"},{"line_number":822,"context_line":"                port_address_pair_matches_active_port \u003d ("},{"line_number":823,"context_line":"                    (port_addr_pair_ip \u003d\u003d port_ip) and"},{"line_number":824,"context_line":"                    (port_dict[\u0027admin_state_up\u0027] or"},{"line_number":825,"context_line":"                        (port_dict[\u0027status\u0027] \u003d\u003d"},{"line_number":826,"context_line":"                            l3_const.PORT_STATUS_ACTIVE)))"},{"line_number":827,"context_line":"                if port_address_pair_matches_active_port:"},{"line_number":828,"context_line":"                    return port"},{"line_number":829,"context_line":""}],"source_content_type":"text/x-python","patch_set":16,"id":"9a68dd71_5f4be6b0","line":826,"range":{"start_line":824,"start_character":20,"end_line":826,"end_character":56},"updated":"2016-01-20 16:10:07.000000000","message":"Seems this two conditions checking is not related to port, would you mind move them before L813?\n\nAnd if port_dict[\u0027admin_state_up\u0027] or (port_dict[\u0027status\u0027] \u003d\u003d l3_const.PORT_STATUS_ACTIVE) is False, this method can directly return None?","commit_id":"8a762d4643fea0e0fe77709c027441e815561a2d"},{"author":{"_account_id":7016,"name":"Swaminathan Vasudevan","email":"swvasude@cisco.com","username":"souminathan"},"change_message_id":"e9dd0b5cafad1d47294c0b830320e4df4162e6cf","unresolved":false,"context_lines":[{"line_number":821,"context_line":"                port_ip \u003d ip[\u0027ip_address\u0027]"},{"line_number":822,"context_line":"                port_address_pair_matches_active_port \u003d ("},{"line_number":823,"context_line":"                    (port_addr_pair_ip \u003d\u003d port_ip) and"},{"line_number":824,"context_line":"                    (port_dict[\u0027admin_state_up\u0027] or"},{"line_number":825,"context_line":"                        (port_dict[\u0027status\u0027] \u003d\u003d"},{"line_number":826,"context_line":"                            l3_const.PORT_STATUS_ACTIVE)))"},{"line_number":827,"context_line":"                if port_address_pair_matches_active_port:"},{"line_number":828,"context_line":"                    return port"},{"line_number":829,"context_line":""}],"source_content_type":"text/x-python","patch_set":16,"id":"9a68dd71_b189a428","line":826,"range":{"start_line":824,"start_character":20,"end_line":826,"end_character":56},"in_reply_to":"9a68dd71_5f4be6b0","updated":"2016-01-21 22:03:50.000000000","message":"Will fix it.","commit_id":"8a762d4643fea0e0fe77709c027441e815561a2d"},{"author":{"_account_id":13667,"name":"ZongKai LI","email":"onionpiece@163.com","username":"lzklibj"},"change_message_id":"b89c51d06417177b5b04ccfa132bf1e125ea238d","unresolved":false,"context_lines":[{"line_number":841,"context_line":"            context, port_addr_pair_ip, port_dict)"},{"line_number":842,"context_line":"        if port:"},{"line_number":843,"context_line":"            try:"},{"line_number":844,"context_line":"                devOwner \u003d port_dict[\u0027device_owner\u0027]"},{"line_number":845,"context_line":"                devId \u003d port_dict[\u0027device_id\u0027]"},{"line_number":846,"context_line":"                update_port \u003d self._core_plugin.update_port("},{"line_number":847,"context_line":"                    context, port[\u0027id\u0027],"}],"source_content_type":"text/x-python","patch_set":16,"id":"9a68dd71_5a00d4aa","line":844,"range":{"start_line":844,"start_character":16,"end_line":844,"end_character":24},"updated":"2016-01-20 16:10:07.000000000","message":"nit: seems new variable name style?","commit_id":"8a762d4643fea0e0fe77709c027441e815561a2d"},{"author":{"_account_id":13667,"name":"ZongKai LI","email":"onionpiece@163.com","username":"lzklibj"},"change_message_id":"b89c51d06417177b5b04ccfa132bf1e125ea238d","unresolved":false,"context_lines":[{"line_number":874,"context_line":"                              \u0027device_id\u0027: devId}})"},{"line_number":875,"context_line":"                return update_port"},{"line_number":876,"context_line":"            except AttributeError:"},{"line_number":877,"context_line":"                LOG.debug(\"Missing attrs in port %s\u003d\", port_dict)"},{"line_number":878,"context_line":""},{"line_number":879,"context_line":""},{"line_number":880,"context_line":"def is_distributed_router(router):"}],"source_content_type":"text/x-python","patch_set":16,"id":"9a68dd71_dad5a4b9","line":877,"updated":"2016-01-20 16:10:07.000000000","message":"nit: the two methods are similar except data part. would you mind extract common part?","commit_id":"8a762d4643fea0e0fe77709c027441e815561a2d"},{"author":{"_account_id":13667,"name":"ZongKai LI","email":"onionpiece@163.com","username":"lzklibj"},"change_message_id":"9d0fe43eee28d2e6a96e76e2119124543407dc87","unresolved":false,"context_lines":[{"line_number":874,"context_line":"                              \u0027device_id\u0027: devId}})"},{"line_number":875,"context_line":"                return update_port"},{"line_number":876,"context_line":"            except AttributeError:"},{"line_number":877,"context_line":"                LOG.debug(\"Missing attrs in port %s\u003d\", port_dict)"},{"line_number":878,"context_line":""},{"line_number":879,"context_line":""},{"line_number":880,"context_line":"def is_distributed_router(router):"}],"source_content_type":"text/x-python","patch_set":16,"id":"9a68dd71_c351e50f","line":877,"in_reply_to":"9a68dd71_91390044","updated":"2016-01-22 02:49:05.000000000","message":"\"To avoid passing \"add\" or \"remove\" as additional parameters.\", that\u0027s good point. OK, I get it.","commit_id":"8a762d4643fea0e0fe77709c027441e815561a2d"},{"author":{"_account_id":7016,"name":"Swaminathan Vasudevan","email":"swvasude@cisco.com","username":"souminathan"},"change_message_id":"e9dd0b5cafad1d47294c0b830320e4df4162e6cf","unresolved":false,"context_lines":[{"line_number":874,"context_line":"                              \u0027device_id\u0027: devId}})"},{"line_number":875,"context_line":"                return update_port"},{"line_number":876,"context_line":"            except AttributeError:"},{"line_number":877,"context_line":"                LOG.debug(\"Missing attrs in port %s\u003d\", port_dict)"},{"line_number":878,"context_line":""},{"line_number":879,"context_line":""},{"line_number":880,"context_line":"def is_distributed_router(router):"}],"source_content_type":"text/x-python","patch_set":16,"id":"9a68dd71_91390044","line":877,"in_reply_to":"9a68dd71_dad5a4b9","updated":"2016-01-21 22:03:50.000000000","message":"Based on a discussion in another patch I would like to keep it as a such.\nIf I extract the comment part then the decision to  add or remove should be passed in as a function variable, which we want to avoid at this time.","commit_id":"8a762d4643fea0e0fe77709c027441e815561a2d"},{"author":{"_account_id":13667,"name":"ZongKai LI","email":"onionpiece@163.com","username":"lzklibj"},"change_message_id":"498c4f1461a3b9d0fd7c6fd44567a332d566d7c4","unresolved":false,"context_lines":[{"line_number":811,"context_line":"        filters \u003d {\u0027fixed_ips\u0027: {\u0027ip_address\u0027: [port_addr_pair_ip]}}"},{"line_number":812,"context_line":"        ports \u003d self._core_plugin.get_ports(context, filters\u003dfilters)"},{"line_number":813,"context_line":"        port_valid_state \u003d (port_dict[\u0027admin_state_up\u0027] or"},{"line_number":814,"context_line":"            l3_const.PORT_STATUS_ACTIVE)"},{"line_number":815,"context_line":"        for port in ports:"},{"line_number":816,"context_line":"            #check if paired port in fip table."},{"line_number":817,"context_line":"            #if so, go ahead updating host and device info"}],"source_content_type":"text/x-python","patch_set":17,"id":"9a68dd71_c8c022e3","line":814,"updated":"2016-01-22 02:49:15.000000000","message":"Missed \"port_dict[\u0027status\u0027]\"? Compare with previous code, it could be:\n    port_valid_state \u003d (port_dict[\u0027admin_state_up\u0027] or\n        port_dict[\u0027state\u0027] \u003d\u003d l3_const.PORT_STATUS_ACTIVE)","commit_id":"6b29de2a776fd3521e9b7ce6068056001483cc82"},{"author":{"_account_id":7016,"name":"Swaminathan Vasudevan","email":"swvasude@cisco.com","username":"souminathan"},"change_message_id":"c3e5f15b46afe7abfe68ed4396f9baff60cb3910","unresolved":false,"context_lines":[{"line_number":811,"context_line":"        filters \u003d {\u0027fixed_ips\u0027: {\u0027ip_address\u0027: [port_addr_pair_ip]}}"},{"line_number":812,"context_line":"        ports \u003d self._core_plugin.get_ports(context, filters\u003dfilters)"},{"line_number":813,"context_line":"        port_valid_state \u003d (port_dict[\u0027admin_state_up\u0027] or"},{"line_number":814,"context_line":"            l3_const.PORT_STATUS_ACTIVE)"},{"line_number":815,"context_line":"        for port in ports:"},{"line_number":816,"context_line":"            #check if paired port in fip table."},{"line_number":817,"context_line":"            #if so, go ahead updating host and device info"}],"source_content_type":"text/x-python","patch_set":17,"id":"9a68dd71_01f027c8","line":814,"in_reply_to":"9a68dd71_c8c022e3","updated":"2016-01-22 20:43:12.000000000","message":"Yes, I think I messed up the logic.\nThanks for pointing it out.","commit_id":"6b29de2a776fd3521e9b7ce6068056001483cc82"},{"author":{"_account_id":1131,"name":"Brian Haley","email":"haleyb.dev@gmail.com","username":"brian-haley"},"change_message_id":"aeef694825bb5695b6bd0ae4792a4c3ea32a5f68","unresolved":false,"context_lines":[{"line_number":807,"context_line":"        self._notify_floating_ip_change(context, floating_ip)"},{"line_number":808,"context_line":""},{"line_number":809,"context_line":"    def _get_address_pair_active_port_with_fip("},{"line_number":810,"context_line":"            self, context, port_addr_pair_ip, port_dict):"},{"line_number":811,"context_line":"        filters \u003d {\u0027fixed_ips\u0027: {\u0027ip_address\u0027: [port_addr_pair_ip]}}"},{"line_number":812,"context_line":"        ports \u003d self._core_plugin.get_ports(context, filters\u003dfilters)"},{"line_number":813,"context_line":"        port_valid_state \u003d (port_dict[\u0027admin_state_up\u0027] or"}],"source_content_type":"text/x-python","patch_set":18,"id":"9a68dd71_6905f811","line":810,"updated":"2016-01-25 20:46:59.000000000","message":"nit: might as well change this to have port_dict to be the first arg, just like the callers below","commit_id":"f0d8994be086a19954768f41ee8dee919dcd2f23"},{"author":{"_account_id":1131,"name":"Brian Haley","email":"haleyb.dev@gmail.com","username":"brian-haley"},"change_message_id":"aeef694825bb5695b6bd0ae4792a4c3ea32a5f68","unresolved":false,"context_lines":[{"line_number":811,"context_line":"        filters \u003d {\u0027fixed_ips\u0027: {\u0027ip_address\u0027: [port_addr_pair_ip]}}"},{"line_number":812,"context_line":"        ports \u003d self._core_plugin.get_ports(context, filters\u003dfilters)"},{"line_number":813,"context_line":"        port_valid_state \u003d (port_dict[\u0027admin_state_up\u0027] or"},{"line_number":814,"context_line":"            (port_dict[\u0027status\u0027] \u003d\u003d l3_const.PORT_STATUS_ACTIVE))"},{"line_number":815,"context_line":"        for port in ports:"},{"line_number":816,"context_line":"            #check if paired port in fip table."},{"line_number":817,"context_line":"            #if so, go ahead updating host and device info"}],"source_content_type":"text/x-python","patch_set":18,"id":"9a68dd71_e99d680a","line":814,"updated":"2016-01-25 20:46:59.000000000","message":"If this is False it looks like we\u0027ll never return a port on L827, right?  If so we can return early right here and remove the check on L827.  We could then also move this to be the first check and not call get_ports()","commit_id":"f0d8994be086a19954768f41ee8dee919dcd2f23"},{"author":{"_account_id":1131,"name":"Brian Haley","email":"haleyb.dev@gmail.com","username":"brian-haley"},"change_message_id":"aeef694825bb5695b6bd0ae4792a4c3ea32a5f68","unresolved":false,"context_lines":[{"line_number":834,"context_line":"        associated with the port_addr_pair_ip with the port_dict\u0027s"},{"line_number":835,"context_line":"        host and device_owner."},{"line_number":836,"context_line":"        \"\"\""},{"line_number":837,"context_line":"        host \u003d port_dict[portbindings.HOST_ID]"},{"line_number":838,"context_line":"        port_addr_pair_ip \u003d port_address_pairs[0][\u0027ip_address\u0027]"},{"line_number":839,"context_line":"        port \u003d self._get_address_pair_active_port_with_fip("},{"line_number":840,"context_line":"            context, port_addr_pair_ip, port_dict)"}],"source_content_type":"text/x-python","patch_set":18,"id":"9a68dd71_2d2ceb97","line":837,"updated":"2016-01-25 20:46:59.000000000","message":"This can move down to L843 since you don\u0027t use host until then.","commit_id":"f0d8994be086a19954768f41ee8dee919dcd2f23"},{"author":{"_account_id":1131,"name":"Brian Haley","email":"haleyb.dev@gmail.com","username":"brian-haley"},"change_message_id":"aeef694825bb5695b6bd0ae4792a4c3ea32a5f68","unresolved":false,"context_lines":[{"line_number":839,"context_line":"        port \u003d self._get_address_pair_active_port_with_fip("},{"line_number":840,"context_line":"            context, port_addr_pair_ip, port_dict)"},{"line_number":841,"context_line":"        if port:"},{"line_number":842,"context_line":"            try:"},{"line_number":843,"context_line":"                dev_owner \u003d port_dict[\u0027device_owner\u0027]"},{"line_number":844,"context_line":"                dev_id \u003d port_dict[\u0027device_id\u0027]"},{"line_number":845,"context_line":"                update_port \u003d self._core_plugin.update_port("}],"source_content_type":"text/x-python","patch_set":18,"id":"9a68dd71_ad669bea","line":842,"updated":"2016-01-25 20:46:59.000000000","message":"nit: can move down right before update_port() call","commit_id":"f0d8994be086a19954768f41ee8dee919dcd2f23"},{"author":{"_account_id":1131,"name":"Brian Haley","email":"haleyb.dev@gmail.com","username":"brian-haley"},"change_message_id":"aeef694825bb5695b6bd0ae4792a4c3ea32a5f68","unresolved":false,"context_lines":[{"line_number":849,"context_line":"                              \u0027device_id\u0027: dev_id}})"},{"line_number":850,"context_line":"                return update_port"},{"line_number":851,"context_line":"            except AttributeError:"},{"line_number":852,"context_line":"                LOG.debug(\"Missing attrs in port %s\u003d\", port_dict)"},{"line_number":853,"context_line":""},{"line_number":854,"context_line":"    def remove_unbound_allowed_address_pair_port_binding("},{"line_number":855,"context_line":"            self, context, port_dict, port_address_pairs):"}],"source_content_type":"text/x-python","patch_set":18,"id":"9a68dd71_6db3c34d","line":852,"updated":"2016-01-25 20:46:59.000000000","message":"Was this supposed to be \u0027... port: %s\u0027 ?","commit_id":"f0d8994be086a19954768f41ee8dee919dcd2f23"},{"author":{"_account_id":1131,"name":"Brian Haley","email":"haleyb.dev@gmail.com","username":"brian-haley"},"change_message_id":"aeef694825bb5695b6bd0ae4792a4c3ea32a5f68","unresolved":false,"context_lines":[{"line_number":862,"context_line":"        port \u003d self._get_address_pair_active_port_with_fip("},{"line_number":863,"context_line":"            context, port_addr_pair_ip, port_dict)"},{"line_number":864,"context_line":"        if port:"},{"line_number":865,"context_line":"            try:"},{"line_number":866,"context_line":"                devOwner \u003d \"\""},{"line_number":867,"context_line":"                devId \u003d \"\""},{"line_number":868,"context_line":"                host \u003d \"\""}],"source_content_type":"text/x-python","patch_set":18,"id":"9a68dd71_6d5c2319","line":865,"updated":"2016-01-25 20:46:59.000000000","message":"nit: can move down right before update_port() call","commit_id":"f0d8994be086a19954768f41ee8dee919dcd2f23"},{"author":{"_account_id":1131,"name":"Brian Haley","email":"haleyb.dev@gmail.com","username":"brian-haley"},"change_message_id":"aeef694825bb5695b6bd0ae4792a4c3ea32a5f68","unresolved":false,"context_lines":[{"line_number":865,"context_line":"            try:"},{"line_number":866,"context_line":"                devOwner \u003d \"\""},{"line_number":867,"context_line":"                devId \u003d \"\""},{"line_number":868,"context_line":"                host \u003d \"\""},{"line_number":869,"context_line":"                update_port \u003d self._core_plugin.update_port("},{"line_number":870,"context_line":"                    context, port[\u0027id\u0027],"},{"line_number":871,"context_line":"                    {\u0027port\u0027: {portbindings.HOST_ID: host,"}],"source_content_type":"text/x-python","patch_set":18,"id":"9a68dd71_ede813b5","line":868,"updated":"2016-01-25 20:46:59.000000000","message":"Can\u0027t these just be set directly below to \u0027\u0027 ?","commit_id":"f0d8994be086a19954768f41ee8dee919dcd2f23"},{"author":{"_account_id":1131,"name":"Brian Haley","email":"haleyb.dev@gmail.com","username":"brian-haley"},"change_message_id":"aeef694825bb5695b6bd0ae4792a4c3ea32a5f68","unresolved":false,"context_lines":[{"line_number":873,"context_line":"                              \u0027device_id\u0027: devId}})"},{"line_number":874,"context_line":"                return update_port"},{"line_number":875,"context_line":"            except AttributeError:"},{"line_number":876,"context_line":"                LOG.debug(\"Missing attrs in port %s\u003d\", port_dict)"},{"line_number":877,"context_line":""},{"line_number":878,"context_line":""},{"line_number":879,"context_line":"def is_distributed_router(router):"}],"source_content_type":"text/x-python","patch_set":18,"id":"9a68dd71_ed7d736d","line":876,"updated":"2016-01-25 20:46:59.000000000","message":"ditto","commit_id":"f0d8994be086a19954768f41ee8dee919dcd2f23"},{"author":{"_account_id":13667,"name":"ZongKai LI","email":"onionpiece@163.com","username":"lzklibj"},"change_message_id":"4acdc95127bc9fd0d10b2b23de6f4888932b2750","unresolved":false,"context_lines":[{"line_number":836,"context_line":"        associated with the port_addr_pair_ip with the port_dict\u0027s"},{"line_number":837,"context_line":"        host and device_owner."},{"line_number":838,"context_line":"        \"\"\""},{"line_number":839,"context_line":"        #host \u003d port_dict[portbindings.HOST_ID]"},{"line_number":840,"context_line":"        port_addr_pair_ip \u003d port_address_pairs[0][\u0027ip_address\u0027]"},{"line_number":841,"context_line":"        port \u003d self._get_address_pair_active_port_with_fip("},{"line_number":842,"context_line":"            context, port_dict, port_addr_pair_ip)"}],"source_content_type":"text/x-python","patch_set":20,"id":"9a68dd71_c1511310","line":839,"updated":"2016-01-27 02:55:48.000000000","message":"#? what\u0027s this?","commit_id":"388bf7cc415acae5988af1e4c7208723a5de5af0"},{"author":{"_account_id":7016,"name":"Swaminathan Vasudevan","email":"swvasude@cisco.com","username":"souminathan"},"change_message_id":"915ad9ccc241787f87ef5001eabbd09b9fbf60ff","unresolved":false,"context_lines":[{"line_number":836,"context_line":"        associated with the port_addr_pair_ip with the port_dict\u0027s"},{"line_number":837,"context_line":"        host and device_owner."},{"line_number":838,"context_line":"        \"\"\""},{"line_number":839,"context_line":"        #host \u003d port_dict[portbindings.HOST_ID]"},{"line_number":840,"context_line":"        port_addr_pair_ip \u003d port_address_pairs[0][\u0027ip_address\u0027]"},{"line_number":841,"context_line":"        port \u003d self._get_address_pair_active_port_with_fip("},{"line_number":842,"context_line":"            context, port_dict, port_addr_pair_ip)"}],"source_content_type":"text/x-python","patch_set":20,"id":"9a68dd71_c8acd08e","line":839,"in_reply_to":"9a68dd71_c1511310","updated":"2016-01-27 06:49:56.000000000","message":"sorry I should have cleaned it up.\nwill clean it up.","commit_id":"388bf7cc415acae5988af1e4c7208723a5de5af0"},{"author":{"_account_id":1131,"name":"Brian Haley","email":"haleyb.dev@gmail.com","username":"brian-haley"},"change_message_id":"84c51d24e11c49c11b6d8ca5572764dab619f0a0","unresolved":false,"context_lines":[{"line_number":809,"context_line":"    def _get_address_pair_active_port_with_fip("},{"line_number":810,"context_line":"            self, context, port_dict, port_addr_pair_ip):"},{"line_number":811,"context_line":"        filters \u003d {\u0027fixed_ips\u0027: {\u0027ip_address\u0027: [port_addr_pair_ip]}}"},{"line_number":812,"context_line":"        ports \u003d self._core_plugin.get_ports(context, filters\u003dfilters)"},{"line_number":813,"context_line":"        port_valid_state \u003d (port_dict[\u0027admin_state_up\u0027] or"},{"line_number":814,"context_line":"            (port_dict[\u0027status\u0027] \u003d\u003d l3_const.PORT_STATUS_ACTIVE))"},{"line_number":815,"context_line":"        if not port_valid_state:"}],"source_content_type":"text/x-python","patch_set":21,"id":"7a5de9d1_a1291739","line":812,"updated":"2016-01-29 20:19:07.000000000","message":"These two lines should move down to L817 - after the valid state check","commit_id":"b7c8b40910eae81995a218c6f00070915aa8ae04"},{"author":{"_account_id":7016,"name":"Swaminathan Vasudevan","email":"swvasude@cisco.com","username":"souminathan"},"change_message_id":"68875cff251ab9d5efbe120e9696b7bbabaea733","unresolved":false,"context_lines":[{"line_number":809,"context_line":"    def _get_address_pair_active_port_with_fip("},{"line_number":810,"context_line":"            self, context, port_dict, port_addr_pair_ip):"},{"line_number":811,"context_line":"        filters \u003d {\u0027fixed_ips\u0027: {\u0027ip_address\u0027: [port_addr_pair_ip]}}"},{"line_number":812,"context_line":"        ports \u003d self._core_plugin.get_ports(context, filters\u003dfilters)"},{"line_number":813,"context_line":"        port_valid_state \u003d (port_dict[\u0027admin_state_up\u0027] or"},{"line_number":814,"context_line":"            (port_dict[\u0027status\u0027] \u003d\u003d l3_const.PORT_STATUS_ACTIVE))"},{"line_number":815,"context_line":"        if not port_valid_state:"}],"source_content_type":"text/x-python","patch_set":21,"id":"7a5de9d1_5a412c37","line":812,"in_reply_to":"7a5de9d1_a1291739","updated":"2016-01-29 21:12:03.000000000","message":"Done","commit_id":"b7c8b40910eae81995a218c6f00070915aa8ae04"},{"author":{"_account_id":1131,"name":"Brian Haley","email":"haleyb.dev@gmail.com","username":"brian-haley"},"change_message_id":"84c51d24e11c49c11b6d8ca5572764dab619f0a0","unresolved":false,"context_lines":[{"line_number":824,"context_line":"            for ip in port[\u0027fixed_ips\u0027]:"},{"line_number":825,"context_line":"                port_ip \u003d ip[\u0027ip_address\u0027]"},{"line_number":826,"context_line":"                port_address_pair_matches_active_port \u003d ("},{"line_number":827,"context_line":"                    (port_addr_pair_ip \u003d\u003d port_ip) and port_valid_state)"},{"line_number":828,"context_line":"                if port_address_pair_matches_active_port:"},{"line_number":829,"context_line":"                    return port"},{"line_number":830,"context_line":""}],"source_content_type":"text/x-python","patch_set":21,"id":"7a5de9d1_c191b348","line":827,"updated":"2016-01-29 20:19:07.000000000","message":"port_valid_state check here is unnecessary, can\u0027t get here with return on L816\n\nif ip[\u0027ip_address\u0027] \u003d\u003d port_addr_pair_ip:\n    return port","commit_id":"b7c8b40910eae81995a218c6f00070915aa8ae04"},{"author":{"_account_id":7016,"name":"Swaminathan Vasudevan","email":"swvasude@cisco.com","username":"souminathan"},"change_message_id":"68875cff251ab9d5efbe120e9696b7bbabaea733","unresolved":false,"context_lines":[{"line_number":824,"context_line":"            for ip in port[\u0027fixed_ips\u0027]:"},{"line_number":825,"context_line":"                port_ip \u003d ip[\u0027ip_address\u0027]"},{"line_number":826,"context_line":"                port_address_pair_matches_active_port \u003d ("},{"line_number":827,"context_line":"                    (port_addr_pair_ip \u003d\u003d port_ip) and port_valid_state)"},{"line_number":828,"context_line":"                if port_address_pair_matches_active_port:"},{"line_number":829,"context_line":"                    return port"},{"line_number":830,"context_line":""}],"source_content_type":"text/x-python","patch_set":21,"id":"7a5de9d1_fa49f860","line":827,"in_reply_to":"7a5de9d1_c191b348","updated":"2016-01-29 21:12:03.000000000","message":"Done","commit_id":"b7c8b40910eae81995a218c6f00070915aa8ae04"},{"author":{"_account_id":1131,"name":"Brian Haley","email":"haleyb.dev@gmail.com","username":"brian-haley"},"change_message_id":"84c51d24e11c49c11b6d8ca5572764dab619f0a0","unresolved":false,"context_lines":[{"line_number":852,"context_line":"                return update_port"},{"line_number":853,"context_line":"            except AttributeError:"},{"line_number":854,"context_line":"                LOG.debug(\"Update port failed, missing attrs in port: \""},{"line_number":855,"context_line":"                          \"%s\u003d\", port_dict)"},{"line_number":856,"context_line":""},{"line_number":857,"context_line":"    def remove_unbound_allowed_address_pair_port_binding("},{"line_number":858,"context_line":"            self, context, port_dict, port_address_pairs):"}],"source_content_type":"text/x-python","patch_set":21,"id":"7a5de9d1_614b1f2b","line":855,"updated":"2016-01-29 20:19:07.000000000","message":"trailing \u003d here\n\nAnd is LOG.debug severe enough?","commit_id":"b7c8b40910eae81995a218c6f00070915aa8ae04"},{"author":{"_account_id":7016,"name":"Swaminathan Vasudevan","email":"swvasude@cisco.com","username":"souminathan"},"change_message_id":"68875cff251ab9d5efbe120e9696b7bbabaea733","unresolved":false,"context_lines":[{"line_number":852,"context_line":"                return update_port"},{"line_number":853,"context_line":"            except AttributeError:"},{"line_number":854,"context_line":"                LOG.debug(\"Update port failed, missing attrs in port: \""},{"line_number":855,"context_line":"                          \"%s\u003d\", port_dict)"},{"line_number":856,"context_line":""},{"line_number":857,"context_line":"    def remove_unbound_allowed_address_pair_port_binding("},{"line_number":858,"context_line":"            self, context, port_dict, port_address_pairs):"}],"source_content_type":"text/x-python","patch_set":21,"id":"7a5de9d1_1a47344c","line":855,"in_reply_to":"7a5de9d1_614b1f2b","updated":"2016-01-29 21:12:03.000000000","message":"will bump the log to \u0027ERROR\u0027.","commit_id":"b7c8b40910eae81995a218c6f00070915aa8ae04"},{"author":{"_account_id":1131,"name":"Brian Haley","email":"haleyb.dev@gmail.com","username":"brian-haley"},"change_message_id":"84c51d24e11c49c11b6d8ca5572764dab619f0a0","unresolved":false,"context_lines":[{"line_number":874,"context_line":"                return update_port"},{"line_number":875,"context_line":"            except AttributeError:"},{"line_number":876,"context_line":"                LOG.debug(\"Update port failed, missing attrs in port: \""},{"line_number":877,"context_line":"                          \"%s\u003d\", port_dict)"},{"line_number":878,"context_line":""},{"line_number":879,"context_line":""},{"line_number":880,"context_line":"def is_distributed_router(router):"}],"source_content_type":"text/x-python","patch_set":21,"id":"7a5de9d1_2151a7d8","line":877,"updated":"2016-01-29 20:19:07.000000000","message":"ditto","commit_id":"b7c8b40910eae81995a218c6f00070915aa8ae04"},{"author":{"_account_id":7016,"name":"Swaminathan Vasudevan","email":"swvasude@cisco.com","username":"souminathan"},"change_message_id":"68875cff251ab9d5efbe120e9696b7bbabaea733","unresolved":false,"context_lines":[{"line_number":874,"context_line":"                return update_port"},{"line_number":875,"context_line":"            except AttributeError:"},{"line_number":876,"context_line":"                LOG.debug(\"Update port failed, missing attrs in port: \""},{"line_number":877,"context_line":"                          \"%s\u003d\", port_dict)"},{"line_number":878,"context_line":""},{"line_number":879,"context_line":""},{"line_number":880,"context_line":"def is_distributed_router(router):"}],"source_content_type":"text/x-python","patch_set":21,"id":"7a5de9d1_da7bdc8a","line":877,"in_reply_to":"7a5de9d1_2151a7d8","updated":"2016-01-29 21:12:03.000000000","message":"Done","commit_id":"b7c8b40910eae81995a218c6f00070915aa8ae04"},{"author":{"_account_id":10583,"name":"Praveen Yalagandula","email":"ypraveen@gmail.com","username":"ypraveen"},"change_message_id":"da9f03bae46dbd97ea6507171f7cc709c93ce30e","unresolved":false,"context_lines":[{"line_number":802,"context_line":"        for port in ports:"},{"line_number":803,"context_line":"            #check if paired port in fip table."},{"line_number":804,"context_line":"            #if so, go ahead updating host and device info"},{"line_number":805,"context_line":"            fip \u003d self._get_floatingip_on_port(context,"},{"line_number":806,"context_line":"                                               port_id\u003dport[\u0027id\u0027])"},{"line_number":807,"context_line":"            if not fip:"},{"line_number":808,"context_line":"                continue"},{"line_number":809,"context_line":"            for ip in port[\u0027fixed_ips\u0027]:"},{"line_number":810,"context_line":"                if ip[\u0027ip_address\u0027] \u003d\u003d port_addr_pair_ip:"},{"line_number":811,"context_line":"                    return port"}],"source_content_type":"text/x-python","patch_set":24,"id":"3a57f1b5_d0bc1fde","line":808,"range":{"start_line":805,"start_character":1,"end_line":808,"end_character":24},"updated":"2016-02-12 02:55:40.000000000","message":"Even if there is no floating-ip, we should return this port. That way the traffic from another subnet could be routed to the right bound port for this allowed-address-pair-ip.","commit_id":"86b404c765874ab11d51ab3221d0b3e00f4028a2"},{"author":{"_account_id":10583,"name":"Praveen Yalagandula","email":"ypraveen@gmail.com","username":"ypraveen"},"change_message_id":"ee5bbf8845b99bf8b674a00e86fd37acff2e42a3","unresolved":false,"context_lines":[{"line_number":823,"context_line":"            context, port_dict, port_addr_pair_ip)"},{"line_number":824,"context_line":"        if port:"},{"line_number":825,"context_line":"            host \u003d port_dict[portbindings.HOST_ID]"},{"line_number":826,"context_line":"            dev_owner \u003d port_dict[\u0027device_owner\u0027]"},{"line_number":827,"context_line":"            dev_id \u003d port_dict[\u0027device_id\u0027]"},{"line_number":828,"context_line":"            try:"},{"line_number":829,"context_line":"                update_port \u003d self._core_plugin.update_port("}],"source_content_type":"text/x-python","patch_set":24,"id":"3a57f1b5_40643648","line":826,"updated":"2016-02-10 19:04:59.000000000","message":"The port\u0027s device_owner field might already have a valid entry that can make it DVR-serviceable. Can we check and update it only if it is not already set to be DVR-serviceable?","commit_id":"86b404c765874ab11d51ab3221d0b3e00f4028a2"},{"author":{"_account_id":7016,"name":"Swaminathan Vasudevan","email":"swvasude@cisco.com","username":"souminathan"},"change_message_id":"59e510e2a495162a9c6c283cf515eb9de7d13221","unresolved":false,"context_lines":[{"line_number":823,"context_line":"            context, port_dict, port_addr_pair_ip)"},{"line_number":824,"context_line":"        if port:"},{"line_number":825,"context_line":"            host \u003d port_dict[portbindings.HOST_ID]"},{"line_number":826,"context_line":"            dev_owner \u003d port_dict[\u0027device_owner\u0027]"},{"line_number":827,"context_line":"            dev_id \u003d port_dict[\u0027device_id\u0027]"},{"line_number":828,"context_line":"            try:"},{"line_number":829,"context_line":"                update_port \u003d self._core_plugin.update_port("}],"source_content_type":"text/x-python","patch_set":24,"id":"3a57f1b5_f23406fc","line":826,"in_reply_to":"3a57f1b5_40643648","updated":"2016-02-11 00:38:51.000000000","message":"Yes I can fix it.\nBut the only issue is while reseting it, since we don\u0027t know the original status.","commit_id":"86b404c765874ab11d51ab3221d0b3e00f4028a2"},{"author":{"_account_id":10583,"name":"Praveen Yalagandula","email":"ypraveen@gmail.com","username":"ypraveen"},"change_message_id":"da9f03bae46dbd97ea6507171f7cc709c93ce30e","unresolved":false,"context_lines":[{"line_number":823,"context_line":"            context, port_dict, port_addr_pair_ip)"},{"line_number":824,"context_line":"        if port:"},{"line_number":825,"context_line":"            host \u003d port_dict[portbindings.HOST_ID]"},{"line_number":826,"context_line":"            dev_owner \u003d port_dict[\u0027device_owner\u0027]"},{"line_number":827,"context_line":"            dev_id \u003d port_dict[\u0027device_id\u0027]"},{"line_number":828,"context_line":"            try:"},{"line_number":829,"context_line":"                update_port \u003d self._core_plugin.update_port("}],"source_content_type":"text/x-python","patch_set":24,"id":"3a57f1b5_b085e307","line":826,"in_reply_to":"3a57f1b5_f23406fc","updated":"2016-02-12 02:55:40.000000000","message":"dev_owner does not need to be reset, right? you only need to remove the portbindings.HOST_ID","commit_id":"86b404c765874ab11d51ab3221d0b3e00f4028a2"},{"author":{"_account_id":10583,"name":"Praveen Yalagandula","email":"ypraveen@gmail.com","username":"ypraveen"},"change_message_id":"da9f03bae46dbd97ea6507171f7cc709c93ce30e","unresolved":false,"context_lines":[{"line_number":824,"context_line":"        if port:"},{"line_number":825,"context_line":"            host \u003d port_dict[portbindings.HOST_ID]"},{"line_number":826,"context_line":"            dev_owner \u003d port_dict[\u0027device_owner\u0027]"},{"line_number":827,"context_line":"            dev_id \u003d port_dict[\u0027device_id\u0027]"},{"line_number":828,"context_line":"            try:"},{"line_number":829,"context_line":"                update_port \u003d self._core_plugin.update_port("},{"line_number":830,"context_line":"                    context, port[\u0027id\u0027],"}],"source_content_type":"text/x-python","patch_set":24,"id":"3a57f1b5_d0917f48","line":827,"range":{"start_line":827,"start_character":10,"end_line":827,"end_character":43},"updated":"2016-02-12 02:55:40.000000000","message":"If device_id is not needed for DVR, can we please not change it?","commit_id":"86b404c765874ab11d51ab3221d0b3e00f4028a2"},{"author":{"_account_id":10583,"name":"Praveen Yalagandula","email":"ypraveen@gmail.com","username":"ypraveen"},"change_message_id":"ce3d58c1e9d790554d108490f7abd5a727b2c633","unresolved":false,"context_lines":[{"line_number":712,"context_line":"            for fixed_ip in allowed_fixed_ips:"},{"line_number":713,"context_line":"                self._generate_arp_table_and_notify_agent("},{"line_number":714,"context_line":"                    context, fixed_ip, port_dict[\u0027mac_address\u0027],"},{"line_number":715,"context_line":"                    self.l3_rpc_notifier.add_arp_entry)"},{"line_number":716,"context_line":""},{"line_number":717,"context_line":"    def delete_arp_entry_for_dvr_service_port("},{"line_number":718,"context_line":"        self, context, port_dict, allowed_address_port_dict\u003dNone):"}],"source_content_type":"text/x-python","patch_set":29,"id":"bae84128_cd4dee3f","line":715,"updated":"2016-02-23 07:10:27.000000000","message":"Instead of using passing allowed_address_port_dict, we can pick up the allowed_address_pairs information directly from port_dict: port_dict[\"allowed_address_pairs\"]. That would simplify this function.\n\nDo you see any issue in using the allowed_address_pairs information directly from the port_dict?","commit_id":"6324021ef3b2f7376f7471be34c838f114cd023e"},{"author":{"_account_id":7016,"name":"Swaminathan Vasudevan","email":"swvasude@cisco.com","username":"souminathan"},"change_message_id":"37084a09cf643913d4cff2c0e5cac04298af72fa","unresolved":false,"context_lines":[{"line_number":712,"context_line":"            for fixed_ip in allowed_fixed_ips:"},{"line_number":713,"context_line":"                self._generate_arp_table_and_notify_agent("},{"line_number":714,"context_line":"                    context, fixed_ip, port_dict[\u0027mac_address\u0027],"},{"line_number":715,"context_line":"                    self.l3_rpc_notifier.add_arp_entry)"},{"line_number":716,"context_line":""},{"line_number":717,"context_line":"    def delete_arp_entry_for_dvr_service_port("},{"line_number":718,"context_line":"        self, context, port_dict, allowed_address_port_dict\u003dNone):"}],"source_content_type":"text/x-python","patch_set":29,"id":"7af24918_b9bac1df","line":715,"in_reply_to":"bae84128_cd4dee3f","updated":"2016-03-01 23:24:34.000000000","message":"They are two different ports.\nOne is the \u0027vm or compute port\u0027 and the other is the \u0027allowed-address-pair-port\u0027.","commit_id":"6324021ef3b2f7376f7471be34c838f114cd023e"},{"author":{"_account_id":1131,"name":"Brian Haley","email":"haleyb.dev@gmail.com","username":"brian-haley"},"change_message_id":"900236e0a30aa7e96b214677a7a1d75fca9d72e6","unresolved":false,"context_lines":[{"line_number":855,"context_line":"            # If the allowed_address_pair port already has an associated"},{"line_number":856,"context_line":"            # device owner, and if the device_owner is a dvr serviceable"},{"line_number":857,"context_line":"            # port, then don\u0027t update the device_owner."},{"line_number":858,"context_line":"            port_profile \u003d address_pair_port.get(portbindings.PROFILE)"},{"line_number":859,"context_line":"            if n_utils.is_dvr_serviced(address_pair_dev_owner):"},{"line_number":860,"context_line":"                if not port_profile:"},{"line_number":861,"context_line":"                    port_profile \u003d {"}],"source_content_type":"text/x-python","patch_set":30,"id":"7af24918_16f742d4","line":858,"updated":"2016-03-01 23:10:20.000000000","message":"This can return {} in the case there is no binding profile:\n\n....(portbindings.PROFILE, {})","commit_id":"ed7ea53dc34de28a3ce7c8805dca605a7f22f801"},{"author":{"_account_id":1131,"name":"Brian Haley","email":"haleyb.dev@gmail.com","username":"brian-haley"},"change_message_id":"900236e0a30aa7e96b214677a7a1d75fca9d72e6","unresolved":false,"context_lines":[{"line_number":860,"context_line":"                if not port_profile:"},{"line_number":861,"context_line":"                    port_profile \u003d {"},{"line_number":862,"context_line":"                        \u0027original_owner\u0027: address_pair_dev_owner}"},{"line_number":863,"context_line":"                else:"},{"line_number":864,"context_line":"                    port_profile[\u0027original_owner\u0027] \u003d address_pair_dev_owner"},{"line_number":865,"context_line":"                port_data \u003d {portbindings.HOST_ID: host,"},{"line_number":866,"context_line":"                             portbindings.PROFILE: port_profile}"}],"source_content_type":"text/x-python","patch_set":30,"id":"7af24918_161e220c","line":863,"updated":"2016-03-01 23:10:20.000000000","message":"then L860 to here can be removed\n\nWe made a similar change in the nova live migration code","commit_id":"ed7ea53dc34de28a3ce7c8805dca605a7f22f801"},{"author":{"_account_id":13667,"name":"ZongKai LI","email":"onionpiece@163.com","username":"lzklibj"},"change_message_id":"c5ba33de1c9df0ab07e5e3ea241fc8b698d8c8b5","unresolved":false,"context_lines":[{"line_number":692,"context_line":"    def _get_allowed_address_pair_fixed_ips(self, port_dict):"},{"line_number":693,"context_line":"        \"\"\"Returns all fixed_ips associated with the allowed_address_pair.\"\"\""},{"line_number":694,"context_line":"        aa_pair_fixed_ips \u003d []"},{"line_number":695,"context_line":"        if isinstance(port_dict.get(\u0027allowed_address_pairs\u0027, None), list):"},{"line_number":696,"context_line":"            for address_pair in port_dict[\u0027allowed_address_pairs\u0027]:"},{"line_number":697,"context_line":"                aap_ip_cidr \u003d address_pair[\u0027ip_address\u0027].split(\"/\")"},{"line_number":698,"context_line":"                if len(aap_ip_cidr) \u003d\u003d 1 or int(aap_ip_cidr[1]) \u003d\u003d 32:"}],"source_content_type":"text/x-python","patch_set":32,"id":"7af24918_5a65121c","line":695,"updated":"2016-03-03 07:32:25.000000000","message":"A question: is it necessary to check allowed_address_pairs is list? Will not API/CLI make sure it is list when we creating a port with allowed_address_pairs or updating port allowed_address_pairs?","commit_id":"f81a9220e31eac122c2886dc3da33ca431e1d4da"},{"author":{"_account_id":7016,"name":"Swaminathan Vasudevan","email":"swvasude@cisco.com","username":"souminathan"},"change_message_id":"4c10381734474b5f524b486b56c11c6d41a7f137","unresolved":false,"context_lines":[{"line_number":692,"context_line":"    def _get_allowed_address_pair_fixed_ips(self, port_dict):"},{"line_number":693,"context_line":"        \"\"\"Returns all fixed_ips associated with the allowed_address_pair.\"\"\""},{"line_number":694,"context_line":"        aa_pair_fixed_ips \u003d []"},{"line_number":695,"context_line":"        if isinstance(port_dict.get(\u0027allowed_address_pairs\u0027, None), list):"},{"line_number":696,"context_line":"            for address_pair in port_dict[\u0027allowed_address_pairs\u0027]:"},{"line_number":697,"context_line":"                aap_ip_cidr \u003d address_pair[\u0027ip_address\u0027].split(\"/\")"},{"line_number":698,"context_line":"                if len(aap_ip_cidr) \u003d\u003d 1 or int(aap_ip_cidr[1]) \u003d\u003d 32:"}],"source_content_type":"text/x-python","patch_set":32,"id":"7af24918_b61ec3b8","line":695,"in_reply_to":"7af24918_5a65121c","updated":"2016-03-03 20:28:38.000000000","message":"I think so, may be we don\u0027t need this check, if it is redundant.","commit_id":"f81a9220e31eac122c2886dc3da33ca431e1d4da"},{"author":{"_account_id":13667,"name":"ZongKai LI","email":"onionpiece@163.com","username":"lzklibj"},"change_message_id":"c5ba33de1c9df0ab07e5e3ea241fc8b698d8c8b5","unresolved":false,"context_lines":[{"line_number":821,"context_line":"            (port_dict[\u0027status\u0027] \u003d\u003d l3_const.PORT_STATUS_ACTIVE))"},{"line_number":822,"context_line":"        if not port_valid_state:"},{"line_number":823,"context_line":"            return"},{"line_number":824,"context_line":"        filters \u003d {\u0027fixed_ips\u0027: {\u0027ip_address\u0027: [port_addr_pair_ip]}}"},{"line_number":825,"context_line":"        ports \u003d self._core_plugin.get_ports(context, filters\u003dfilters)"},{"line_number":826,"context_line":"        for port in ports:"},{"line_number":827,"context_line":"            #check if paired port has associated fip."},{"line_number":828,"context_line":"            #if so, go ahead updating host and device info"},{"line_number":829,"context_line":"            fip \u003d self._get_floatingip_on_port(context,"},{"line_number":830,"context_line":"                                               port_id\u003dport[\u0027id\u0027])"},{"line_number":831,"context_line":"            if not fip:"},{"line_number":832,"context_line":"                continue"},{"line_number":833,"context_line":"            for ip in port[\u0027fixed_ips\u0027]:"},{"line_number":834,"context_line":"                if ip[\u0027ip_address\u0027] \u003d\u003d port_addr_pair_ip:"},{"line_number":835,"context_line":"                    return port"},{"line_number":836,"context_line":""},{"line_number":837,"context_line":"    def update_unbound_allowed_address_pair_port_binding("},{"line_number":838,"context_line":"            self, context, service_port_dict, port_address_pairs):"}],"source_content_type":"text/x-python","patch_set":32,"id":"7af24918_910c983c","line":835,"range":{"start_line":824,"start_character":8,"end_line":835,"end_character":31},"updated":"2016-03-03 07:32:25.000000000","message":"How about directly query table FloatingIP, like:\n\n  query \u003d context.session.query(l3_db.FloatingIP).filter(\n      l3_db.FloatingIP.fixed_ip_address \u003d\u003d port_addr_pair_ip)\n  fip \u003d query.first()\n  return self._core_plugin.get_port(\n      context,fip.fixed_port_id) if fip else None\n\nit can quickly judge whether the port_add_pair_ip has associated with a floatingip, if not, it even doesn\u0027t need call core plugin to get any port.","commit_id":"f81a9220e31eac122c2886dc3da33ca431e1d4da"},{"author":{"_account_id":7016,"name":"Swaminathan Vasudevan","email":"swvasude@cisco.com","username":"souminathan"},"change_message_id":"4c10381734474b5f524b486b56c11c6d41a7f137","unresolved":false,"context_lines":[{"line_number":821,"context_line":"            (port_dict[\u0027status\u0027] \u003d\u003d l3_const.PORT_STATUS_ACTIVE))"},{"line_number":822,"context_line":"        if not port_valid_state:"},{"line_number":823,"context_line":"            return"},{"line_number":824,"context_line":"        filters \u003d {\u0027fixed_ips\u0027: {\u0027ip_address\u0027: [port_addr_pair_ip]}}"},{"line_number":825,"context_line":"        ports \u003d self._core_plugin.get_ports(context, filters\u003dfilters)"},{"line_number":826,"context_line":"        for port in ports:"},{"line_number":827,"context_line":"            #check if paired port has associated fip."},{"line_number":828,"context_line":"            #if so, go ahead updating host and device info"},{"line_number":829,"context_line":"            fip \u003d self._get_floatingip_on_port(context,"},{"line_number":830,"context_line":"                                               port_id\u003dport[\u0027id\u0027])"},{"line_number":831,"context_line":"            if not fip:"},{"line_number":832,"context_line":"                continue"},{"line_number":833,"context_line":"            for ip in port[\u0027fixed_ips\u0027]:"},{"line_number":834,"context_line":"                if ip[\u0027ip_address\u0027] \u003d\u003d port_addr_pair_ip:"},{"line_number":835,"context_line":"                    return port"},{"line_number":836,"context_line":""},{"line_number":837,"context_line":"    def update_unbound_allowed_address_pair_port_binding("},{"line_number":838,"context_line":"            self, context, service_port_dict, port_address_pairs):"}],"source_content_type":"text/x-python","patch_set":32,"id":"7af24918_36e633b0","line":835,"range":{"start_line":824,"start_character":8,"end_line":835,"end_character":31},"in_reply_to":"7af24918_910c983c","updated":"2016-03-03 20:28:38.000000000","message":"good suggestion, let me think about it.","commit_id":"f81a9220e31eac122c2886dc3da33ca431e1d4da"}],"neutron/db/l3_dvrscheduler_db.py":[{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"418f591346181a4caf5dc383a8ed8a39ddd7148d","unresolved":false,"context_lines":[{"line_number":461,"context_line":""},{"line_number":462,"context_line":""},{"line_number":463,"context_line":"def _dvr_handle_unbound_allowed_addr_pair("},{"line_number":464,"context_line":"    plugin, context, port, allowed_address_pair, action):"},{"line_number":465,"context_line":"    port_host \u003d port[\u0027binding:host_id\u0027]"},{"line_number":466,"context_line":"    allowed_address_pair_ip \u003d allowed_address_pair[0][\u0027ip_address\u0027]"},{"line_number":467,"context_line":"    updated_port \u003d ("}],"source_content_type":"text/x-python","patch_set":9,"id":"fa69d971_7e49675f","line":464,"range":{"start_line":464,"start_character":49,"end_line":464,"end_character":55},"updated":"2016-01-05 22:17:33.000000000","message":"See comment in previous file.","commit_id":"2c361f716ec4415efced44446e583b5f2879e1c2"},{"author":{"_account_id":7016,"name":"Swaminathan Vasudevan","email":"swvasude@cisco.com","username":"souminathan"},"change_message_id":"59b35ee24db3f5bcb5d0e81dd742d3db77ef1543","unresolved":false,"context_lines":[{"line_number":461,"context_line":""},{"line_number":462,"context_line":""},{"line_number":463,"context_line":"def _dvr_handle_unbound_allowed_addr_pair("},{"line_number":464,"context_line":"    plugin, context, port, allowed_address_pair, action):"},{"line_number":465,"context_line":"    port_host \u003d port[\u0027binding:host_id\u0027]"},{"line_number":466,"context_line":"    allowed_address_pair_ip \u003d allowed_address_pair[0][\u0027ip_address\u0027]"},{"line_number":467,"context_line":"    updated_port \u003d ("}],"source_content_type":"text/x-python","patch_set":9,"id":"fa69d971_3a2d3495","line":464,"range":{"start_line":464,"start_character":49,"end_line":464,"end_character":55},"in_reply_to":"fa69d971_7e49675f","updated":"2016-01-06 01:51:31.000000000","message":"Done","commit_id":"2c361f716ec4415efced44446e583b5f2879e1c2"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"418f591346181a4caf5dc383a8ed8a39ddd7148d","unresolved":false,"context_lines":[{"line_number":502,"context_line":"    address_pairs \u003d kwargs.get(\u0027address_pairs\u0027)"},{"line_number":503,"context_line":"    if port:"},{"line_number":504,"context_line":"        port_host \u003d port.get(portbindings.HOST_ID, None)"},{"line_number":505,"context_line":"        allowed_address_pairs \u003d ("},{"line_number":506,"context_line":"            address_pairs if kwargs.get("},{"line_number":507,"context_line":"                \u0027address_pairs\u0027) else port.get(\u0027allowed_address_pairs\u0027,"},{"line_number":508,"context_line":"                                               None))"},{"line_number":509,"context_line":"        if allowed_address_pairs and port_host:"},{"line_number":510,"context_line":"            _dvr_handle_unbound_allowed_addr_pair("},{"line_number":511,"context_line":"                l3plugin, context, port, allowed_address_pairs, \"del\")"}],"source_content_type":"text/x-python","patch_set":9,"id":"fa69d971_734760bc","line":508,"range":{"start_line":505,"start_character":8,"end_line":508,"end_character":53},"updated":"2016-01-05 22:17:33.000000000","message":"nit: I think this is a bit much for a ternary if operator.  It would be more readable as a traditional if / then / else.","commit_id":"2c361f716ec4415efced44446e583b5f2879e1c2"},{"author":{"_account_id":7016,"name":"Swaminathan Vasudevan","email":"swvasude@cisco.com","username":"souminathan"},"change_message_id":"59b35ee24db3f5bcb5d0e81dd742d3db77ef1543","unresolved":false,"context_lines":[{"line_number":502,"context_line":"    address_pairs \u003d kwargs.get(\u0027address_pairs\u0027)"},{"line_number":503,"context_line":"    if port:"},{"line_number":504,"context_line":"        port_host \u003d port.get(portbindings.HOST_ID, None)"},{"line_number":505,"context_line":"        allowed_address_pairs \u003d ("},{"line_number":506,"context_line":"            address_pairs if kwargs.get("},{"line_number":507,"context_line":"                \u0027address_pairs\u0027) else port.get(\u0027allowed_address_pairs\u0027,"},{"line_number":508,"context_line":"                                               None))"},{"line_number":509,"context_line":"        if allowed_address_pairs and port_host:"},{"line_number":510,"context_line":"            _dvr_handle_unbound_allowed_addr_pair("},{"line_number":511,"context_line":"                l3plugin, context, port, allowed_address_pairs, \"del\")"}],"source_content_type":"text/x-python","patch_set":9,"id":"fa69d971_da1df862","line":508,"range":{"start_line":505,"start_character":8,"end_line":508,"end_character":53},"in_reply_to":"fa69d971_734760bc","updated":"2016-01-06 01:51:31.000000000","message":"Done","commit_id":"2c361f716ec4415efced44446e583b5f2879e1c2"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"418f591346181a4caf5dc383a8ed8a39ddd7148d","unresolved":false,"context_lines":[{"line_number":561,"context_line":"        new_port_state \u003d new_port.get(\u0027admin_state_up\u0027, None)"},{"line_number":562,"context_line":"        new_port_host \u003d new_port.get(portbindings.HOST_ID, None)"},{"line_number":563,"context_line":"        address_pairs \u003d kwargs.get(\u0027address_pairs\u0027)"},{"line_number":564,"context_line":"        allowed_address_pairs \u003d ("},{"line_number":565,"context_line":"            address_pairs if kwargs.get("},{"line_number":566,"context_line":"                \u0027address_pairs\u0027) else new_port.get(\u0027allowed_address_pairs\u0027,"},{"line_number":567,"context_line":"                                                   None))"},{"line_number":568,"context_line":"        if (original_port_state and new_port_state and"},{"line_number":569,"context_line":"            allowed_address_pairs and new_port_host):"},{"line_number":570,"context_line":"            _dvr_handle_unbound_allowed_addr_pair("}],"source_content_type":"text/x-python","patch_set":9,"id":"fa69d971_9349b4b9","line":567,"range":{"start_line":564,"start_character":32,"end_line":567,"end_character":57},"updated":"2016-01-05 22:17:33.000000000","message":"ditto","commit_id":"2c361f716ec4415efced44446e583b5f2879e1c2"},{"author":{"_account_id":7016,"name":"Swaminathan Vasudevan","email":"swvasude@cisco.com","username":"souminathan"},"change_message_id":"59b35ee24db3f5bcb5d0e81dd742d3db77ef1543","unresolved":false,"context_lines":[{"line_number":561,"context_line":"        new_port_state \u003d new_port.get(\u0027admin_state_up\u0027, None)"},{"line_number":562,"context_line":"        new_port_host \u003d new_port.get(portbindings.HOST_ID, None)"},{"line_number":563,"context_line":"        address_pairs \u003d kwargs.get(\u0027address_pairs\u0027)"},{"line_number":564,"context_line":"        allowed_address_pairs \u003d ("},{"line_number":565,"context_line":"            address_pairs if kwargs.get("},{"line_number":566,"context_line":"                \u0027address_pairs\u0027) else new_port.get(\u0027allowed_address_pairs\u0027,"},{"line_number":567,"context_line":"                                                   None))"},{"line_number":568,"context_line":"        if (original_port_state and new_port_state and"},{"line_number":569,"context_line":"            allowed_address_pairs and new_port_host):"},{"line_number":570,"context_line":"            _dvr_handle_unbound_allowed_addr_pair("}],"source_content_type":"text/x-python","patch_set":9,"id":"fa69d971_fa223ca2","line":567,"range":{"start_line":564,"start_character":32,"end_line":567,"end_character":57},"in_reply_to":"fa69d971_9349b4b9","updated":"2016-01-06 01:51:31.000000000","message":"Done","commit_id":"2c361f716ec4415efced44446e583b5f2879e1c2"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"418f591346181a4caf5dc383a8ed8a39ddd7148d","unresolved":false,"context_lines":[{"line_number":565,"context_line":"            address_pairs if kwargs.get("},{"line_number":566,"context_line":"                \u0027address_pairs\u0027) else new_port.get(\u0027allowed_address_pairs\u0027,"},{"line_number":567,"context_line":"                                                   None))"},{"line_number":568,"context_line":"        if (original_port_state and new_port_state and"},{"line_number":569,"context_line":"            allowed_address_pairs and new_port_host):"},{"line_number":570,"context_line":"            _dvr_handle_unbound_allowed_addr_pair("},{"line_number":571,"context_line":"                l3plugin, context, new_port, allowed_address_pairs, \"add\")"},{"line_number":572,"context_line":"            return"}],"source_content_type":"text/x-python","patch_set":9,"id":"fa69d971_9ee21b2e","line":569,"range":{"start_line":568,"start_character":11,"end_line":569,"end_character":52},"updated":"2016-01-05 22:17:33.000000000","message":"Don\u0027t these two cases reduce to the following?\n\n  if new_port_state and allowed_address_pairs and new_port_host:\n      _dvr_handle_unbound_allowed_addr_pair(\n           l3plugin, context, new_port, allowed_address_pairs, \"add\")","commit_id":"2c361f716ec4415efced44446e583b5f2879e1c2"},{"author":{"_account_id":7016,"name":"Swaminathan Vasudevan","email":"swvasude@cisco.com","username":"souminathan"},"change_message_id":"59b35ee24db3f5bcb5d0e81dd742d3db77ef1543","unresolved":false,"context_lines":[{"line_number":565,"context_line":"            address_pairs if kwargs.get("},{"line_number":566,"context_line":"                \u0027address_pairs\u0027) else new_port.get(\u0027allowed_address_pairs\u0027,"},{"line_number":567,"context_line":"                                                   None))"},{"line_number":568,"context_line":"        if (original_port_state and new_port_state and"},{"line_number":569,"context_line":"            allowed_address_pairs and new_port_host):"},{"line_number":570,"context_line":"            _dvr_handle_unbound_allowed_addr_pair("},{"line_number":571,"context_line":"                l3plugin, context, new_port, allowed_address_pairs, \"add\")"},{"line_number":572,"context_line":"            return"}],"source_content_type":"text/x-python","patch_set":9,"id":"fa69d971_9a3c60c9","line":569,"range":{"start_line":568,"start_character":11,"end_line":569,"end_character":52},"in_reply_to":"fa69d971_9ee21b2e","updated":"2016-01-06 01:51:31.000000000","message":"Done","commit_id":"2c361f716ec4415efced44446e583b5f2879e1c2"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"418f591346181a4caf5dc383a8ed8a39ddd7148d","unresolved":false,"context_lines":[{"line_number":576,"context_line":"                l3plugin, context, new_port, allowed_address_pairs, \"add\")"},{"line_number":577,"context_line":"            return"},{"line_number":578,"context_line":"        if ((original_port_state and not new_port_state) and"},{"line_number":579,"context_line":"            allowed_address_pairs and new_port_host):"},{"line_number":580,"context_line":"            _dvr_handle_unbound_allowed_addr_pair("},{"line_number":581,"context_line":"                l3plugin, context, original_port, allowed_address_pairs, \"del\")"},{"line_number":582,"context_line":"            return"}],"source_content_type":"text/x-python","patch_set":9,"id":"fa69d971_9e677bb6","line":579,"range":{"start_line":579,"start_character":12,"end_line":579,"end_character":51},"updated":"2016-01-05 22:17:33.000000000","message":"All three of these new cases include this expression.  It would help readability if you inserted this above L568.  I think this whole section could get a lot more readable.\n\n  if allowed_address_pairs and new_port_host:\n      if new_port_state:\n          ... add\n          return\n      if original_port_state:\n          ... delete\n          return","commit_id":"2c361f716ec4415efced44446e583b5f2879e1c2"},{"author":{"_account_id":7016,"name":"Swaminathan Vasudevan","email":"swvasude@cisco.com","username":"souminathan"},"change_message_id":"59b35ee24db3f5bcb5d0e81dd742d3db77ef1543","unresolved":false,"context_lines":[{"line_number":576,"context_line":"                l3plugin, context, new_port, allowed_address_pairs, \"add\")"},{"line_number":577,"context_line":"            return"},{"line_number":578,"context_line":"        if ((original_port_state and not new_port_state) and"},{"line_number":579,"context_line":"            allowed_address_pairs and new_port_host):"},{"line_number":580,"context_line":"            _dvr_handle_unbound_allowed_addr_pair("},{"line_number":581,"context_line":"                l3plugin, context, original_port, allowed_address_pairs, \"del\")"},{"line_number":582,"context_line":"            return"}],"source_content_type":"text/x-python","patch_set":9,"id":"fa69d971_ba3924d9","line":579,"range":{"start_line":579,"start_character":12,"end_line":579,"end_character":51},"in_reply_to":"fa69d971_9e677bb6","updated":"2016-01-06 01:51:31.000000000","message":"Done","commit_id":"2c361f716ec4415efced44446e583b5f2879e1c2"},{"author":{"_account_id":13667,"name":"ZongKai LI","email":"onionpiece@163.com","username":"lzklibj"},"change_message_id":"b89c51d06417177b5b04ccfa132bf1e125ea238d","unresolved":false,"context_lines":[{"line_number":483,"context_line":""},{"line_number":484,"context_line":""},{"line_number":485,"context_line":"def _dvr_handle_unbound_allowed_addr_pair_add("},{"line_number":486,"context_line":"    plugin, context, port, allowed_address_pair):"},{"line_number":487,"context_line":"    updated_port \u003d ("},{"line_number":488,"context_line":"        plugin.update_unbound_allowed_address_pair_port_binding("},{"line_number":489,"context_line":"            context, port,"}],"source_content_type":"text/x-python","patch_set":16,"id":"9a68dd71_95105f50","line":486,"updated":"2016-01-20 16:10:07.000000000","message":"nit: the indentation is uncomfortable, would you please adjust it?","commit_id":"8a762d4643fea0e0fe77709c027441e815561a2d"},{"author":{"_account_id":7016,"name":"Swaminathan Vasudevan","email":"swvasude@cisco.com","username":"souminathan"},"change_message_id":"e9dd0b5cafad1d47294c0b830320e4df4162e6cf","unresolved":false,"context_lines":[{"line_number":483,"context_line":""},{"line_number":484,"context_line":""},{"line_number":485,"context_line":"def _dvr_handle_unbound_allowed_addr_pair_add("},{"line_number":486,"context_line":"    plugin, context, port, allowed_address_pair):"},{"line_number":487,"context_line":"    updated_port \u003d ("},{"line_number":488,"context_line":"        plugin.update_unbound_allowed_address_pair_port_binding("},{"line_number":489,"context_line":"            context, port,"}],"source_content_type":"text/x-python","patch_set":16,"id":"9a68dd71_1190b0eb","line":486,"in_reply_to":"9a68dd71_95105f50","updated":"2016-01-21 22:03:50.000000000","message":"Done","commit_id":"8a762d4643fea0e0fe77709c027441e815561a2d"},{"author":{"_account_id":13667,"name":"ZongKai LI","email":"onionpiece@163.com","username":"lzklibj"},"change_message_id":"b89c51d06417177b5b04ccfa132bf1e125ea238d","unresolved":false,"context_lines":[{"line_number":489,"context_line":"            context, port,"},{"line_number":490,"context_line":"            allowed_address_pair))"},{"line_number":491,"context_line":"    LOG.debug(\"Allowed address pair port restored \""},{"line_number":492,"context_line":"              \"from service port binding: %s\", updated_port)"},{"line_number":493,"context_line":"    if updated_port:"},{"line_number":494,"context_line":"        plugin.dvr_handle_new_service_port(context, updated_port)"},{"line_number":495,"context_line":"        plugin.update_arp_entry_for_new_service_port("}],"source_content_type":"text/x-python","patch_set":16,"id":"9a68dd71_95ce1f59","line":492,"updated":"2016-01-20 16:10:07.000000000","message":"I think the debug message should be more meanful only when *update* is successful. If AttributeError happens, this message may become confused.","commit_id":"8a762d4643fea0e0fe77709c027441e815561a2d"},{"author":{"_account_id":7016,"name":"Swaminathan Vasudevan","email":"swvasude@cisco.com","username":"souminathan"},"change_message_id":"e9dd0b5cafad1d47294c0b830320e4df4162e6cf","unresolved":false,"context_lines":[{"line_number":489,"context_line":"            context, port,"},{"line_number":490,"context_line":"            allowed_address_pair))"},{"line_number":491,"context_line":"    LOG.debug(\"Allowed address pair port restored \""},{"line_number":492,"context_line":"              \"from service port binding: %s\", updated_port)"},{"line_number":493,"context_line":"    if updated_port:"},{"line_number":494,"context_line":"        plugin.dvr_handle_new_service_port(context, updated_port)"},{"line_number":495,"context_line":"        plugin.update_arp_entry_for_new_service_port("}],"source_content_type":"text/x-python","patch_set":16,"id":"9a68dd71_d1c0d8e2","line":492,"in_reply_to":"9a68dd71_95ce1f59","updated":"2016-01-21 22:03:50.000000000","message":"Done","commit_id":"8a762d4643fea0e0fe77709c027441e815561a2d"},{"author":{"_account_id":13667,"name":"ZongKai LI","email":"onionpiece@163.com","username":"lzklibj"},"change_message_id":"b89c51d06417177b5b04ccfa132bf1e125ea238d","unresolved":false,"context_lines":[{"line_number":497,"context_line":""},{"line_number":498,"context_line":""},{"line_number":499,"context_line":"def _dvr_handle_unbound_allowed_addr_pair_del("},{"line_number":500,"context_line":"    plugin, context, port, allowed_address_pair):"},{"line_number":501,"context_line":"    updated_port \u003d ("},{"line_number":502,"context_line":"        plugin.remove_unbound_allowed_address_pair_port_binding("},{"line_number":503,"context_line":"            context, port,"}],"source_content_type":"text/x-python","patch_set":16,"id":"9a68dd71_9537ffe2","line":500,"updated":"2016-01-20 16:10:07.000000000","message":"ditto","commit_id":"8a762d4643fea0e0fe77709c027441e815561a2d"},{"author":{"_account_id":13667,"name":"ZongKai LI","email":"onionpiece@163.com","username":"lzklibj"},"change_message_id":"b89c51d06417177b5b04ccfa132bf1e125ea238d","unresolved":false,"context_lines":[{"line_number":503,"context_line":"            context, port,"},{"line_number":504,"context_line":"            allowed_address_pair))"},{"line_number":505,"context_line":"    LOG.debug(\"Allowed address pair port restored \""},{"line_number":506,"context_line":"              \"from service port binding: %s\", updated_port)"},{"line_number":507,"context_line":""},{"line_number":508,"context_line":""},{"line_number":509,"context_line":"def _notify_l3_agent_new_port(resource, event, trigger, **kwargs):"}],"source_content_type":"text/x-python","patch_set":16,"id":"9a68dd71_35dbb31d","line":506,"updated":"2016-01-20 16:10:07.000000000","message":"ditto","commit_id":"8a762d4643fea0e0fe77709c027441e815561a2d"},{"author":{"_account_id":7016,"name":"Swaminathan Vasudevan","email":"swvasude@cisco.com","username":"souminathan"},"change_message_id":"e9dd0b5cafad1d47294c0b830320e4df4162e6cf","unresolved":false,"context_lines":[{"line_number":503,"context_line":"            context, port,"},{"line_number":504,"context_line":"            allowed_address_pair))"},{"line_number":505,"context_line":"    LOG.debug(\"Allowed address pair port restored \""},{"line_number":506,"context_line":"              \"from service port binding: %s\", updated_port)"},{"line_number":507,"context_line":""},{"line_number":508,"context_line":""},{"line_number":509,"context_line":"def _notify_l3_agent_new_port(resource, event, trigger, **kwargs):"}],"source_content_type":"text/x-python","patch_set":16,"id":"9a68dd71_71b7ac86","line":506,"in_reply_to":"9a68dd71_35dbb31d","updated":"2016-01-21 22:03:50.000000000","message":"Done","commit_id":"8a762d4643fea0e0fe77709c027441e815561a2d"},{"author":{"_account_id":1131,"name":"Brian Haley","email":"haleyb.dev@gmail.com","username":"brian-haley"},"change_message_id":"aeef694825bb5695b6bd0ae4792a4c3ea32a5f68","unresolved":false,"context_lines":[{"line_number":529,"context_line":"    removed_routers \u003d kwargs[\u0027removed_routers\u0027]"},{"line_number":530,"context_line":"    l3plugin \u003d manager.NeutronManager.get_service_plugins().get("},{"line_number":531,"context_line":"        service_constants.L3_ROUTER_NAT)"},{"line_number":532,"context_line":"    address_pairs \u003d kwargs.get(\u0027address_pairs\u0027)"},{"line_number":533,"context_line":"    if port:"},{"line_number":534,"context_line":"        port_host \u003d port.get(portbindings.HOST_ID, None)"},{"line_number":535,"context_line":"        if address_pairs:"}],"source_content_type":"text/x-python","patch_set":18,"id":"9a68dd71_8d28779b","line":532,"updated":"2016-01-25 20:46:59.000000000","message":"Can move inside \u0027if\u0027 since unused otherwise","commit_id":"f0d8994be086a19954768f41ee8dee919dcd2f23"},{"author":{"_account_id":1131,"name":"Brian Haley","email":"haleyb.dev@gmail.com","username":"brian-haley"},"change_message_id":"aeef694825bb5695b6bd0ae4792a4c3ea32a5f68","unresolved":false,"context_lines":[{"line_number":535,"context_line":"        if address_pairs:"},{"line_number":536,"context_line":"            allowed_address_pairs \u003d address_pairs"},{"line_number":537,"context_line":"        else:"},{"line_number":538,"context_line":"            allowed_address_pairs \u003d port.get(\u0027allowed_address_pairs\u0027, None)"},{"line_number":539,"context_line":"        if allowed_address_pairs and port_host:"},{"line_number":540,"context_line":"            _dvr_handle_unbound_allowed_addr_pair_del("},{"line_number":541,"context_line":"                l3plugin, context, port, allowed_address_pairs)"}],"source_content_type":"text/x-python","patch_set":18,"id":"9a68dd71_ad521b65","line":538,"updated":"2016-01-25 20:46:59.000000000","message":"nit:\n\nallowed_address_pairs \u003d address_pairs or port.get(...)\n\nOr even:\n\nif not address_pairs:\n    address_pairs \u003d port.get(...)","commit_id":"f0d8994be086a19954768f41ee8dee919dcd2f23"},{"author":{"_account_id":1131,"name":"Brian Haley","email":"haleyb.dev@gmail.com","username":"brian-haley"},"change_message_id":"aeef694825bb5695b6bd0ae4792a4c3ea32a5f68","unresolved":false,"context_lines":[{"line_number":597,"context_line":"        if address_pairs:"},{"line_number":598,"context_line":"            allowed_address_pairs \u003d address_pairs"},{"line_number":599,"context_line":"        else:"},{"line_number":600,"context_line":"            allowed_address_pairs \u003d new_port.get(\u0027allowed_address_pairs\u0027, None)"},{"line_number":601,"context_line":"        if allowed_address_pairs and new_port_host:"},{"line_number":602,"context_line":"            if new_port_state:"},{"line_number":603,"context_line":"                _dvr_handle_unbound_allowed_addr_pair_add("}],"source_content_type":"text/x-python","patch_set":18,"id":"9a68dd71_8dde37db","line":600,"updated":"2016-01-25 20:46:59.000000000","message":"nit: ditto most above comments here","commit_id":"f0d8994be086a19954768f41ee8dee919dcd2f23"},{"author":{"_account_id":1131,"name":"Brian Haley","email":"haleyb.dev@gmail.com","username":"brian-haley"},"change_message_id":"84c51d24e11c49c11b6d8ca5572764dab619f0a0","unresolved":false,"context_lines":[{"line_number":503,"context_line":"            context, port,"},{"line_number":504,"context_line":"            allowed_address_pair))"},{"line_number":505,"context_line":"    if updated_port:"},{"line_number":506,"context_line":"        LOG.debug(\"Allowed address pair port binding restored \""},{"line_number":507,"context_line":"                  \"from service port binding: %s\", updated_port)"},{"line_number":508,"context_line":""},{"line_number":509,"context_line":""}],"source_content_type":"text/x-python","patch_set":21,"id":"7a5de9d1_e1806fc2","line":506,"updated":"2016-01-29 20:19:07.000000000","message":"s/restored/deleted","commit_id":"b7c8b40910eae81995a218c6f00070915aa8ae04"},{"author":{"_account_id":7016,"name":"Swaminathan Vasudevan","email":"swvasude@cisco.com","username":"souminathan"},"change_message_id":"68875cff251ab9d5efbe120e9696b7bbabaea733","unresolved":false,"context_lines":[{"line_number":503,"context_line":"            context, port,"},{"line_number":504,"context_line":"            allowed_address_pair))"},{"line_number":505,"context_line":"    if updated_port:"},{"line_number":506,"context_line":"        LOG.debug(\"Allowed address pair port binding restored \""},{"line_number":507,"context_line":"                  \"from service port binding: %s\", updated_port)"},{"line_number":508,"context_line":""},{"line_number":509,"context_line":""}],"source_content_type":"text/x-python","patch_set":21,"id":"7a5de9d1_ba9dc0bd","line":506,"in_reply_to":"7a5de9d1_e1806fc2","updated":"2016-01-29 21:12:03.000000000","message":"Done","commit_id":"b7c8b40910eae81995a218c6f00070915aa8ae04"},{"author":{"_account_id":1131,"name":"Brian Haley","email":"haleyb.dev@gmail.com","username":"brian-haley"},"change_message_id":"84c51d24e11c49c11b6d8ca5572764dab619f0a0","unresolved":false,"context_lines":[{"line_number":535,"context_line":"        if address_pairs:"},{"line_number":536,"context_line":"            allowed_address_pairs \u003d address_pairs"},{"line_number":537,"context_line":"        if not address_pairs:"},{"line_number":538,"context_line":"            allowed_address_pairs \u003d port.get(\u0027allowed_address_pairs\u0027, None)"},{"line_number":539,"context_line":"        if allowed_address_pairs and port_host:"},{"line_number":540,"context_line":"            _dvr_handle_unbound_allowed_addr_pair_del("},{"line_number":541,"context_line":"                l3plugin, context, port, allowed_address_pairs)"}],"source_content_type":"text/x-python","patch_set":21,"id":"7a5de9d1_e4063d1c","line":538,"updated":"2016-01-29 20:19:07.000000000","message":"These two if\u0027s can be simplified:\n\naap \u003d ap or port.get(...)\n\n(cut/pasted isn\u0027t working at the moment)","commit_id":"b7c8b40910eae81995a218c6f00070915aa8ae04"},{"author":{"_account_id":7016,"name":"Swaminathan Vasudevan","email":"swvasude@cisco.com","username":"souminathan"},"change_message_id":"68875cff251ab9d5efbe120e9696b7bbabaea733","unresolved":false,"context_lines":[{"line_number":535,"context_line":"        if address_pairs:"},{"line_number":536,"context_line":"            allowed_address_pairs \u003d address_pairs"},{"line_number":537,"context_line":"        if not address_pairs:"},{"line_number":538,"context_line":"            allowed_address_pairs \u003d port.get(\u0027allowed_address_pairs\u0027, None)"},{"line_number":539,"context_line":"        if allowed_address_pairs and port_host:"},{"line_number":540,"context_line":"            _dvr_handle_unbound_allowed_addr_pair_del("},{"line_number":541,"context_line":"                l3plugin, context, port, allowed_address_pairs)"}],"source_content_type":"text/x-python","patch_set":21,"id":"7a5de9d1_daa2fcfc","line":538,"in_reply_to":"7a5de9d1_e4063d1c","updated":"2016-01-29 21:12:03.000000000","message":"Done","commit_id":"b7c8b40910eae81995a218c6f00070915aa8ae04"},{"author":{"_account_id":1131,"name":"Brian Haley","email":"haleyb.dev@gmail.com","username":"brian-haley"},"change_message_id":"84c51d24e11c49c11b6d8ca5572764dab619f0a0","unresolved":false,"context_lines":[{"line_number":597,"context_line":"        if address_pairs:"},{"line_number":598,"context_line":"            allowed_address_pairs \u003d address_pairs"},{"line_number":599,"context_line":"        if not address_pairs:"},{"line_number":600,"context_line":"            allowed_address_pairs \u003d new_port.get(\u0027allowed_address_pairs\u0027, None)"},{"line_number":601,"context_line":"        if allowed_address_pairs and new_port_host:"},{"line_number":602,"context_line":"            if new_port_state:"},{"line_number":603,"context_line":"                _dvr_handle_unbound_allowed_addr_pair_add("}],"source_content_type":"text/x-python","patch_set":21,"id":"7a5de9d1_a47125aa","line":600,"updated":"2016-01-29 20:19:07.000000000","message":"Same comment as L538 above.","commit_id":"b7c8b40910eae81995a218c6f00070915aa8ae04"},{"author":{"_account_id":7016,"name":"Swaminathan Vasudevan","email":"swvasude@cisco.com","username":"souminathan"},"change_message_id":"68875cff251ab9d5efbe120e9696b7bbabaea733","unresolved":false,"context_lines":[{"line_number":597,"context_line":"        if address_pairs:"},{"line_number":598,"context_line":"            allowed_address_pairs \u003d address_pairs"},{"line_number":599,"context_line":"        if not address_pairs:"},{"line_number":600,"context_line":"            allowed_address_pairs \u003d new_port.get(\u0027allowed_address_pairs\u0027, None)"},{"line_number":601,"context_line":"        if allowed_address_pairs and new_port_host:"},{"line_number":602,"context_line":"            if new_port_state:"},{"line_number":603,"context_line":"                _dvr_handle_unbound_allowed_addr_pair_add("}],"source_content_type":"text/x-python","patch_set":21,"id":"7a5de9d1_7aa3c800","line":600,"in_reply_to":"7a5de9d1_a47125aa","updated":"2016-01-29 21:12:03.000000000","message":"Done","commit_id":"b7c8b40910eae81995a218c6f00070915aa8ae04"},{"author":{"_account_id":10583,"name":"Praveen Yalagandula","email":"ypraveen@gmail.com","username":"ypraveen"},"change_message_id":"da9f03bae46dbd97ea6507171f7cc709c93ce30e","unresolved":false,"context_lines":[{"line_number":300,"context_line":"                  \"based on service port binding: %s\", updated_port)"},{"line_number":301,"context_line":"        plugin.dvr_handle_new_service_port(context, updated_port)"},{"line_number":302,"context_line":"        plugin.update_arp_entry_for_new_service_port("},{"line_number":303,"context_line":"            context, updated_port)"},{"line_number":304,"context_line":""},{"line_number":305,"context_line":""},{"line_number":306,"context_line":"def _dvr_handle_unbound_allowed_addr_pair_del("}],"source_content_type":"text/x-python","patch_set":24,"id":"3a57f1b5_108f1776","line":303,"updated":"2016-02-12 02:55:40.000000000","message":"Did you mean update_arp_entry_for_dvr_service_port?\nAlso, the ARP table should be updated with port\u0027s MAC instead of updated_port\u0027s MAC.","commit_id":"86b404c765874ab11d51ab3221d0b3e00f4028a2"},{"author":{"_account_id":10583,"name":"Praveen Yalagandula","email":"ypraveen@gmail.com","username":"ypraveen"},"change_message_id":"a1a9ad265ef7959e16749442e3a84adfc3e54537","unresolved":false,"context_lines":[{"line_number":399,"context_line":"        if address_pairs:"},{"line_number":400,"context_line":"            allowed_address_pairs \u003d ("},{"line_number":401,"context_line":"                address_pairs or new_port.get(\u0027allowed_address_pairs\u0027, None))"},{"line_number":402,"context_line":"        if allowed_address_pairs and new_port_host:"},{"line_number":403,"context_line":"            if new_port_state:"},{"line_number":404,"context_line":"                _dvr_handle_unbound_allowed_addr_pair_add("},{"line_number":405,"context_line":"                    l3plugin, context, new_port, allowed_address_pairs)"}],"source_content_type":"text/x-python","patch_set":24,"id":"3a57f1b5_30eed3b4","line":402,"range":{"start_line":402,"start_character":11,"end_line":402,"end_character":32},"updated":"2016-02-12 03:06:18.000000000","message":"One of my colleagues (Siva Kollipara) pointed out that there could be more than one allowed_address_pair on a port. So the code needs to loop over each of them.","commit_id":"86b404c765874ab11d51ab3221d0b3e00f4028a2"},{"author":{"_account_id":10583,"name":"Praveen Yalagandula","email":"ypraveen@gmail.com","username":"ypraveen"},"change_message_id":"a1a9ad265ef7959e16749442e3a84adfc3e54537","unresolved":false,"context_lines":[{"line_number":404,"context_line":"                _dvr_handle_unbound_allowed_addr_pair_add("},{"line_number":405,"context_line":"                    l3plugin, context, new_port, allowed_address_pairs)"},{"line_number":406,"context_line":"                return"},{"line_number":407,"context_line":"            if original_port_state:"},{"line_number":408,"context_line":"                _dvr_handle_unbound_allowed_addr_pair_del("},{"line_number":409,"context_line":"                    l3plugin, context, original_port, allowed_address_pairs)"},{"line_number":410,"context_line":"                return"},{"line_number":411,"context_line":"        is_fixed_ips_changed \u003d ("},{"line_number":412,"context_line":"            \u0027fixed_ips\u0027 in new_port and"},{"line_number":413,"context_line":"            \u0027fixed_ips\u0027 in original_port and"}],"source_content_type":"text/x-python","patch_set":24,"id":"3a57f1b5_70dbebec","line":410,"range":{"start_line":407,"start_character":0,"end_line":410,"end_character":22},"updated":"2016-02-12 03:06:18.000000000","message":"Shouldn\u0027t we delete first and then add next?\nAlso, if the original port had a different set of allowed_address_pairs than the new port, this logic does not work well either.\n\nAnother optimization: if the portbindings.HOSTID did not change and the allowed_address_pairs are still same, then you don\u0027t need to run this","commit_id":"86b404c765874ab11d51ab3221d0b3e00f4028a2"},{"author":{"_account_id":10583,"name":"Praveen Yalagandula","email":"ypraveen@gmail.com","username":"ypraveen"},"change_message_id":"ce3d58c1e9d790554d108490f7abd5a727b2c633","unresolved":false,"context_lines":[{"line_number":329,"context_line":"        LOG.debug(\"Allowed address pair port binding updated \""},{"line_number":330,"context_line":"                  \"based on service port binding: %s\", updated_port)"},{"line_number":331,"context_line":"        plugin.dvr_handle_new_service_port(context, updated_port)"},{"line_number":332,"context_line":"        plugin.update_arp_entry_for_dvr_service_port("},{"line_number":333,"context_line":"            context, port, allowed_address_pair_port\u003dupdated_port)"},{"line_number":334,"context_line":"    else:"},{"line_number":335,"context_line":"        # If there is no fip associated with the allowed address"},{"line_number":336,"context_line":"        # ports, we just need to update the arp entry for these"},{"line_number":337,"context_line":"        # addresses with the dvr service port Mac address"},{"line_number":338,"context_line":"        for address_port in allowed_address_ports:"},{"line_number":339,"context_line":"            plugin.update_arp_entry_for_dvr_service_port("},{"line_number":340,"context_line":"                context, port, allowed_address_pair_port\u003daddress_port)"},{"line_number":341,"context_line":""},{"line_number":342,"context_line":""},{"line_number":343,"context_line":"def _dvr_handle_unbound_allowed_addr_pair_del("}],"source_content_type":"text/x-python","patch_set":29,"id":"bae84128_4d071eca","line":340,"range":{"start_line":332,"start_character":1,"end_line":340,"end_character":70},"updated":"2016-02-23 07:10:27.000000000","message":"All of this could be simplified out if we update_arp_entry_for_dvr_service_port directly reads the allowed_address_pairs from the \"port\" instead of passing the extra port information.","commit_id":"6324021ef3b2f7376f7471be34c838f114cd023e"},{"author":{"_account_id":7016,"name":"Swaminathan Vasudevan","email":"swvasude@cisco.com","username":"souminathan"},"change_message_id":"37084a09cf643913d4cff2c0e5cac04298af72fa","unresolved":false,"context_lines":[{"line_number":329,"context_line":"        LOG.debug(\"Allowed address pair port binding updated \""},{"line_number":330,"context_line":"                  \"based on service port binding: %s\", updated_port)"},{"line_number":331,"context_line":"        plugin.dvr_handle_new_service_port(context, updated_port)"},{"line_number":332,"context_line":"        plugin.update_arp_entry_for_dvr_service_port("},{"line_number":333,"context_line":"            context, port, allowed_address_pair_port\u003dupdated_port)"},{"line_number":334,"context_line":"    else:"},{"line_number":335,"context_line":"        # If there is no fip associated with the allowed address"},{"line_number":336,"context_line":"        # ports, we just need to update the arp entry for these"},{"line_number":337,"context_line":"        # addresses with the dvr service port Mac address"},{"line_number":338,"context_line":"        for address_port in allowed_address_ports:"},{"line_number":339,"context_line":"            plugin.update_arp_entry_for_dvr_service_port("},{"line_number":340,"context_line":"                context, port, allowed_address_pair_port\u003daddress_port)"},{"line_number":341,"context_line":""},{"line_number":342,"context_line":""},{"line_number":343,"context_line":"def _dvr_handle_unbound_allowed_addr_pair_del("}],"source_content_type":"text/x-python","patch_set":29,"id":"7af24918_79f2f9d3","line":340,"range":{"start_line":332,"start_character":1,"end_line":340,"end_character":70},"in_reply_to":"bae84128_4d071eca","updated":"2016-03-01 23:24:34.000000000","message":"They are two different ports.\nOne is the \u0027vm or compute\u0027 port and the other one is the \u0027allowed-address-pair-port\u0027","commit_id":"6324021ef3b2f7376f7471be34c838f114cd023e"},{"author":{"_account_id":1131,"name":"Brian Haley","email":"haleyb.dev@gmail.com","username":"brian-haley"},"change_message_id":"95d83b7022c3777cf70042eaed2c5e767ec6c88f","unresolved":false,"context_lines":[{"line_number":429,"context_line":"                    _dvr_handle_unbound_allowed_addr_pair_add("},{"line_number":430,"context_line":"                        l3plugin, context, new_port, address_pair)"},{"line_number":431,"context_line":"                return"},{"line_number":432,"context_line":"            if original_port_state and not new_port_state:"},{"line_number":433,"context_line":"                # Case were we deactivate the port from active state."},{"line_number":434,"context_line":"                for address_pair in allowed_address_pairs_list:"},{"line_number":435,"context_line":"                    _dvr_handle_unbound_allowed_addr_pair_del("}],"source_content_type":"text/x-python","patch_set":34,"id":"3afc51ec_db4ad6ab","line":432,"updated":"2016-03-15 03:19:16.000000000","message":"nit: elif","commit_id":"2075a5472ad95cac5b019db5ff0c451d9ee6e9f4"},{"author":{"_account_id":7016,"name":"Swaminathan Vasudevan","email":"swvasude@cisco.com","username":"souminathan"},"change_message_id":"3791652d6bc5de5a75dd5a3055089219f9a0a3e2","unresolved":false,"context_lines":[{"line_number":429,"context_line":"                    _dvr_handle_unbound_allowed_addr_pair_add("},{"line_number":430,"context_line":"                        l3plugin, context, new_port, address_pair)"},{"line_number":431,"context_line":"                return"},{"line_number":432,"context_line":"            if original_port_state and not new_port_state:"},{"line_number":433,"context_line":"                # Case were we deactivate the port from active state."},{"line_number":434,"context_line":"                for address_pair in allowed_address_pairs_list:"},{"line_number":435,"context_line":"                    _dvr_handle_unbound_allowed_addr_pair_del("}],"source_content_type":"text/x-python","patch_set":34,"id":"1af94dfe_7c72037e","line":432,"in_reply_to":"3afc51ec_db4ad6ab","updated":"2016-03-15 16:31:29.000000000","message":"Done","commit_id":"2075a5472ad95cac5b019db5ff0c451d9ee6e9f4"},{"author":{"_account_id":1131,"name":"Brian Haley","email":"haleyb.dev@gmail.com","username":"brian-haley"},"change_message_id":"95d83b7022c3777cf70042eaed2c5e767ec6c88f","unresolved":false,"context_lines":[{"line_number":435,"context_line":"                    _dvr_handle_unbound_allowed_addr_pair_del("},{"line_number":436,"context_line":"                        l3plugin, context, original_port, address_pair)"},{"line_number":437,"context_line":"                return"},{"line_number":438,"context_line":"            if new_port_state and original_port_state:"},{"line_number":439,"context_line":"                # Case were the same port has additional address_pairs"},{"line_number":440,"context_line":"                # added."},{"line_number":441,"context_line":"                for address_pair in allowed_address_pairs_list:"}],"source_content_type":"text/x-python","patch_set":34,"id":"3afc51ec_3bc81a22","line":438,"updated":"2016-03-15 03:19:16.000000000","message":"nit: elif","commit_id":"2075a5472ad95cac5b019db5ff0c451d9ee6e9f4"},{"author":{"_account_id":7016,"name":"Swaminathan Vasudevan","email":"swvasude@cisco.com","username":"souminathan"},"change_message_id":"3791652d6bc5de5a75dd5a3055089219f9a0a3e2","unresolved":false,"context_lines":[{"line_number":435,"context_line":"                    _dvr_handle_unbound_allowed_addr_pair_del("},{"line_number":436,"context_line":"                        l3plugin, context, original_port, address_pair)"},{"line_number":437,"context_line":"                return"},{"line_number":438,"context_line":"            if new_port_state and original_port_state:"},{"line_number":439,"context_line":"                # Case were the same port has additional address_pairs"},{"line_number":440,"context_line":"                # added."},{"line_number":441,"context_line":"                for address_pair in allowed_address_pairs_list:"}],"source_content_type":"text/x-python","patch_set":34,"id":"1af94dfe_5c6f4792","line":438,"in_reply_to":"3afc51ec_3bc81a22","updated":"2016-03-15 16:31:29.000000000","message":"Done","commit_id":"2075a5472ad95cac5b019db5ff0c451d9ee6e9f4"}],"neutron/plugins/ml2/plugin.py":[{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"418f591346181a4caf5dc383a8ed8a39ddd7148d","unresolved":false,"context_lines":[{"line_number":1220,"context_line":""},{"line_number":1221,"context_line":"        if addr_pair.ADDRESS_PAIRS in attrs:"},{"line_number":1222,"context_line":"            addr_pairs \u003d self.get_allowed_address_pairs(context, id)"},{"line_number":1223,"context_line":"            LOG.debug(\"Address pairs list: %s\", addr_pairs)"},{"line_number":1224,"context_line":"        # Notifications must be sent after the above transaction is complete"},{"line_number":1225,"context_line":"        kwargs \u003d {"},{"line_number":1226,"context_line":"            \u0027context\u0027: context,"}],"source_content_type":"text/x-python","patch_set":9,"id":"fa69d971_539c9c0e","line":1223,"range":{"start_line":1223,"start_character":12,"end_line":1223,"end_character":59},"updated":"2016-01-05 22:17:33.000000000","message":"Do we want to leave this debug in?","commit_id":"2c361f716ec4415efced44446e583b5f2879e1c2"},{"author":{"_account_id":7016,"name":"Swaminathan Vasudevan","email":"swvasude@cisco.com","username":"souminathan"},"change_message_id":"59b35ee24db3f5bcb5d0e81dd742d3db77ef1543","unresolved":false,"context_lines":[{"line_number":1220,"context_line":""},{"line_number":1221,"context_line":"        if addr_pair.ADDRESS_PAIRS in attrs:"},{"line_number":1222,"context_line":"            addr_pairs \u003d self.get_allowed_address_pairs(context, id)"},{"line_number":1223,"context_line":"            LOG.debug(\"Address pairs list: %s\", addr_pairs)"},{"line_number":1224,"context_line":"        # Notifications must be sent after the above transaction is complete"},{"line_number":1225,"context_line":"        kwargs \u003d {"},{"line_number":1226,"context_line":"            \u0027context\u0027: context,"}],"source_content_type":"text/x-python","patch_set":9,"id":"fa69d971_1a4f106c","line":1223,"range":{"start_line":1223,"start_character":12,"end_line":1223,"end_character":59},"in_reply_to":"fa69d971_539c9c0e","updated":"2016-01-06 01:51:31.000000000","message":"Done","commit_id":"2c361f716ec4415efced44446e583b5f2879e1c2"}],"neutron/tests/functional/services/l3_router/test_l3_dvr_router_plugin.py":[{"author":{"_account_id":13667,"name":"ZongKai LI","email":"onionpiece@163.com","username":"lzklibj"},"change_message_id":"b89c51d06417177b5b04ccfa132bf1e125ea238d","unresolved":false,"context_lines":[{"line_number":501,"context_line":"                self.context, {\u0027floatingip\u0027: floating_ip})"},{"line_number":502,"context_line":""},{"line_number":503,"context_line":"            # since there are no vm ports on HOST, at this point the router"},{"line_number":504,"context_line":"            # should be scheduled to only dvr_snat agent"},{"line_number":505,"context_line":"            agents \u003d self.l3_plugin.list_l3_agents_hosting_router("},{"line_number":506,"context_line":"                self.context, router[\u0027id\u0027])"},{"line_number":507,"context_line":"            self.assertEqual(2, len(agents[\u0027agents\u0027]))"}],"source_content_type":"text/x-python","patch_set":16,"id":"9a68dd71_f902f56e","line":504,"updated":"2016-01-20 16:10:07.000000000","message":"\"no vm pors on HOST\", the \"HOST\" here, do you mean self.l3_agent[\u0027host\u0027]?\n\n\"should be scheduled to only dvr_snat agent\", \"only\"? what do you mean by \"only\"?","commit_id":"8a762d4643fea0e0fe77709c027441e815561a2d"},{"author":{"_account_id":7016,"name":"Swaminathan Vasudevan","email":"swvasude@cisco.com","username":"souminathan"},"change_message_id":"e9dd0b5cafad1d47294c0b830320e4df4162e6cf","unresolved":false,"context_lines":[{"line_number":501,"context_line":"                self.context, {\u0027floatingip\u0027: floating_ip})"},{"line_number":502,"context_line":""},{"line_number":503,"context_line":"            # since there are no vm ports on HOST, at this point the router"},{"line_number":504,"context_line":"            # should be scheduled to only dvr_snat agent"},{"line_number":505,"context_line":"            agents \u003d self.l3_plugin.list_l3_agents_hosting_router("},{"line_number":506,"context_line":"                self.context, router[\u0027id\u0027])"},{"line_number":507,"context_line":"            self.assertEqual(2, len(agents[\u0027agents\u0027]))"}],"source_content_type":"text/x-python","patch_set":16,"id":"9a68dd71_b4751299","line":504,"in_reply_to":"9a68dd71_f902f56e","updated":"2016-01-21 22:03:50.000000000","message":"Done","commit_id":"8a762d4643fea0e0fe77709c027441e815561a2d"},{"author":{"_account_id":13667,"name":"ZongKai LI","email":"onionpiece@163.com","username":"lzklibj"},"change_message_id":"c5ba33de1c9df0ab07e5e3ea241fc8b698d8c8b5","unresolved":false,"context_lines":[{"line_number":541,"context_line":"                self.assertFalse(mod_int_port[\u0027admin_state_up\u0027])"},{"line_number":542,"context_line":"                new_vrrp_port_db \u003d self.core_plugin.get_port("},{"line_number":543,"context_line":"                    self.context, cur_vrrp_port_db[\u0027id\u0027])"},{"line_number":544,"context_line":"                self.assertEqual("},{"line_number":545,"context_line":"                    new_vrrp_port_db[\u0027device_owner\u0027],"},{"line_number":546,"context_line":"                    constants.DEVICE_OWNER_LOADBALANCER)"},{"line_number":547,"context_line":"                new_port_profile \u003d new_vrrp_port_db.get(portbindings.PROFILE)"},{"line_number":548,"context_line":"                self.assertEqual({}, new_port_profile)"},{"line_number":549,"context_line":"                self.assertNotEqual("}],"source_content_type":"text/x-python","patch_set":32,"id":"7af24918_fa44deb7","line":546,"range":{"start_line":544,"start_character":16,"end_line":546,"end_character":56},"updated":"2016-03-03 07:32:25.000000000","message":"In this test, there are several assertions for vrrp port device_owner. Such as L515-516, L525-527, L561-562 and here. I don\u0027t think they are all necessary.\n\nSince vrrp port has device_owner configured, so it won\u0027t change its device_owner. As this patch commit message mentioned, only when allowed address pairs port doesn\u0027t have device_owner configured will inherit device_owner from service_port.\n\nIf you don\u0027t want to test with a port doesn\u0027t have device_owner configured, you nor need to assert device_owner for a port has device_owner configured too many times.","commit_id":"f81a9220e31eac122c2886dc3da33ca431e1d4da"},{"author":{"_account_id":7016,"name":"Swaminathan Vasudevan","email":"swvasude@cisco.com","username":"souminathan"},"change_message_id":"4c10381734474b5f524b486b56c11c6d41a7f137","unresolved":false,"context_lines":[{"line_number":541,"context_line":"                self.assertFalse(mod_int_port[\u0027admin_state_up\u0027])"},{"line_number":542,"context_line":"                new_vrrp_port_db \u003d self.core_plugin.get_port("},{"line_number":543,"context_line":"                    self.context, cur_vrrp_port_db[\u0027id\u0027])"},{"line_number":544,"context_line":"                self.assertEqual("},{"line_number":545,"context_line":"                    new_vrrp_port_db[\u0027device_owner\u0027],"},{"line_number":546,"context_line":"                    constants.DEVICE_OWNER_LOADBALANCER)"},{"line_number":547,"context_line":"                new_port_profile \u003d new_vrrp_port_db.get(portbindings.PROFILE)"},{"line_number":548,"context_line":"                self.assertEqual({}, new_port_profile)"},{"line_number":549,"context_line":"                self.assertNotEqual("}],"source_content_type":"text/x-python","patch_set":32,"id":"7af24918_03064951","line":546,"range":{"start_line":544,"start_character":16,"end_line":546,"end_character":56},"in_reply_to":"7af24918_fa44deb7","updated":"2016-03-03 20:28:38.000000000","message":"Yes got your point.\nI will fix it.","commit_id":"f81a9220e31eac122c2886dc3da33ca431e1d4da"},{"author":{"_account_id":13667,"name":"ZongKai LI","email":"onionpiece@163.com","username":"lzklibj"},"change_message_id":"51d8d7654cf9b93b2db91e4478ece49a9df8dd4a","unresolved":false,"context_lines":[{"line_number":589,"context_line":"                self.assertEqual("},{"line_number":590,"context_line":"                    updated_vrrp_port_db[\u0027device_owner\u0027], DEVICE_OWNER_COMPUTE)"},{"line_number":591,"context_line":"                self.assertEqual("},{"line_number":592,"context_line":"                    updated_vrrp_port_db[portbindings.HOST_ID], HOST1)"},{"line_number":593,"context_line":""},{"line_number":594,"context_line":"    def test_update_vm_port_host_router_update(self):"},{"line_number":595,"context_line":"        # register l3 agents in dvr mode in addition to existing dvr_snat agent"}],"source_content_type":"text/x-python","patch_set":33,"id":"7af24918_3bd6024f","line":592,"updated":"2016-03-04 01:59:28.000000000","message":"The new added test code is real cool! Thanks.","commit_id":"a83bff895ab07de4a242b08d8bc32c95334e8dd0"}]}
