)]}'
{"neutron/plugins/ml2/extensions/dns_integration.py":[{"author":{"_account_id":7787,"name":"Kevin Benton","email":"kevin@benton.pub","username":"blak111"},"change_message_id":"2f03c52396c922e63445fa342c247b5bc53a5c14","unresolved":false,"context_lines":[{"line_number":116,"context_line":"    def _calculate_current_dns_name_and_domain(self, dns_name,"},{"line_number":117,"context_line":"                                               external_dns_domain,"},{"line_number":118,"context_line":"                                               no_external_dns_service):"},{"line_number":119,"context_line":"        if (no_external_dns_service or not (dns_name and external_dns_domain)):"},{"line_number":120,"context_line":"            return \u0027\u0027, \u0027\u0027"},{"line_number":121,"context_line":"        return dns_name, external_dns_domain"},{"line_number":122,"context_line":""}],"source_content_type":"text/x-python","patch_set":13,"id":"3f1d235d_4577f8d5","line":119,"updated":"2017-06-30 21:11:16.000000000","message":"can you move the second half of this boolean into an intermediary variable above this to make it clear what it\u0027s checking? I think I got it but a clarification would be good.\n\ne.g. external_data_set \u003d dns_name and external_dns_domain","commit_id":"95eeb22a2798efb3ebe3ae40be05ae0ab4b3e7f8"},{"author":{"_account_id":4694,"name":"Miguel Lavalle","email":"miguel@mlavalle.com","username":"minsel"},"change_message_id":"e1384947b61794027536301079a4fcdef140294b","unresolved":false,"context_lines":[{"line_number":116,"context_line":"    def _calculate_current_dns_name_and_domain(self, dns_name,"},{"line_number":117,"context_line":"                                               external_dns_domain,"},{"line_number":118,"context_line":"                                               no_external_dns_service):"},{"line_number":119,"context_line":"        if (no_external_dns_service or not (dns_name and external_dns_domain)):"},{"line_number":120,"context_line":"            return \u0027\u0027, \u0027\u0027"},{"line_number":121,"context_line":"        return dns_name, external_dns_domain"},{"line_number":122,"context_line":""}],"source_content_type":"text/x-python","patch_set":13,"id":"3f1d235d_77285fe1","line":119,"in_reply_to":"3f1d235d_4577f8d5","updated":"2017-07-01 23:21:45.000000000","message":"Done","commit_id":"95eeb22a2798efb3ebe3ae40be05ae0ab4b3e7f8"},{"author":{"_account_id":841,"name":"Akihiro Motoki","email":"amotoki@gmail.com","username":"amotoki"},"change_message_id":"cea998f25f8f3ab0cd3d7930de0ada6017c88424","unresolved":false,"context_lines":[{"line_number":100,"context_line":"                dns_name, external_dns_domain,"},{"line_number":101,"context_line":"                self.external_dns_not_needed(plugin_context, network)))"},{"line_number":102,"context_line":""},{"line_number":103,"context_line":"        dns_data_db \u003d port_obj.PortDNS("},{"line_number":104,"context_line":"            plugin_context,"},{"line_number":105,"context_line":"            port_id\u003ddb_data[\u0027id\u0027],"},{"line_number":106,"context_line":"            current_dns_name\u003dcurrent_dns_name,"}],"source_content_type":"text/x-python","patch_set":16,"id":"df3967d1_aa42be3c","line":103,"range":{"start_line":103,"start_character":8,"end_line":103,"end_character":19},"updated":"2017-08-02 22:02:10.000000000","message":"This is not a sqlalchemy db data but OVO instance, so I think dns_data_obj is better.","commit_id":"5206fa94053ece1fcf7d7b341e466e2201b84ce8"},{"author":{"_account_id":4694,"name":"Miguel Lavalle","email":"miguel@mlavalle.com","username":"minsel"},"change_message_id":"21ed61303feaf764ee30f3e1bf18af6f97babf9a","unresolved":false,"context_lines":[{"line_number":100,"context_line":"                dns_name, external_dns_domain,"},{"line_number":101,"context_line":"                self.external_dns_not_needed(plugin_context, network)))"},{"line_number":102,"context_line":""},{"line_number":103,"context_line":"        dns_data_db \u003d port_obj.PortDNS("},{"line_number":104,"context_line":"            plugin_context,"},{"line_number":105,"context_line":"            port_id\u003ddb_data[\u0027id\u0027],"},{"line_number":106,"context_line":"            current_dns_name\u003dcurrent_dns_name,"}],"source_content_type":"text/x-python","patch_set":16,"id":"df3967d1_525e4e76","line":103,"range":{"start_line":103,"start_character":8,"end_line":103,"end_character":19},"in_reply_to":"df3967d1_aa42be3c","updated":"2017-08-03 16:47:18.000000000","message":"Sounds reasonable","commit_id":"5206fa94053ece1fcf7d7b341e466e2201b84ce8"},{"author":{"_account_id":7787,"name":"Kevin Benton","email":"kevin@benton.pub","username":"blak111"},"change_message_id":"999dbc9a4bb922cac79822ee355ffdbabea90418","unresolved":false,"context_lines":[{"line_number":124,"context_line":"        #    dns_name"},{"line_number":125,"context_line":"        # 3) The user request contains a valid non-blank value for the port\u0027s"},{"line_number":126,"context_line":"        #    dns_domain or the port\u0027s network has a non-blank value in its"},{"line_number":127,"context_line":"        #    dns_domain attribute"},{"line_number":128,"context_line":"        are_both_dns_attributes_set \u003d dns_name and external_dns_domain"},{"line_number":129,"context_line":"        if no_external_dns_service or not are_both_dns_attributes_set:"},{"line_number":130,"context_line":"            return \u0027\u0027, \u0027\u0027"}],"source_content_type":"text/x-python","patch_set":19,"id":"df3967d1_4bafb07c","line":127,"updated":"2017-08-03 21:53:22.000000000","message":"Do you think it would be a good idea to throw a BadRequest exception if they specify a dns_name but the dns_domain is not set on either the port or the network?","commit_id":"52f776ead30ca2e6a10cb9e6ba0b625764722571"},{"author":{"_account_id":4694,"name":"Miguel Lavalle","email":"miguel@mlavalle.com","username":"minsel"},"change_message_id":"ea531d1f1ae727bcf65ad86963d0ac1b56f773bd","unresolved":false,"context_lines":[{"line_number":124,"context_line":"        #    dns_name"},{"line_number":125,"context_line":"        # 3) The user request contains a valid non-blank value for the port\u0027s"},{"line_number":126,"context_line":"        #    dns_domain or the port\u0027s network has a non-blank value in its"},{"line_number":127,"context_line":"        #    dns_domain attribute"},{"line_number":128,"context_line":"        are_both_dns_attributes_set \u003d dns_name and external_dns_domain"},{"line_number":129,"context_line":"        if no_external_dns_service or not are_both_dns_attributes_set:"},{"line_number":130,"context_line":"            return \u0027\u0027, \u0027\u0027"}],"source_content_type":"text/x-python","patch_set":19,"id":"bf3e73b7_70bd7067","line":127,"in_reply_to":"df3967d1_4bafb07c","updated":"2017-08-04 21:01:18.000000000","message":"No. dns_name is used in internal DNS integration, and can be set regardless of whether there is a corresponding dns_domain in the port or the network. The history of these attributes is the following:\n\n1) We added dns_name to ports in internal DNS integration (dnsmasq)\n\n2) Later, we added dns_name to floating IPs and dns_domain to floating IPs and networks in external DNS integration (Designate or other external driver)\n\n3) In this patchset we are adding dns_domain to ports","commit_id":"52f776ead30ca2e6a10cb9e6ba0b625764722571"},{"author":{"_account_id":7787,"name":"Kevin Benton","email":"kevin@benton.pub","username":"blak111"},"change_message_id":"c87cd4875986b07cdc9030373254805fad6a3ee4","unresolved":false,"context_lines":[{"line_number":328,"context_line":""},{"line_number":329,"context_line":"    @property"},{"line_number":330,"context_line":"    def extension_alias(self):"},{"line_number":331,"context_line":"        return self._supported_extension_alias"},{"line_number":332,"context_line":""},{"line_number":333,"context_line":"    def initialize(self):"},{"line_number":334,"context_line":"        LOG.info(_LI(\"DNSDomainPortsExtensionDriver initialization complete\"))"}],"source_content_type":"text/x-python","patch_set":21,"id":"bf3e73b7_ffca4b4d","side":"PARENT","line":331,"updated":"2017-08-05 01:32:01.000000000","message":"Why was this removed?","commit_id":"0adb29f0f09793c9d27444c8427905ec1b08e593"},{"author":{"_account_id":4694,"name":"Miguel Lavalle","email":"miguel@mlavalle.com","username":"minsel"},"change_message_id":"716760f09cbe8501b9a98c5618e0e3bc8dc55ba3","unresolved":false,"context_lines":[{"line_number":328,"context_line":""},{"line_number":329,"context_line":"    @property"},{"line_number":330,"context_line":"    def extension_alias(self):"},{"line_number":331,"context_line":"        return self._supported_extension_alias"},{"line_number":332,"context_line":""},{"line_number":333,"context_line":"    def initialize(self):"},{"line_number":334,"context_line":"        LOG.info(_LI(\"DNSDomainPortsExtensionDriver initialization complete\"))"}],"source_content_type":"text/x-python","patch_set":21,"id":"bf3e73b7_cb8d867c","side":"PARENT","line":331,"in_reply_to":"bf3e73b7_ffca4b4d","updated":"2017-08-06 01:01:37.000000000","message":"We can inherit it from L41 above. I added this class in the first patchset of the series: https://review.openstack.org/#/c/457101 and when working on this one, I realized we don\u0027t need to re-define it here. Should this be another patchset?","commit_id":"0adb29f0f09793c9d27444c8427905ec1b08e593"},{"author":{"_account_id":7787,"name":"Kevin Benton","email":"kevin@benton.pub","username":"blak111"},"change_message_id":"c87cd4875986b07cdc9030373254805fad6a3ee4","unresolved":false,"context_lines":[{"line_number":124,"context_line":"        #    dns_name"},{"line_number":125,"context_line":"        # 3) The user request contains a valid non-blank value for the port\u0027s"},{"line_number":126,"context_line":"        #    dns_domain or the port\u0027s network has a non-blank value in its"},{"line_number":127,"context_line":"        #    dns_domain attribute"},{"line_number":128,"context_line":"        are_both_dns_attributes_set \u003d dns_name and external_dns_domain"},{"line_number":129,"context_line":"        if no_external_dns_service or not are_both_dns_attributes_set:"},{"line_number":130,"context_line":"            return \u0027\u0027, \u0027\u0027"}],"source_content_type":"text/x-python","patch_set":21,"id":"bf3e73b7_7fb77bda","line":127,"updated":"2017-08-05 01:32:01.000000000","message":"I\u0027m still a little confused about point 3 here. If the user passes in a dns_name but both dns_domain for port and network are blank, aren\u0027t we throwing away the name they provided by returning nothing on L130?\n\nIf that\u0027s the case it seems like we are silently discarding API data they pass in.","commit_id":"d9f3b35751418003a24cdd3fb96af9ef9721a16a"},{"author":{"_account_id":7787,"name":"Kevin Benton","email":"kevin@benton.pub","username":"blak111"},"change_message_id":"c08a3188a81ea01e3a96bf53fd0ebf93e9656fc7","unresolved":false,"context_lines":[{"line_number":124,"context_line":"        #    dns_name"},{"line_number":125,"context_line":"        # 3) The user request contains a valid non-blank value for the port\u0027s"},{"line_number":126,"context_line":"        #    dns_domain or the port\u0027s network has a non-blank value in its"},{"line_number":127,"context_line":"        #    dns_domain attribute"},{"line_number":128,"context_line":"        are_both_dns_attributes_set \u003d dns_name and external_dns_domain"},{"line_number":129,"context_line":"        if no_external_dns_service or not are_both_dns_attributes_set:"},{"line_number":130,"context_line":"            return \u0027\u0027, \u0027\u0027"}],"source_content_type":"text/x-python","patch_set":21,"id":"9f436f4f_b683bc56","line":127,"in_reply_to":"bf3e73b7_6b21fa9f","updated":"2017-08-08 17:00:02.000000000","message":"I see now. This is only used for sending to external service.","commit_id":"d9f3b35751418003a24cdd3fb96af9ef9721a16a"},{"author":{"_account_id":4694,"name":"Miguel Lavalle","email":"miguel@mlavalle.com","username":"minsel"},"change_message_id":"716760f09cbe8501b9a98c5618e0e3bc8dc55ba3","unresolved":false,"context_lines":[{"line_number":124,"context_line":"        #    dns_name"},{"line_number":125,"context_line":"        # 3) The user request contains a valid non-blank value for the port\u0027s"},{"line_number":126,"context_line":"        #    dns_domain or the port\u0027s network has a non-blank value in its"},{"line_number":127,"context_line":"        #    dns_domain attribute"},{"line_number":128,"context_line":"        are_both_dns_attributes_set \u003d dns_name and external_dns_domain"},{"line_number":129,"context_line":"        if no_external_dns_service or not are_both_dns_attributes_set:"},{"line_number":130,"context_line":"            return \u0027\u0027, \u0027\u0027"}],"source_content_type":"text/x-python","patch_set":21,"id":"bf3e73b7_6b21fa9f","line":127,"in_reply_to":"bf3e73b7_7fb77bda","updated":"2017-08-06 01:01:37.000000000","message":"The PortDNS object has fields dns_name and dns_domain to store the corresponding attributes received from the API, regardless of whether they will be sent to the external DNS service or not. This method is only called from L98 above. After its execution, L103-L112 will store the dns_name and dns_domain received from the API regardless of what we decide in this method.\n\nIn this method we are deciding whether we want to store the dns_name and dns_domain we received from the API (in this call or a combination of this call and a previous one) in another two fields in PortDNS, current_dns_name and current_dns_domain. These fields are used to tell the DNS driver to send data to the external DNS service. But that can only be done if we have a valid dns_name (from the port) and a valid dns_domain (from the port or the network).\n\nLet\u0027s look at an example: https://review.openstack.org/#/c/491096/1/neutron/tests/unit/plugins/ml2/extensions/test_dns_integration.py@613. In this test case, a port is created with a valid dns_name (\u0027port-dns-name\u0027) and no dns_domain either in the port or the network. After creating the port (L614), this is what we have in PortDNS:\n\n(Pdb) dns_data_db\nPortDNS(current_dns_domain\u003d\u0027\u0027,current_dns_name\u003d\u0027\u0027,dns_domain\u003d\u0027\u0027,dns_name\u003d\u0027port-dns-name\u0027,port_id\u003dc897b958-4def-404b-972c-43e09f0d074e,previous_dns_domain\u003d\u0027\u0027,previous_dns_name\u003d\u0027\u0027)\n\nAs you can see, we stored the dns_name passed in the port create call. Then we update the port L615-616, adding a dns_domain (\u0027port-dns-domain.com.\u0027) to it. This is what PortDNS looks after the update:\n\n(Pdb) dns_data_db\nPortDNS(current_dns_domain\u003d\u0027port-dns-domain.com.\u0027,current_dns_name\u003d\u0027port-dns-name\u0027,dns_domain\u003d\u0027port-dns-domain.com.\u0027,dns_name\u003d\u0027port-dns-name\u0027,port_id\u003dc897b958-4def-404b-972c-43e09f0d074e,previous_dns_domain\u003d\u0027\u0027,previous_dns_name\u003d\u0027\u0027)\n\nAt this point we have enough data to send them to the external DNS service and that is reflected in current_dns_name and current_dns_domain","commit_id":"d9f3b35751418003a24cdd3fb96af9ef9721a16a"},{"author":{"_account_id":7787,"name":"Kevin Benton","email":"kevin@benton.pub","username":"blak111"},"change_message_id":"c87cd4875986b07cdc9030373254805fad6a3ee4","unresolved":false,"context_lines":[{"line_number":164,"context_line":"                            dns_data_db[\u0027current_dns_domain\u0027]):"},{"line_number":165,"context_line":"                        dns_data_db[\u0027current_dns_name\u0027] \u003d \u0027\u0027"},{"line_number":166,"context_line":"                        dns_data_db[\u0027current_dns_domain\u0027] \u003d \u0027\u0027"},{"line_number":167,"context_line":"            else:"},{"line_number":168,"context_line":"                if not dns_data_db[\u0027current_dns_name\u0027]:"},{"line_number":169,"context_line":"                    # If port was removed from external DNS service in previous"},{"line_number":170,"context_line":"                    # update, make sure we don\u0027t attempt removal again"}],"source_content_type":"text/x-python","patch_set":21,"id":"bf3e73b7_5fbcb7ba","line":167,"updated":"2017-08-05 01:32:01.000000000","message":"nit: L167-168 look like they can be collapsed into an \u0027elif\u0027","commit_id":"d9f3b35751418003a24cdd3fb96af9ef9721a16a"},{"author":{"_account_id":4694,"name":"Miguel Lavalle","email":"miguel@mlavalle.com","username":"minsel"},"change_message_id":"716760f09cbe8501b9a98c5618e0e3bc8dc55ba3","unresolved":false,"context_lines":[{"line_number":164,"context_line":"                            dns_data_db[\u0027current_dns_domain\u0027]):"},{"line_number":165,"context_line":"                        dns_data_db[\u0027current_dns_name\u0027] \u003d \u0027\u0027"},{"line_number":166,"context_line":"                        dns_data_db[\u0027current_dns_domain\u0027] \u003d \u0027\u0027"},{"line_number":167,"context_line":"            else:"},{"line_number":168,"context_line":"                if not dns_data_db[\u0027current_dns_name\u0027]:"},{"line_number":169,"context_line":"                    # If port was removed from external DNS service in previous"},{"line_number":170,"context_line":"                    # update, make sure we don\u0027t attempt removal again"}],"source_content_type":"text/x-python","patch_set":21,"id":"bf3e73b7_8b51be11","line":167,"in_reply_to":"bf3e73b7_5fbcb7ba","updated":"2017-08-06 01:01:37.000000000","message":"Thanks for finding this :-)","commit_id":"d9f3b35751418003a24cdd3fb96af9ef9721a16a"},{"author":{"_account_id":7787,"name":"Kevin Benton","email":"kevin@benton.pub","username":"blak111"},"change_message_id":"c87cd4875986b07cdc9030373254805fad6a3ee4","unresolved":false,"context_lines":[{"line_number":182,"context_line":"        has_dns_name \u003d dns.DNSNAME in request_data"},{"line_number":183,"context_line":"        has_fixed_ips \u003d \u0027fixed_ips\u0027 in request_data"},{"line_number":184,"context_line":"        has_dns_domain \u003d dns.DNSDOMAIN in request_data"},{"line_number":185,"context_line":"        if not (has_dns_name or has_fixed_ips or has_dns_domain):"},{"line_number":186,"context_line":"            return"},{"line_number":187,"context_line":"        is_dns_domain_default \u003d self._get_request_dns_name("},{"line_number":188,"context_line":"            request_data)[1]"}],"source_content_type":"text/x-python","patch_set":21,"id":"bf3e73b7_3fb1f3e2","line":185,"updated":"2017-08-05 01:32:01.000000000","message":"nit: if not any((has_dns_name, has_fixed_ips, has_dns_domain)):","commit_id":"d9f3b35751418003a24cdd3fb96af9ef9721a16a"},{"author":{"_account_id":4694,"name":"Miguel Lavalle","email":"miguel@mlavalle.com","username":"minsel"},"change_message_id":"716760f09cbe8501b9a98c5618e0e3bc8dc55ba3","unresolved":false,"context_lines":[{"line_number":182,"context_line":"        has_dns_name \u003d dns.DNSNAME in request_data"},{"line_number":183,"context_line":"        has_fixed_ips \u003d \u0027fixed_ips\u0027 in request_data"},{"line_number":184,"context_line":"        has_dns_domain \u003d dns.DNSDOMAIN in request_data"},{"line_number":185,"context_line":"        if not (has_dns_name or has_fixed_ips or has_dns_domain):"},{"line_number":186,"context_line":"            return"},{"line_number":187,"context_line":"        is_dns_domain_default \u003d self._get_request_dns_name("},{"line_number":188,"context_line":"            request_data)[1]"}],"source_content_type":"text/x-python","patch_set":21,"id":"bf3e73b7_2b409235","line":185,"in_reply_to":"bf3e73b7_3fb1f3e2","updated":"2017-08-06 01:01:37.000000000","message":"Done","commit_id":"d9f3b35751418003a24cdd3fb96af9ef9721a16a"},{"author":{"_account_id":7787,"name":"Kevin Benton","email":"kevin@benton.pub","username":"blak111"},"change_message_id":"c87cd4875986b07cdc9030373254805fad6a3ee4","unresolved":false,"context_lines":[{"line_number":219,"context_line":"                dns_data_db[dns.DNSDOMAIN] \u003d dns_domain"},{"line_number":220,"context_line":"            dns_data_db.update()"},{"line_number":221,"context_line":"            return dns_data_db"},{"line_number":222,"context_line":"        if dns_name or dns_domain:"},{"line_number":223,"context_line":"            dns_data_db \u003d port_obj.PortDNS(plugin_context,"},{"line_number":224,"context_line":"                                           port_id\u003ddb_data[\u0027id\u0027],"},{"line_number":225,"context_line":"                                           current_dns_name\u003d\u0027\u0027,"}],"source_content_type":"text/x-python","patch_set":21,"id":"bf3e73b7_1fb62fdb","line":222,"updated":"2017-08-05 01:32:01.000000000","message":"This if statement can probably go away. It looks like the caller on L198 already checks for this.","commit_id":"d9f3b35751418003a24cdd3fb96af9ef9721a16a"},{"author":{"_account_id":4694,"name":"Miguel Lavalle","email":"miguel@mlavalle.com","username":"minsel"},"change_message_id":"716760f09cbe8501b9a98c5618e0e3bc8dc55ba3","unresolved":false,"context_lines":[{"line_number":219,"context_line":"                dns_data_db[dns.DNSDOMAIN] \u003d dns_domain"},{"line_number":220,"context_line":"            dns_data_db.update()"},{"line_number":221,"context_line":"            return dns_data_db"},{"line_number":222,"context_line":"        if dns_name or dns_domain:"},{"line_number":223,"context_line":"            dns_data_db \u003d port_obj.PortDNS(plugin_context,"},{"line_number":224,"context_line":"                                           port_id\u003ddb_data[\u0027id\u0027],"},{"line_number":225,"context_line":"                                           current_dns_name\u003d\u0027\u0027,"}],"source_content_type":"text/x-python","patch_set":21,"id":"bf3e73b7_cb5fc60c","line":222,"in_reply_to":"bf3e73b7_1fb62fdb","updated":"2017-08-06 01:01:37.000000000","message":"Yes, you are right","commit_id":"d9f3b35751418003a24cdd3fb96af9ef9721a16a"},{"author":{"_account_id":7787,"name":"Kevin Benton","email":"kevin@benton.pub","username":"blak111"},"change_message_id":"c87cd4875986b07cdc9030373254805fad6a3ee4","unresolved":false,"context_lines":[{"line_number":459,"context_line":"    original_ips \u003d [ip[\u0027ip_address\u0027] for ip in original_port[\u0027fixed_ips\u0027]]"},{"line_number":460,"context_line":"    updated_ips \u003d [ip[\u0027ip_address\u0027] for ip in updated_port[\u0027fixed_ips\u0027]]"},{"line_number":461,"context_line":"    is_dns_name_changed \u003d (updated_port[dns.DNSNAME] !\u003d"},{"line_number":462,"context_line":"                           original_port[dns.DNSNAME])"},{"line_number":463,"context_line":"    is_dns_domain_changed \u003d False"},{"line_number":464,"context_line":"    if dns.DNSDOMAIN in updated_port:"},{"line_number":465,"context_line":"        is_dns_domain_changed \u003d (updated_port[dns.DNSDOMAIN] !\u003d"}],"source_content_type":"text/x-python","patch_set":21,"id":"bf3e73b7_dfc78745","line":462,"updated":"2017-08-05 01:32:01.000000000","message":"nit: this might save a line and improve readability\n\nis_dns_domain_changed \u003d (dns.DNSDOMAIN in updated_port and\n                         updated_port[dns.DNSDOMAIN] !\u003d\n                         original_port[dns.DNSDOMAIN])","commit_id":"d9f3b35751418003a24cdd3fb96af9ef9721a16a"},{"author":{"_account_id":4694,"name":"Miguel Lavalle","email":"miguel@mlavalle.com","username":"minsel"},"change_message_id":"716760f09cbe8501b9a98c5618e0e3bc8dc55ba3","unresolved":false,"context_lines":[{"line_number":459,"context_line":"    original_ips \u003d [ip[\u0027ip_address\u0027] for ip in original_port[\u0027fixed_ips\u0027]]"},{"line_number":460,"context_line":"    updated_ips \u003d [ip[\u0027ip_address\u0027] for ip in updated_port[\u0027fixed_ips\u0027]]"},{"line_number":461,"context_line":"    is_dns_name_changed \u003d (updated_port[dns.DNSNAME] !\u003d"},{"line_number":462,"context_line":"                           original_port[dns.DNSNAME])"},{"line_number":463,"context_line":"    is_dns_domain_changed \u003d False"},{"line_number":464,"context_line":"    if dns.DNSDOMAIN in updated_port:"},{"line_number":465,"context_line":"        is_dns_domain_changed \u003d (updated_port[dns.DNSDOMAIN] !\u003d"}],"source_content_type":"text/x-python","patch_set":21,"id":"bf3e73b7_4bf756f7","line":462,"in_reply_to":"bf3e73b7_dfc78745","updated":"2017-08-06 01:01:37.000000000","message":"Done","commit_id":"d9f3b35751418003a24cdd3fb96af9ef9721a16a"},{"author":{"_account_id":7787,"name":"Kevin Benton","email":"kevin@benton.pub","username":"blak111"},"change_message_id":"c87cd4875986b07cdc9030373254805fad6a3ee4","unresolved":false,"context_lines":[{"line_number":464,"context_line":"    if dns.DNSDOMAIN in updated_port:"},{"line_number":465,"context_line":"        is_dns_domain_changed \u003d (updated_port[dns.DNSDOMAIN] !\u003d"},{"line_number":466,"context_line":"                                 original_port[dns.DNSDOMAIN])"},{"line_number":467,"context_line":"    if (not is_dns_name_changed and not is_dns_domain_changed and"},{"line_number":468,"context_line":"            set(original_ips) \u003d\u003d set(updated_ips)):"},{"line_number":469,"context_line":"        return"},{"line_number":470,"context_line":"    dns_data_db \u003d port_obj.PortDNS.get_object("}],"source_content_type":"text/x-python","patch_set":21,"id":"bf3e73b7_bfc4c341","line":467,"updated":"2017-08-05 01:32:01.000000000","message":"nit: if you put the IP comparison in an intermediary variable as well the if condition might be a little easier to read.\n\nips_changed \u003d set(original_ips) !\u003d set(updated_ips)\n\nif not any((ips_changed, is_dns_domain_changed, is_dns_name_changed)):\n    return","commit_id":"d9f3b35751418003a24cdd3fb96af9ef9721a16a"},{"author":{"_account_id":4694,"name":"Miguel Lavalle","email":"miguel@mlavalle.com","username":"minsel"},"change_message_id":"716760f09cbe8501b9a98c5618e0e3bc8dc55ba3","unresolved":false,"context_lines":[{"line_number":464,"context_line":"    if dns.DNSDOMAIN in updated_port:"},{"line_number":465,"context_line":"        is_dns_domain_changed \u003d (updated_port[dns.DNSDOMAIN] !\u003d"},{"line_number":466,"context_line":"                                 original_port[dns.DNSDOMAIN])"},{"line_number":467,"context_line":"    if (not is_dns_name_changed and not is_dns_domain_changed and"},{"line_number":468,"context_line":"            set(original_ips) \u003d\u003d set(updated_ips)):"},{"line_number":469,"context_line":"        return"},{"line_number":470,"context_line":"    dns_data_db \u003d port_obj.PortDNS.get_object("}],"source_content_type":"text/x-python","patch_set":21,"id":"bf3e73b7_abd1225a","line":467,"in_reply_to":"bf3e73b7_bfc4c341","updated":"2017-08-06 01:01:37.000000000","message":"Done","commit_id":"d9f3b35751418003a24cdd3fb96af9ef9721a16a"},{"author":{"_account_id":7787,"name":"Kevin Benton","email":"kevin@benton.pub","username":"blak111"},"change_message_id":"7290c2b2417ec8fa3779b8ce90e8ee9e96d01e37","unresolved":false,"context_lines":[{"line_number":138,"context_line":"            plugin_context,"},{"line_number":139,"context_line":"            port_id\u003ddb_data[\u0027id\u0027])"},{"line_number":140,"context_line":"        if dns_data_db:"},{"line_number":141,"context_line":"            is_dns_name_changed \u003d (dns_name is not None and"},{"line_number":142,"context_line":"                    dns_data_db[dns.DNSNAME] !\u003d dns_name)"},{"line_number":143,"context_line":"            is_dns_domain_changed \u003d (dns_domain is not None and"},{"line_number":144,"context_line":"                dns_data_db[dns.DNSDOMAIN] !\u003d dns_domain)"}],"source_content_type":"text/x-python","patch_set":22,"id":"9f436f4f_4aabc4d5","line":141,"updated":"2017-08-08 17:39:50.000000000","message":"sorry to nit, but can you break this function down into smaller helper function calls? It takes a long time to read through all of the conditionals together.\n\nmaybe \n\n_populate_previous_values\n\n_populate_current_values","commit_id":"6a0ac637f0ca11f7e6d3fa76875abcfaf83a64ef"},{"author":{"_account_id":4694,"name":"Miguel Lavalle","email":"miguel@mlavalle.com","username":"minsel"},"change_message_id":"3fce615ea97d48b8673c9df38afc84023da44aae","unresolved":false,"context_lines":[{"line_number":138,"context_line":"            plugin_context,"},{"line_number":139,"context_line":"            port_id\u003ddb_data[\u0027id\u0027])"},{"line_number":140,"context_line":"        if dns_data_db:"},{"line_number":141,"context_line":"            is_dns_name_changed \u003d (dns_name is not None and"},{"line_number":142,"context_line":"                    dns_data_db[dns.DNSNAME] !\u003d dns_name)"},{"line_number":143,"context_line":"            is_dns_domain_changed \u003d (dns_domain is not None and"},{"line_number":144,"context_line":"                dns_data_db[dns.DNSDOMAIN] !\u003d dns_domain)"}],"source_content_type":"text/x-python","patch_set":22,"id":"9f436f4f_8bae49e5","line":141,"in_reply_to":"9f436f4f_4aabc4d5","updated":"2017-08-08 23:14:34.000000000","message":"Done","commit_id":"6a0ac637f0ca11f7e6d3fa76875abcfaf83a64ef"},{"author":{"_account_id":841,"name":"Akihiro Motoki","email":"amotoki@gmail.com","username":"amotoki"},"change_message_id":"357ffd84dbb6437048697121e30a6608cd46e142","unresolved":false,"context_lines":[{"line_number":197,"context_line":"        has_dns_domain \u003d dns.DNSDOMAIN in request_data"},{"line_number":198,"context_line":"        if not any((has_dns_name, has_fixed_ips, has_dns_domain)):"},{"line_number":199,"context_line":"            return"},{"line_number":200,"context_line":"        is_dns_domain_default \u003d self._get_request_dns_name("},{"line_number":201,"context_line":"            request_data)[1]"},{"line_number":202,"context_line":"        if is_dns_domain_default:"},{"line_number":203,"context_line":"            self._extend_port_dict(plugin_context.session, db_data,"},{"line_number":204,"context_line":"                                   db_data, None)"}],"source_content_type":"text/x-python","patch_set":24,"id":"9f436f4f_94ee6186","line":201,"range":{"start_line":200,"start_character":8,"end_line":201,"end_character":28},"updated":"2017-08-09 06:50:18.000000000","message":"nit: It fits into one line.","commit_id":"4a7753325999ef1e5c77f6131cfe03b2cfa364a7"},{"author":{"_account_id":841,"name":"Akihiro Motoki","email":"amotoki@gmail.com","username":"amotoki"},"change_message_id":"357ffd84dbb6437048697121e30a6608cd46e142","unresolved":false,"context_lines":[{"line_number":231,"context_line":"                    dns_data_db[dns.DNSDOMAIN] !\u003d dns_domain):"},{"line_number":232,"context_line":"                dns_data_db[dns.DNSDOMAIN] \u003d dns_domain"},{"line_number":233,"context_line":"            dns_data_db.update()"},{"line_number":234,"context_line":"            return dns_data_db"},{"line_number":235,"context_line":"        dns_data_db \u003d port_obj.PortDNS(plugin_context,"},{"line_number":236,"context_line":"                                       port_id\u003ddb_data[\u0027id\u0027],"},{"line_number":237,"context_line":"                                       current_dns_name\u003d\u0027\u0027,"}],"source_content_type":"text/x-python","patch_set":24,"id":"9f436f4f_f4c6cd16","line":234,"updated":"2017-08-09 06:50:18.000000000","message":"nit: Personally the following logic is a bit clear to me, but it is a personal preference.\n\n  if dns_data_db:\n    \u003cupdate logic\u003e\n  else:\n    \u003ccreate logic\u003e","commit_id":"4a7753325999ef1e5c77f6131cfe03b2cfa364a7"}],"neutron/tests/unit/plugins/ml2/extensions/test_dns_integration.py":[{"author":{"_account_id":1131,"name":"Brian Haley","email":"haleyb.dev@gmail.com","username":"brian-haley"},"change_message_id":"c7c4440f74e7b23a827621d32937b3c5159e4e95","unresolved":false,"context_lines":[{"line_number":111,"context_line":"        ip_net \u003d netaddr.IPNetwork(cidr)"},{"line_number":112,"context_line":"        # initialize the allocation_pool to the lower half of the subnet"},{"line_number":113,"context_line":"        subnet_size \u003d ip_net.last - ip_net.first"},{"line_number":114,"context_line":"        subnet_mid_point \u003d ip_net.first + int(subnet_size / 2)"},{"line_number":115,"context_line":"        start, end \u003d (netaddr.IPAddress(ip_net.first + 2),"},{"line_number":116,"context_line":"                      netaddr.IPAddress(subnet_mid_point))"},{"line_number":117,"context_line":"        allocation_pools \u003d [{\u0027start\u0027: str(start),"}],"source_content_type":"text/x-python","patch_set":16,"id":"df3967d1_47d8f21c","line":114,"updated":"2017-08-02 19:12:38.000000000","message":"Other bug? :)","commit_id":"5206fa94053ece1fcf7d7b341e466e2201b84ce8"},{"author":{"_account_id":4694,"name":"Miguel Lavalle","email":"miguel@mlavalle.com","username":"minsel"},"change_message_id":"423c075c8f3b8f896efa130276d31867b90280fc","unresolved":false,"context_lines":[{"line_number":111,"context_line":"        ip_net \u003d netaddr.IPNetwork(cidr)"},{"line_number":112,"context_line":"        # initialize the allocation_pool to the lower half of the subnet"},{"line_number":113,"context_line":"        subnet_size \u003d ip_net.last - ip_net.first"},{"line_number":114,"context_line":"        subnet_mid_point \u003d ip_net.first + int(subnet_size / 2)"},{"line_number":115,"context_line":"        start, end \u003d (netaddr.IPAddress(ip_net.first + 2),"},{"line_number":116,"context_line":"                      netaddr.IPAddress(subnet_mid_point))"},{"line_number":117,"context_line":"        allocation_pools \u003d [{\u0027start\u0027: str(start),"}],"source_content_type":"text/x-python","patch_set":16,"id":"df3967d1_eac9e6ab","line":114,"in_reply_to":"df3967d1_47d8f21c","updated":"2017-08-02 21:43:56.000000000","message":"py35 unit tests fail with this patchset if I don\u0027t introduce this change. without it, subnet_mid_point is floating and it gets rounded down","commit_id":"5206fa94053ece1fcf7d7b341e466e2201b84ce8"},{"author":{"_account_id":841,"name":"Akihiro Motoki","email":"amotoki@gmail.com","username":"amotoki"},"change_message_id":"cea998f25f8f3ab0cd3d7930de0ada6017c88424","unresolved":false,"context_lines":[{"line_number":645,"context_line":"        self.assertFalse(port[dns.DNSDOMAIN])"},{"line_number":646,"context_line":"        self.assertFalse(mock_client.recordsets.create.call_args_list)"},{"line_number":647,"context_line":"        self.assertFalse(mock_admin_client.recordsets.create.call_args_list)"},{"line_number":648,"context_line":"        self.assertEqual(2, len(mock_client.recordsets.delete.call_args_list))"},{"line_number":649,"context_line":"        self.assertEqual("},{"line_number":650,"context_line":"            2, len(mock_admin_client.recordsets.delete.call_args_list))"},{"line_number":651,"context_line":""}],"source_content_type":"text/x-python","patch_set":16,"id":"df3967d1_8a549a54","line":648,"range":{"start_line":648,"start_character":8,"end_line":648,"end_character":78},"updated":"2017-08-02 22:02:10.000000000","message":"I am a bit surprised at len(xxxx.call_args_list). At first I wonder it checks the contents of call_args_list, but it turns out it is same as call_count.\n\nHow about the following?\n\n  self.assertEqual(2, mock_client.recordsets.delete.call_count)\n\nI think this is much easier to understand, but len(call_args_list) is used throughout this module, so I am fine to keep it as-is in this patch and clean them up later.","commit_id":"5206fa94053ece1fcf7d7b341e466e2201b84ce8"},{"author":{"_account_id":4694,"name":"Miguel Lavalle","email":"miguel@mlavalle.com","username":"minsel"},"change_message_id":"21ed61303feaf764ee30f3e1bf18af6f97babf9a","unresolved":false,"context_lines":[{"line_number":645,"context_line":"        self.assertFalse(port[dns.DNSDOMAIN])"},{"line_number":646,"context_line":"        self.assertFalse(mock_client.recordsets.create.call_args_list)"},{"line_number":647,"context_line":"        self.assertFalse(mock_admin_client.recordsets.create.call_args_list)"},{"line_number":648,"context_line":"        self.assertEqual(2, len(mock_client.recordsets.delete.call_args_list))"},{"line_number":649,"context_line":"        self.assertEqual("},{"line_number":650,"context_line":"            2, len(mock_admin_client.recordsets.delete.call_args_list))"},{"line_number":651,"context_line":""}],"source_content_type":"text/x-python","patch_set":16,"id":"df3967d1_d270fe0a","line":648,"range":{"start_line":648,"start_character":8,"end_line":648,"end_character":78},"in_reply_to":"df3967d1_8a549a54","updated":"2017-08-03 16:47:18.000000000","message":"Done. I will clean up this module in a follow up patchset. Thanks for pointing it out. And I will do my best to remember to use call_count in the future ;-)","commit_id":"5206fa94053ece1fcf7d7b341e466e2201b84ce8"}],"releasenotes/notes/add-dns-domain-to-ports-f71359d75909a2d5.yaml":[{"author":{"_account_id":1131,"name":"Brian Haley","email":"haleyb.dev@gmail.com","username":"brian-haley"},"change_message_id":"c7c4440f74e7b23a827621d32937b3c5159e4e95","unresolved":false,"context_lines":[{"line_number":1,"context_line":"---"},{"line_number":2,"context_line":"prelude: \u003e"},{"line_number":3,"context_line":"    Add dns_domain attribute to ports."},{"line_number":4,"context_line":"features:"},{"line_number":5,"context_line":"    - Ports have now a dns_domain attribute"},{"line_number":6,"context_line":"    - A port\u0027s dns_domain attribute has precedence over the network\u0027s"}],"source_content_type":"text/x-yaml","patch_set":16,"id":"df3967d1_67541654","line":3,"range":{"start_line":3,"start_character":8,"end_line":3,"end_character":18},"updated":"2017-08-02 19:12:38.000000000","message":"Think you could add `` around this and items below, think that makes them bold","commit_id":"5206fa94053ece1fcf7d7b341e466e2201b84ce8"},{"author":{"_account_id":4694,"name":"Miguel Lavalle","email":"miguel@mlavalle.com","username":"minsel"},"change_message_id":"423c075c8f3b8f896efa130276d31867b90280fc","unresolved":false,"context_lines":[{"line_number":1,"context_line":"---"},{"line_number":2,"context_line":"prelude: \u003e"},{"line_number":3,"context_line":"    Add dns_domain attribute to ports."},{"line_number":4,"context_line":"features:"},{"line_number":5,"context_line":"    - Ports have now a dns_domain attribute"},{"line_number":6,"context_line":"    - A port\u0027s dns_domain attribute has precedence over the network\u0027s"}],"source_content_type":"text/x-yaml","patch_set":16,"id":"df3967d1_ca806249","line":3,"range":{"start_line":3,"start_character":8,"end_line":3,"end_character":18},"in_reply_to":"df3967d1_67541654","updated":"2017-08-02 21:43:56.000000000","message":"Done","commit_id":"5206fa94053ece1fcf7d7b341e466e2201b84ce8"},{"author":{"_account_id":841,"name":"Akihiro Motoki","email":"amotoki@gmail.com","username":"amotoki"},"change_message_id":"cea998f25f8f3ab0cd3d7930de0ada6017c88424","unresolved":false,"context_lines":[{"line_number":2,"context_line":"prelude: \u003e"},{"line_number":3,"context_line":"    Add dns_domain attribute to ports."},{"line_number":4,"context_line":"features:"},{"line_number":5,"context_line":"    - Ports have now a dns_domain attribute"},{"line_number":6,"context_line":"    - A port\u0027s dns_domain attribute has precedence over the network\u0027s"},{"line_number":7,"context_line":"      dns_domain from the point of view of publishing it to the external"},{"line_number":8,"context_line":"      DNS service"}],"source_content_type":"text/x-yaml","patch_set":16,"id":"df3967d1_f6f67663","line":6,"range":{"start_line":5,"start_character":4,"end_line":6,"end_character":6},"updated":"2017-08-02 22:02:10.000000000","message":"Could you merge it into a single item?\n\nLooking at http://docs-draft.openstack.org/97/468697/16/check/gate-neutron-releasenotes/38619c1//releasenotes/build/html/unreleased.html, using two items looks a bit tricky as they are directly related to each other.","commit_id":"5206fa94053ece1fcf7d7b341e466e2201b84ce8"},{"author":{"_account_id":4694,"name":"Miguel Lavalle","email":"miguel@mlavalle.com","username":"minsel"},"change_message_id":"21ed61303feaf764ee30f3e1bf18af6f97babf9a","unresolved":false,"context_lines":[{"line_number":2,"context_line":"prelude: \u003e"},{"line_number":3,"context_line":"    Add dns_domain attribute to ports."},{"line_number":4,"context_line":"features:"},{"line_number":5,"context_line":"    - Ports have now a dns_domain attribute"},{"line_number":6,"context_line":"    - A port\u0027s dns_domain attribute has precedence over the network\u0027s"},{"line_number":7,"context_line":"      dns_domain from the point of view of publishing it to the external"},{"line_number":8,"context_line":"      DNS service"}],"source_content_type":"text/x-yaml","patch_set":16,"id":"df3967d1_52108ea8","line":6,"range":{"start_line":5,"start_character":4,"end_line":6,"end_character":6},"in_reply_to":"df3967d1_f6f67663","updated":"2017-08-03 16:47:18.000000000","message":"Yeah, good catch!","commit_id":"5206fa94053ece1fcf7d7b341e466e2201b84ce8"},{"author":{"_account_id":841,"name":"Akihiro Motoki","email":"amotoki@gmail.com","username":"amotoki"},"change_message_id":"b357a236bab9bdef12d694d420fccdcfb8c8bcef","unresolved":false,"context_lines":[{"line_number":1,"context_line":"---"},{"line_number":2,"context_line":"prelude: \u003e"},{"line_number":3,"context_line":"    Add ``dns_domain`` attribute to ports."},{"line_number":4,"context_line":"features:"},{"line_number":5,"context_line":"    - Ports have now a ``dns_domain`` attribute. A port\u0027s ``dns_domain``"},{"line_number":6,"context_line":"      attribute has precedence over the network\u0027s ``dns_domain``"}],"source_content_type":"text/x-yaml","patch_set":19,"id":"df3967d1_14c0a829","line":3,"updated":"2017-08-04 01:40:48.000000000","message":"prelude section is for general comments about the release, so I believe this section is unnecessary and feature section is enough.\n\nhttps://docs.openstack.org/reno/latest/user/usage.html","commit_id":"52f776ead30ca2e6a10cb9e6ba0b625764722571"},{"author":{"_account_id":4694,"name":"Miguel Lavalle","email":"miguel@mlavalle.com","username":"minsel"},"change_message_id":"ea531d1f1ae727bcf65ad86963d0ac1b56f773bd","unresolved":false,"context_lines":[{"line_number":1,"context_line":"---"},{"line_number":2,"context_line":"prelude: \u003e"},{"line_number":3,"context_line":"    Add ``dns_domain`` attribute to ports."},{"line_number":4,"context_line":"features:"},{"line_number":5,"context_line":"    - Ports have now a ``dns_domain`` attribute. A port\u0027s ``dns_domain``"},{"line_number":6,"context_line":"      attribute has precedence over the network\u0027s ``dns_domain``"}],"source_content_type":"text/x-yaml","patch_set":19,"id":"bf3e73b7_104aa47f","line":3,"in_reply_to":"df3967d1_14c0a829","updated":"2017-08-04 21:01:18.000000000","message":"Done","commit_id":"52f776ead30ca2e6a10cb9e6ba0b625764722571"}]}
