)]}'
{"nova/network/neutronv2/api.py":[{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"9bcee7acb723ff844400970b7adfa6d5c4c1b6fd","unresolved":false,"context_lines":[{"line_number":641,"context_line":""},{"line_number":642,"context_line":"            network \u003d neutron.show_network(port.get(\u0027network_id\u0027),"},{"line_number":643,"context_line":"                                           fields\u003d\u0027dns_domain\u0027).get(\u0027network\u0027)"},{"line_number":644,"context_line":"            # NOTE: for internal DNS integration, we use the admin client to"},{"line_number":645,"context_line":"            # reset the dns_name"},{"line_number":646,"context_line":"            if self._has_dns_extension() and not network.get(\u0027dns_domain\u0027):"},{"line_number":647,"context_line":"                port_req_body[\u0027port\u0027][\u0027dns_name\u0027] \u003d \u0027\u0027"},{"line_number":648,"context_line":"            try:"}],"source_content_type":"text/x-python","patch_set":1,"id":"bfdaf3ff_99b64a3e","line":645,"range":{"start_line":644,"start_character":0,"end_line":645,"end_character":32},"updated":"2019-01-18 14:18:08.000000000","message":"Is there any reason why we can\u0027t just *always* use the user-context client for updating the dns_name attribute?\n\nNothing wrong with this code, but it seems like it would be easier to just always call _reset_port_dns_name() and remove the condition around network.get(\u0027dns_domain\u0027) and just always use the \"neutron\" client (as opposed to the \"port_client\" which is the admin client).","commit_id":"3ab8220bb0848bd5a5322783bd6e404da6d3f855"},{"author":{"_account_id":4694,"name":"Miguel Lavalle","email":"miguel@mlavalle.com","username":"minsel"},"change_message_id":"8d40a64e886fd94716de7568d8e0fd6e2fe9164e","unresolved":false,"context_lines":[{"line_number":641,"context_line":""},{"line_number":642,"context_line":"            network \u003d neutron.show_network(port.get(\u0027network_id\u0027),"},{"line_number":643,"context_line":"                                           fields\u003d\u0027dns_domain\u0027).get(\u0027network\u0027)"},{"line_number":644,"context_line":"            # NOTE: for internal DNS integration, we use the admin client to"},{"line_number":645,"context_line":"            # reset the dns_name"},{"line_number":646,"context_line":"            if self._has_dns_extension() and not network.get(\u0027dns_domain\u0027):"},{"line_number":647,"context_line":"                port_req_body[\u0027port\u0027][\u0027dns_name\u0027] \u003d \u0027\u0027"},{"line_number":648,"context_line":"            try:"}],"source_content_type":"text/x-python","patch_set":1,"id":"9fdfeff1_83a50eb8","line":645,"range":{"start_line":644,"start_character":0,"end_line":645,"end_character":32},"in_reply_to":"bfdaf3ff_99b64a3e","updated":"2019-01-18 21:50:42.000000000","message":"Since we are re-setting the port binding, we have to make at least one request to Neutron with admin context. If the \"dns_domain\" attribute in the port\u0027s network is not set, we know we don\u0027t need to worry about clearing a recordset in an external DNS service (Designate), so we use the same Neutron request with admin context to clear the port\u0027s \"dns_name\" attribute. However, if the port\u0027s network is set, there maybe be an associated recordset in Designate that has be cleared also. In that case, we do a second request to Neutron just to clear the port\u0027s \"dns_name\" with the user context, which Neutron in turn will use to send a request to Designate. Done this way, we are trying not to send a second request to Neutron unless it is strictly necessary.\n\nThe same thing is done when the port is updated during instance creation. At the time of implementing the Nova - Neutron - Designate integration, there was concern that we would be adding a second call to all the port updates. This way we only incur the cost of the second port update when we know it is strictly necessary","commit_id":"3ab8220bb0848bd5a5322783bd6e404da6d3f855"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"9050b0ac036dc079a04d2bbb8562ec73c74b7b42","unresolved":false,"context_lines":[{"line_number":595,"context_line":"    def _unbind_ports(self, context, ports,"},{"line_number":596,"context_line":"                      neutron, port_client\u003dNone):"},{"line_number":597,"context_line":"        \"\"\"Unbind the given ports by clearing their device_id and"},{"line_number":598,"context_line":"        device_owner."},{"line_number":599,"context_line":""},{"line_number":600,"context_line":"        :param context: The request context."},{"line_number":601,"context_line":"        :param ports: list of port IDs."}],"source_content_type":"text/x-python","patch_set":2,"id":"9fdfeff1_b7ea55a9","line":598,"updated":"2019-01-25 21:28:09.000000000","message":"nit: this could be updated to mention dns_name as well.","commit_id":"d0d51a653a25a651e204b940957d0eb3c85798e5"},{"author":{"_account_id":28159,"name":"Hang Yang","email":"hangyang@yahooinc.com","username":"hangyang"},"change_message_id":"ccdfbe562102e924d06cd45d2e64410e6e71a34c","unresolved":false,"context_lines":[{"line_number":595,"context_line":"    def _unbind_ports(self, context, ports,"},{"line_number":596,"context_line":"                      neutron, port_client\u003dNone):"},{"line_number":597,"context_line":"        \"\"\"Unbind the given ports by clearing their device_id and"},{"line_number":598,"context_line":"        device_owner."},{"line_number":599,"context_line":""},{"line_number":600,"context_line":"        :param context: The request context."},{"line_number":601,"context_line":"        :param ports: list of port IDs."}],"source_content_type":"text/x-python","patch_set":2,"id":"9fdfeff1_b3d569e7","line":598,"in_reply_to":"9fdfeff1_b7ea55a9","updated":"2019-01-28 23:10:29.000000000","message":"Done","commit_id":"d0d51a653a25a651e204b940957d0eb3c85798e5"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"9050b0ac036dc079a04d2bbb8562ec73c74b7b42","unresolved":false,"context_lines":[{"line_number":630,"context_line":"                network \u003d {}"},{"line_number":631,"context_line":"            else:"},{"line_number":632,"context_line":"                port_profile \u003d port.get(BINDING_PROFILE, {})"},{"line_number":633,"context_line":"                network \u003d neutron.show_network(port.get(\u0027network_id\u0027),"},{"line_number":634,"context_line":"                                               fields\u003d[\u0027dns_domain\u0027]"},{"line_number":635,"context_line":"                                               ).get(\u0027network\u0027)"},{"line_number":636,"context_line":""},{"line_number":637,"context_line":"            # NOTE: We\u0027re doing this to remove the binding information"},{"line_number":638,"context_line":"            # for the physical device but don\u0027t want to overwrite the other"}],"source_content_type":"text/x-python","patch_set":2,"id":"9fdfeff1_77cced60","line":635,"range":{"start_line":633,"start_character":16,"end_line":635,"end_character":63},"updated":"2019-01-25 21:28:09.000000000","message":"nit: if we\u0027ve got multiple ports on the same network, we don\u0027t need to do this lookup every time since we could just keep track of the networks we\u0027ve already got, keyed by network_id.","commit_id":"d0d51a653a25a651e204b940957d0eb3c85798e5"},{"author":{"_account_id":28159,"name":"Hang Yang","email":"hangyang@yahooinc.com","username":"hangyang"},"change_message_id":"ccdfbe562102e924d06cd45d2e64410e6e71a34c","unresolved":false,"context_lines":[{"line_number":630,"context_line":"                network \u003d {}"},{"line_number":631,"context_line":"            else:"},{"line_number":632,"context_line":"                port_profile \u003d port.get(BINDING_PROFILE, {})"},{"line_number":633,"context_line":"                network \u003d neutron.show_network(port.get(\u0027network_id\u0027),"},{"line_number":634,"context_line":"                                               fields\u003d[\u0027dns_domain\u0027]"},{"line_number":635,"context_line":"                                               ).get(\u0027network\u0027)"},{"line_number":636,"context_line":""},{"line_number":637,"context_line":"            # NOTE: We\u0027re doing this to remove the binding information"},{"line_number":638,"context_line":"            # for the physical device but don\u0027t want to overwrite the other"}],"source_content_type":"text/x-python","patch_set":2,"id":"9fdfeff1_5308bd90","line":635,"range":{"start_line":633,"start_character":16,"end_line":635,"end_character":63},"in_reply_to":"9fdfeff1_77cced60","updated":"2019-01-28 23:10:29.000000000","message":"Done","commit_id":"d0d51a653a25a651e204b940957d0eb3c85798e5"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"77722a4e9f2334d2f183e0b687d7a66372cd9284","unresolved":false,"context_lines":[{"line_number":630,"context_line":"                network \u003d {}"},{"line_number":631,"context_line":"            else:"},{"line_number":632,"context_line":"                port_profile \u003d port.get(BINDING_PROFILE, {})"},{"line_number":633,"context_line":"                network \u003d neutron.show_network(port.get(\u0027network_id\u0027),"},{"line_number":634,"context_line":"                                               fields\u003d[\u0027dns_domain\u0027]"},{"line_number":635,"context_line":"                                               ).get(\u0027network\u0027)"},{"line_number":636,"context_line":""},{"line_number":637,"context_line":"            # NOTE: We\u0027re doing this to remove the binding information"},{"line_number":638,"context_line":"            # for the physical device but don\u0027t want to overwrite the other"}],"source_content_type":"text/x-python","patch_set":2,"id":"9fdfeff1_523c57c7","line":635,"range":{"start_line":633,"start_character":16,"end_line":635,"end_character":63},"in_reply_to":"9fdfeff1_77cced60","updated":"2019-01-25 21:42:33.000000000","message":"ya, good point. I\u0027ll update.","commit_id":"d0d51a653a25a651e204b940957d0eb3c85798e5"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"9050b0ac036dc079a04d2bbb8562ec73c74b7b42","unresolved":false,"context_lines":[{"line_number":642,"context_line":"                    del port_profile[profile_key]"},{"line_number":643,"context_line":"            port_req_body[\u0027port\u0027][BINDING_PROFILE] \u003d port_profile"},{"line_number":644,"context_line":""},{"line_number":645,"context_line":"            # NOTE: for internal DNS integration, or if we cannot retrieve"},{"line_number":646,"context_line":"            # network info, we use the admin client to reset dns_name"},{"line_number":647,"context_line":"            if self._has_dns_extension() and not network.get(\u0027dns_domain\u0027):"},{"line_number":648,"context_line":"                port_req_body[\u0027port\u0027][\u0027dns_name\u0027] \u003d \u0027\u0027"}],"source_content_type":"text/x-python","patch_set":2,"id":"9fdfeff1_37d665f3","line":645,"range":{"start_line":645,"start_character":24,"end_line":645,"end_character":48},"updated":"2019-01-25 21:28:09.000000000","message":"I\u0027m not sure what this means. So \"internal\" DNS integration means the network does not have a DNS domain and \"external\" means it does?","commit_id":"d0d51a653a25a651e204b940957d0eb3c85798e5"},{"author":{"_account_id":28159,"name":"Hang Yang","email":"hangyang@yahooinc.com","username":"hangyang"},"change_message_id":"ccdfbe562102e924d06cd45d2e64410e6e71a34c","unresolved":false,"context_lines":[{"line_number":642,"context_line":"                    del port_profile[profile_key]"},{"line_number":643,"context_line":"            port_req_body[\u0027port\u0027][BINDING_PROFILE] \u003d port_profile"},{"line_number":644,"context_line":""},{"line_number":645,"context_line":"            # NOTE: for internal DNS integration, or if we cannot retrieve"},{"line_number":646,"context_line":"            # network info, we use the admin client to reset dns_name"},{"line_number":647,"context_line":"            if self._has_dns_extension() and not network.get(\u0027dns_domain\u0027):"},{"line_number":648,"context_line":"                port_req_body[\u0027port\u0027][\u0027dns_name\u0027] \u003d \u0027\u0027"}],"source_content_type":"text/x-python","patch_set":2,"id":"9fdfeff1_730dc19f","line":645,"range":{"start_line":645,"start_character":24,"end_line":645,"end_character":48},"in_reply_to":"9fdfeff1_37d665f3","updated":"2019-01-28 23:10:29.000000000","message":"Done","commit_id":"d0d51a653a25a651e204b940957d0eb3c85798e5"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"ea0acfd4f04a16edbcac5ee58dbd0c1b75de2a87","unresolved":false,"context_lines":[{"line_number":1520,"context_line":"                         \u0027name\u0027) % {\u0027hostname\u0027: instance.hostname})"},{"line_number":1521,"context_line":"                raise exception.InvalidInput(reason\u003dmsg)"},{"line_number":1522,"context_line":""},{"line_number":1523,"context_line":"    def _reset_port_dns_name(self, network, port_id, neutron):"},{"line_number":1524,"context_line":"        \"\"\"Reset an instance port dns_name attribute to empty when using"},{"line_number":1525,"context_line":"        external DNS service."},{"line_number":1526,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"9fdfeff1_8f3cdfbf","line":1523,"range":{"start_line":1523,"start_character":53,"end_line":1523,"end_character":60},"updated":"2019-01-25 15:32:56.000000000","message":"nit: might be better to name this parameter \"client\" or \"neutron_user_client\".","commit_id":"d0d51a653a25a651e204b940957d0eb3c85798e5"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"e57aa417c8290547acbaa6c0546e115087bbf041","unresolved":false,"context_lines":[{"line_number":1520,"context_line":"                         \u0027name\u0027) % {\u0027hostname\u0027: instance.hostname})"},{"line_number":1521,"context_line":"                raise exception.InvalidInput(reason\u003dmsg)"},{"line_number":1522,"context_line":""},{"line_number":1523,"context_line":"    def _reset_port_dns_name(self, network, port_id, neutron):"},{"line_number":1524,"context_line":"        \"\"\"Reset an instance port dns_name attribute to empty when using"},{"line_number":1525,"context_line":"        external DNS service."},{"line_number":1526,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"9fdfeff1_97b87176","line":1523,"range":{"start_line":1523,"start_character":53,"end_line":1523,"end_character":60},"in_reply_to":"9fdfeff1_5728c9e0","updated":"2019-01-25 21:31:17.000000000","message":"\u003e Or at the very least document the individual parameters.\n\nTo be fair, the description below does go over that.","commit_id":"d0d51a653a25a651e204b940957d0eb3c85798e5"},{"author":{"_account_id":28159,"name":"Hang Yang","email":"hangyang@yahooinc.com","username":"hangyang"},"change_message_id":"ccdfbe562102e924d06cd45d2e64410e6e71a34c","unresolved":false,"context_lines":[{"line_number":1520,"context_line":"                         \u0027name\u0027) % {\u0027hostname\u0027: instance.hostname})"},{"line_number":1521,"context_line":"                raise exception.InvalidInput(reason\u003dmsg)"},{"line_number":1522,"context_line":""},{"line_number":1523,"context_line":"    def _reset_port_dns_name(self, network, port_id, neutron):"},{"line_number":1524,"context_line":"        \"\"\"Reset an instance port dns_name attribute to empty when using"},{"line_number":1525,"context_line":"        external DNS service."},{"line_number":1526,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"9fdfeff1_3303b975","line":1523,"range":{"start_line":1523,"start_character":53,"end_line":1523,"end_character":60},"in_reply_to":"9fdfeff1_8f3cdfbf","updated":"2019-01-28 23:10:29.000000000","message":"Done","commit_id":"d0d51a653a25a651e204b940957d0eb3c85798e5"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"9050b0ac036dc079a04d2bbb8562ec73c74b7b42","unresolved":false,"context_lines":[{"line_number":1520,"context_line":"                         \u0027name\u0027) % {\u0027hostname\u0027: instance.hostname})"},{"line_number":1521,"context_line":"                raise exception.InvalidInput(reason\u003dmsg)"},{"line_number":1522,"context_line":""},{"line_number":1523,"context_line":"    def _reset_port_dns_name(self, network, port_id, neutron):"},{"line_number":1524,"context_line":"        \"\"\"Reset an instance port dns_name attribute to empty when using"},{"line_number":1525,"context_line":"        external DNS service."},{"line_number":1526,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"9fdfeff1_5728c9e0","line":1523,"range":{"start_line":1523,"start_character":53,"end_line":1523,"end_character":60},"in_reply_to":"9fdfeff1_8f3cdfbf","updated":"2019-01-25 21:28:09.000000000","message":"Or at the very least document the individual parameters.","commit_id":"d0d51a653a25a651e204b940957d0eb3c85798e5"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"9050b0ac036dc079a04d2bbb8562ec73c74b7b42","unresolved":false,"context_lines":[{"line_number":1530,"context_line":"        request with a Neutron client using user\u0027s context, so that the DNS"},{"line_number":1531,"context_line":"        record can be found under user\u0027s zone and domain."},{"line_number":1532,"context_line":"        \"\"\""},{"line_number":1533,"context_line":"        if self._has_dns_extension() and network.get(\u0027dns_domain\u0027):"},{"line_number":1534,"context_line":"            try:"},{"line_number":1535,"context_line":"                port_req_body \u003d {\u0027port\u0027: {\u0027dns_name\u0027: \u0027\u0027}}"},{"line_number":1536,"context_line":"                neutron.update_port(port_id, port_req_body)"}],"source_content_type":"text/x-python","patch_set":2,"id":"9fdfeff1_978391cc","line":1533,"range":{"start_line":1533,"start_character":8,"end_line":1533,"end_character":67},"updated":"2019-01-25 21:28:09.000000000","message":"We could have avoided this semi-redundant check by storing a variable from the check on L647 and simply not call this method based on that value.","commit_id":"d0d51a653a25a651e204b940957d0eb3c85798e5"},{"author":{"_account_id":28159,"name":"Hang Yang","email":"hangyang@yahooinc.com","username":"hangyang"},"change_message_id":"ccdfbe562102e924d06cd45d2e64410e6e71a34c","unresolved":false,"context_lines":[{"line_number":1530,"context_line":"        request with a Neutron client using user\u0027s context, so that the DNS"},{"line_number":1531,"context_line":"        record can be found under user\u0027s zone and domain."},{"line_number":1532,"context_line":"        \"\"\""},{"line_number":1533,"context_line":"        if self._has_dns_extension() and network.get(\u0027dns_domain\u0027):"},{"line_number":1534,"context_line":"            try:"},{"line_number":1535,"context_line":"                port_req_body \u003d {\u0027port\u0027: {\u0027dns_name\u0027: \u0027\u0027}}"},{"line_number":1536,"context_line":"                neutron.update_port(port_id, port_req_body)"}],"source_content_type":"text/x-python","patch_set":2,"id":"9fdfeff1_53c99d23","line":1533,"range":{"start_line":1533,"start_character":8,"end_line":1533,"end_character":67},"in_reply_to":"9fdfeff1_978391cc","updated":"2019-01-28 23:10:29.000000000","message":"I think it maybe better to keep the two checks inside this method, similar to _update_port_dns_name in L1511. So that if we need call this method from different places, the caller does not need check the condition every time. Since the two checks are not api calls, they won\u0027t introduce much extra time either.","commit_id":"d0d51a653a25a651e204b940957d0eb3c85798e5"}]}
