)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":4694,"name":"Miguel Lavalle","email":"miguel@mlavalle.com","username":"minsel"},"change_message_id":"97f94ed5927e874e33ea1d7b2766dcd0b3e42b19","unresolved":false,"context_lines":[{"line_number":4,"context_line":"Commit:     Bin Yu \u003cfroyo.bin@gmail.com\u003e"},{"line_number":5,"context_line":"CommitDate: 2016-06-01 09:43:11 +0800"},{"line_number":6,"context_line":""},{"line_number":7,"context_line":"Move dns related data field from port to portdns"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"This patch is to move the dns data field dns_name from port schema"},{"line_number":10,"context_line":"to portdnses. We hope to handle the dns information in dns plugins"},{"line_number":11,"context_line":"by calling process_create_port and _apply_dict_extend_functions"},{"line_number":12,"context_line":"in core plugin, in this way to remove the code like"},{"line_number":13,"context_line":"\"if (\u0027dns-integration\u0027 in self.supported_extension_aliases and"},{"line_number":14,"context_line":"    \u0027dns_name\u0027 in p)\""},{"line_number":15,"context_line":"or  \"if \u0027dns_name\u0027 in new_port and not request_dns_name\""},{"line_number":16,"context_line":"to hide the detail of dns information from the prespective of"},{"line_number":17,"context_line":"core plugin."},{"line_number":18,"context_line":""},{"line_number":19,"context_line":"Change-Id: I63afb1a1bfeeb14eefb54681dc64959144deeb25"},{"line_number":20,"context_line":"Closes-Bug: #1579601"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":17,"id":"9abb7d3a_659904c4","line":17,"range":{"start_line":7,"start_character":0,"end_line":17,"end_character":12},"updated":"2016-06-01 22:30:54.000000000","message":"I think we need to reflect better what this patchset does in the commit message. How about:\n\nRefactor DNS integration out of DB core plugin\n\nThis patch moves all the code related to DNS integration\nfrom the DB core plugin to the DNS ML2 extension module.","commit_id":"e2c4cafff5b7c8486b8785d12de6084fce07fe09"},{"author":{"_account_id":4694,"name":"Miguel Lavalle","email":"miguel@mlavalle.com","username":"minsel"},"change_message_id":"b34be9ca7358a3a23386b5a93f9e5636d9fc603d","unresolved":false,"context_lines":[{"line_number":8,"context_line":""},{"line_number":9,"context_line":"This patch set aims to move all the code related to DNS integration"},{"line_number":10,"context_line":"from the DB core plugin to the DNS ML2 extension module."},{"line_number":11,"context_line":""},{"line_number":12,"context_line":"Change-Id: I63afb1a1bfeeb14eefb54681dc64959144deeb25"},{"line_number":13,"context_line":"Closes-Bug: #1579601"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":20,"id":"7aa08908_d54dae9a","line":11,"updated":"2016-06-06 17:54:46.000000000","message":"Bin,\n\nPlease add the following to your commit message:\n\nBy properly implementing the generation of the dns_assignment attribute for ports in the DNS ML2 extension module, this patchset also fixes https://bugs.launchpad.net/neutron/+bug/1579977","commit_id":"677267d8c7e956ee0e2315cb13ffbf58e6bc7c18"},{"author":{"_account_id":4694,"name":"Miguel Lavalle","email":"miguel@mlavalle.com","username":"minsel"},"change_message_id":"b34be9ca7358a3a23386b5a93f9e5636d9fc603d","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":20,"id":"7aa08908_d5348efc","line":14,"updated":"2016-06-06 17:54:46.000000000","message":"Please add:\n\nCloses-Bug: #1579977","commit_id":"677267d8c7e956ee0e2315cb13ffbf58e6bc7c18"},{"author":{"_account_id":7787,"name":"Kevin Benton","email":"kevin@benton.pub","username":"blak111"},"change_message_id":"4bc194f45c7bbb345b03b2f0ac06b13557b356b6","unresolved":false,"context_lines":[{"line_number":12,"context_line":"By properly implementing the generation of the dns_assignment attribute"},{"line_number":13,"context_line":"for ports in the DNS ML2 extension module, this patchset also fixes"},{"line_number":14,"context_line":"https://bugs.launchpad.net/neutron/+bug/1579977"},{"line_number":15,"context_line":""},{"line_number":16,"context_line":"Change-Id: I63afb1a1bfeeb14eefb54681dc64959144deeb25"},{"line_number":17,"context_line":"Closes-Bug: #1579601"},{"line_number":18,"context_line":"Closes-Bug: #1579977"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":31,"id":"3aaa91ec_9394c9e2","line":15,"updated":"2016-06-23 00:17:27.000000000","message":"Can you add something to the commit message explaining why the schema change, particularily why we need to keep previous and current for both name and domain?","commit_id":"c6ec2bf74080e0a2f05f4fdf305eac4ef7397e97"},{"author":{"_account_id":8726,"name":"Victor Morales","email":"chipahuac@hotmail.com","username":"electrocucaracha"},"change_message_id":"3e096f85ac4e8db3ad0a0c7236771ca424a6e5f2","unresolved":false,"context_lines":[{"line_number":10,"context_line":"from the DB core plugin to the DNS ML2 extension module."},{"line_number":11,"context_line":""},{"line_number":12,"context_line":"By doing this, this patchset removes the dns related code in"},{"line_number":13,"context_line":"db_base_plugin_v2 and the dns exteions module talks with core plugin"},{"line_number":14,"context_line":"only through the method extension_manager and apply_dict_extend_functions"},{"line_number":15,"context_line":""},{"line_number":16,"context_line":"By properly implementing the generation of the dns_assignment attribute"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":32,"id":"fad55976_257c0572","line":13,"range":{"start_line":13,"start_character":30,"end_line":13,"end_character":38},"updated":"2016-07-15 18:11:29.000000000","message":"extensions?","commit_id":"0df06a08190b02e43a6d0facbe529a12341ad743"},{"author":{"_account_id":20671,"name":"bin","email":"froyo.bin@gmail.com","username":"binyu"},"change_message_id":"ee2ac2cf9b6ace4aa33664a6c2bd9bd8ba002b21","unresolved":false,"context_lines":[{"line_number":10,"context_line":"from the DB core plugin to the DNS ML2 extension module."},{"line_number":11,"context_line":""},{"line_number":12,"context_line":"By doing this, this patchset removes the dns related code in"},{"line_number":13,"context_line":"db_base_plugin_v2 and the dns exteions module talks with core plugin"},{"line_number":14,"context_line":"only through the method extension_manager and apply_dict_extend_functions"},{"line_number":15,"context_line":""},{"line_number":16,"context_line":"By properly implementing the generation of the dns_assignment attribute"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":32,"id":"dada55a8_52f905c8","line":13,"range":{"start_line":13,"start_character":30,"end_line":13,"end_character":38},"in_reply_to":"fad55976_257c0572","updated":"2016-07-18 02:03:05.000000000","message":"Done","commit_id":"0df06a08190b02e43a6d0facbe529a12341ad743"},{"author":{"_account_id":8726,"name":"Victor Morales","email":"chipahuac@hotmail.com","username":"electrocucaracha"},"change_message_id":"3e096f85ac4e8db3ad0a0c7236771ca424a6e5f2","unresolved":false,"context_lines":[{"line_number":11,"context_line":""},{"line_number":12,"context_line":"By doing this, this patchset removes the dns related code in"},{"line_number":13,"context_line":"db_base_plugin_v2 and the dns exteions module talks with core plugin"},{"line_number":14,"context_line":"only through the method extension_manager and apply_dict_extend_functions"},{"line_number":15,"context_line":""},{"line_number":16,"context_line":"By properly implementing the generation of the dns_assignment attribute"},{"line_number":17,"context_line":"for ports in the DNS ML2 extension module, this patchset also fixes"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":32,"id":"fad55976_25ca45a2","line":14,"range":{"start_line":14,"start_character":72,"end_line":14,"end_character":73},"updated":"2016-07-15 18:11:29.000000000","message":"nit: this exceeds the limit of the description","commit_id":"0df06a08190b02e43a6d0facbe529a12341ad743"},{"author":{"_account_id":20671,"name":"bin","email":"froyo.bin@gmail.com","username":"binyu"},"change_message_id":"ee2ac2cf9b6ace4aa33664a6c2bd9bd8ba002b21","unresolved":false,"context_lines":[{"line_number":11,"context_line":""},{"line_number":12,"context_line":"By doing this, this patchset removes the dns related code in"},{"line_number":13,"context_line":"db_base_plugin_v2 and the dns exteions module talks with core plugin"},{"line_number":14,"context_line":"only through the method extension_manager and apply_dict_extend_functions"},{"line_number":15,"context_line":""},{"line_number":16,"context_line":"By properly implementing the generation of the dns_assignment attribute"},{"line_number":17,"context_line":"for ports in the DNS ML2 extension module, this patchset also fixes"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":32,"id":"dada55a8_32f611d8","line":14,"range":{"start_line":14,"start_character":72,"end_line":14,"end_character":73},"in_reply_to":"fad55976_25ca45a2","updated":"2016-07-18 02:03:05.000000000","message":"Done","commit_id":"0df06a08190b02e43a6d0facbe529a12341ad743"}],"neutron/common/eventlet_utils.py":[{"author":{"_account_id":20671,"name":"bin","email":"froyo.bin@gmail.com","username":"binyu"},"change_message_id":"1a96c01a8efd180c8a05d752b7bebc6c11193bf5","unresolved":false,"context_lines":[{"line_number":29,"context_line":"        # https://bitbucket.org/eventlet/eventlet/issue/132/"},{"line_number":30,"context_line":"        #       eventletmonkey_patch-breaks"},{"line_number":31,"context_line":"        # eventlet.monkey_patch(all\u003dFalse, socket\u003dTrue, time\u003dTrue, thread\u003dFalse)"},{"line_number":32,"context_line":"        eventlet.monkey_patch(all\u003dFalse, socket\u003dTrue, time\u003dTrue, thread\u003dFalse)"},{"line_number":33,"context_line":""},{"line_number":34,"context_line":""},{"line_number":35,"context_line":"    else:"}],"source_content_type":"text/x-python","patch_set":1,"id":"dab17558_330c4294","line":32,"range":{"start_line":32,"start_character":6,"end_line":32,"end_character":78},"updated":"2016-05-06 09:38:31.000000000","message":"This modification is only for remote debug, please ignore it.","commit_id":"58a291e11a2bc27ae7b154538184724a4c6ea0b4"},{"author":{"_account_id":20671,"name":"bin","email":"froyo.bin@gmail.com","username":"binyu"},"change_message_id":"1a96c01a8efd180c8a05d752b7bebc6c11193bf5","unresolved":false,"context_lines":[{"line_number":36,"context_line":"        # eventlet.monkey_patch(all\u003dFalse, socket\u003dTrue, time\u003dTrue, thread\u003dFalse)"},{"line_number":37,"context_line":""},{"line_number":38,"context_line":""},{"line_number":39,"context_line":"        eventlet.monkey_patch(all\u003dFalse, socket\u003dTrue, time\u003dTrue, thread\u003dFalse)"},{"line_number":40,"context_line":""},{"line_number":41,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"dab17558_7326ca17","line":39,"range":{"start_line":39,"start_character":0,"end_line":39,"end_character":78},"updated":"2016-05-06 09:38:31.000000000","message":"This modification is only for remote debug, please ignore it.","commit_id":"58a291e11a2bc27ae7b154538184724a4c6ea0b4"}],"neutron/db/db_base_plugin_common.py":[{"author":{"_account_id":20671,"name":"bin","email":"froyo.bin@gmail.com","username":"binyu"},"change_message_id":"1a96c01a8efd180c8a05d752b7bebc6c11193bf5","unresolved":false,"context_lines":[{"line_number":179,"context_line":"                             for ip in port[\"fixed_ips\"]],"},{"line_number":180,"context_line":"               \"device_id\": port[\"device_id\"],"},{"line_number":181,"context_line":"               \"device_owner\": port[\"device_owner\"]}"},{"line_number":182,"context_line":"        # if \"dns_assignment\" in port:"},{"line_number":183,"context_line":"        #     res[\"dns_assignment\"] \u003d [{\"ip_address\": a[\"ip_address\"],"},{"line_number":184,"context_line":"        #                               \"hostname\": a[\"hostname\"],"},{"line_number":185,"context_line":"        #                               \"fqdn\": a[\"fqdn\"]}"},{"line_number":186,"context_line":"        #                              for a in port[\"dns_assignment\"]]"},{"line_number":187,"context_line":"        # Call auxiliary extend functions, if any"},{"line_number":188,"context_line":"        if process_extensions:"},{"line_number":189,"context_line":"            self._apply_dict_extend_functions("}],"source_content_type":"text/x-python","patch_set":1,"id":"dab17558_93036e0f","line":186,"range":{"start_line":182,"start_character":7,"end_line":186,"end_character":71},"updated":"2016-05-06 09:38:31.000000000","message":"we do not need to handle the dns in ml2 plugin base db","commit_id":"58a291e11a2bc27ae7b154538184724a4c6ea0b4"}],"neutron/db/db_base_plugin_v2.py":[{"author":{"_account_id":4694,"name":"Miguel Lavalle","email":"miguel@mlavalle.com","username":"minsel"},"change_message_id":"cc733dc34f1a8b345807d0fd696aaa44bfa8d28c","unresolved":false,"context_lines":[{"line_number":1300,"context_line":"                                      marker_obj\u003dmarker_obj,"},{"line_number":1301,"context_line":"                                      page_reverse\u003dpage_reverse)"},{"line_number":1302,"context_line":"        items \u003d []"},{"line_number":1303,"context_line":"        for c in query:"},{"line_number":1304,"context_line":"            items.append(self._make_port_dict(c, fields))"},{"line_number":1305,"context_line":"        if limit and page_reverse:"},{"line_number":1306,"context_line":"            items.reverse()"}],"source_content_type":"text/x-python","patch_set":5,"id":"dab17558_cd2425c8","line":1303,"updated":"2016-05-12 22:30:59.000000000","message":"We can restore this to its original state. Let\u0027s get rid of the for loop an instead do a list comprehension:\n\nitems \u003d [self._make_port_dict(c, fields) for c in query]","commit_id":"83fa9dc0cf4489b781b206408ff8e144c84e9224"},{"author":{"_account_id":4694,"name":"Miguel Lavalle","email":"miguel@mlavalle.com","username":"minsel"},"change_message_id":"9e9216d7ce90b9d8f0d176bb8a8d755c3455ddb9","unresolved":false,"context_lines":[{"line_number":1299,"context_line":"                                      sorts\u003dsorts, limit\u003dlimit,"},{"line_number":1300,"context_line":"                                      marker_obj\u003dmarker_obj,"},{"line_number":1301,"context_line":"                                      page_reverse\u003dpage_reverse)"},{"line_number":1302,"context_line":"        items \u003d []"},{"line_number":1303,"context_line":"        for c in query:"},{"line_number":1304,"context_line":"            items.append(self._make_port_dict(c, fields))"},{"line_number":1305,"context_line":"        if limit and page_reverse:"},{"line_number":1306,"context_line":"            items.reverse()"},{"line_number":1307,"context_line":"        return items"}],"source_content_type":"text/x-python","patch_set":9,"id":"bab6814e_33bb39e7","line":1304,"range":{"start_line":1302,"start_character":8,"end_line":1304,"end_character":57},"updated":"2016-05-19 23:53:33.000000000","message":"Let\u0027s restore to its original form, before dns was added. The highlighted lines should be replaced by:\n\nitems \u003d [self._make_port_dict(c, fields) for c in query]","commit_id":"9ff8f55a6b1ed95f6629f85d9580a32b131e6d83"},{"author":{"_account_id":4694,"name":"Miguel Lavalle","email":"miguel@mlavalle.com","username":"minsel"},"change_message_id":"0fe6967baa240f58f693a8b0180d8dff03823893","unresolved":false,"context_lines":[{"line_number":70,"context_line":"# IP allocations being cleaned up by cascade."},{"line_number":71,"context_line":"AUTO_DELETE_PORT_OWNERS \u003d [constants.DEVICE_OWNER_DHCP]"},{"line_number":72,"context_line":""},{"line_number":73,"context_line":"DNS_DOMAIN_DEFAULT \u003d \u0027openstacklocal.\u0027"},{"line_number":74,"context_line":"FQDN_MAX_LEN \u003d 255"},{"line_number":75,"context_line":""},{"line_number":76,"context_line":""},{"line_number":77,"context_line":"def _check_subnet_not_used(context, subnet_id):"}],"source_content_type":"text/x-python","patch_set":11,"id":"9abb7d3a_6b81a54a","line":74,"range":{"start_line":73,"start_character":0,"end_line":74,"end_character":18},"updated":"2016-05-30 00:07:15.000000000","message":"We need to remove this. Not needed anymore in this module","commit_id":"978e3f6fd03dcb2bf3b2242c675cf175569f209c"},{"author":{"_account_id":20671,"name":"bin","email":"froyo.bin@gmail.com","username":"binyu"},"change_message_id":"b07a6f00a007725f08d02c7872c678f8ace201e2","unresolved":false,"context_lines":[{"line_number":70,"context_line":"# IP allocations being cleaned up by cascade."},{"line_number":71,"context_line":"AUTO_DELETE_PORT_OWNERS \u003d [constants.DEVICE_OWNER_DHCP]"},{"line_number":72,"context_line":""},{"line_number":73,"context_line":"DNS_DOMAIN_DEFAULT \u003d \u0027openstacklocal.\u0027"},{"line_number":74,"context_line":"FQDN_MAX_LEN \u003d 255"},{"line_number":75,"context_line":""},{"line_number":76,"context_line":""},{"line_number":77,"context_line":"def _check_subnet_not_used(context, subnet_id):"}],"source_content_type":"text/x-python","patch_set":11,"id":"9abb7d3a_1c02b96f","line":74,"range":{"start_line":73,"start_character":0,"end_line":74,"end_character":18},"in_reply_to":"9abb7d3a_6b81a54a","updated":"2016-05-30 10:14:00.000000000","message":"Done","commit_id":"978e3f6fd03dcb2bf3b2242c675cf175569f209c"},{"author":{"_account_id":4694,"name":"Miguel Lavalle","email":"miguel@mlavalle.com","username":"minsel"},"change_message_id":"e5cd9b5354dc6debfa2c141b333919793003c48a","unresolved":false,"context_lines":[{"line_number":1225,"context_line":"            db_port \u003d self._get_port(context, id)"},{"line_number":1226,"context_line":"            new_mac \u003d new_port.get(\u0027mac_address\u0027)"},{"line_number":1227,"context_line":"            self._validate_port_for_update(context, db_port, new_port, new_mac)"},{"line_number":1228,"context_line":"            # Note: _make_port_dict is called here to load extension data"},{"line_number":1229,"context_line":"            # (specifically host binding).  The IPAM plugin is separate from"},{"line_number":1230,"context_line":"            # the core plugin, so extensions are not loaded."},{"line_number":1231,"context_line":"            #"},{"line_number":1232,"context_line":"            # The IPAM code could cheat and get it directly from db_port but it"},{"line_number":1233,"context_line":"            # would have to know about the implementation (remember ml2 has its"},{"line_number":1234,"context_line":"            # own port binding schema that differs from the generic one)"},{"line_number":1235,"context_line":"            #"},{"line_number":1236,"context_line":"            # This code could extract just the port binding host here and pass"},{"line_number":1237,"context_line":"            # that in.  The problem is that db_base_plugin_common shouldn\u0027t"},{"line_number":1238,"context_line":"            # know anything about port binding.  This compromise sends IPAM a"},{"line_number":1239,"context_line":"            # port_dict with all of the extension data loaded."},{"line_number":1240,"context_line":"            changes \u003d self.ipam.update_port("},{"line_number":1241,"context_line":"                context,"},{"line_number":1242,"context_line":"                old_port_db\u003ddb_port,"},{"line_number":1243,"context_line":"                old_port\u003dself._make_port_dict(db_port),"},{"line_number":1244,"context_line":"                new_port\u003dnew_port)"},{"line_number":1245,"context_line":"        result \u003d self._make_port_dict(db_port)"},{"line_number":1246,"context_line":"        # Keep up with fields that changed"},{"line_number":1247,"context_line":"        if changes.original or changes.add or changes.remove:"}],"source_content_type":"text/x-python","patch_set":25,"id":"7aa08908_cacd7d67","line":1244,"range":{"start_line":1228,"start_character":12,"end_line":1244,"end_character":34},"updated":"2016-06-08 15:18:28.000000000","message":"If we don\u0027t do any of this change, all our DNS integration unit tests pass. So, why make this change in this patchset? If this is fixing something wrong with DNS integration, please write a test case that fails if we don\u0027t do this. If this is not related to DNS integration (the subject of this patchset) please file a bug explaining why this change is necessary and create a separate patchset, so the fix can be judged on its own merits.","commit_id":"f269198f9ebc77ce16c62ac697765c6c15bef5d8"},{"author":{"_account_id":20671,"name":"bin","email":"froyo.bin@gmail.com","username":"binyu"},"change_message_id":"0079fea358c64fcf0a11d9242437177899334898","unresolved":false,"context_lines":[{"line_number":1225,"context_line":"            db_port \u003d self._get_port(context, id)"},{"line_number":1226,"context_line":"            new_mac \u003d new_port.get(\u0027mac_address\u0027)"},{"line_number":1227,"context_line":"            self._validate_port_for_update(context, db_port, new_port, new_mac)"},{"line_number":1228,"context_line":"            # Note: _make_port_dict is called here to load extension data"},{"line_number":1229,"context_line":"            # (specifically host binding).  The IPAM plugin is separate from"},{"line_number":1230,"context_line":"            # the core plugin, so extensions are not loaded."},{"line_number":1231,"context_line":"            #"},{"line_number":1232,"context_line":"            # The IPAM code could cheat and get it directly from db_port but it"},{"line_number":1233,"context_line":"            # would have to know about the implementation (remember ml2 has its"},{"line_number":1234,"context_line":"            # own port binding schema that differs from the generic one)"},{"line_number":1235,"context_line":"            #"},{"line_number":1236,"context_line":"            # This code could extract just the port binding host here and pass"},{"line_number":1237,"context_line":"            # that in.  The problem is that db_base_plugin_common shouldn\u0027t"},{"line_number":1238,"context_line":"            # know anything about port binding.  This compromise sends IPAM a"},{"line_number":1239,"context_line":"            # port_dict with all of the extension data loaded."},{"line_number":1240,"context_line":"            changes \u003d self.ipam.update_port("},{"line_number":1241,"context_line":"                context,"},{"line_number":1242,"context_line":"                old_port_db\u003ddb_port,"},{"line_number":1243,"context_line":"                old_port\u003dself._make_port_dict(db_port),"},{"line_number":1244,"context_line":"                new_port\u003dnew_port)"},{"line_number":1245,"context_line":"        result \u003d self._make_port_dict(db_port)"},{"line_number":1246,"context_line":"        # Keep up with fields that changed"},{"line_number":1247,"context_line":"        if changes.original or changes.add or changes.remove:"}],"source_content_type":"text/x-python","patch_set":25,"id":"7aa08908_a59ced0e","line":1244,"range":{"start_line":1228,"start_character":12,"end_line":1244,"end_character":34},"in_reply_to":"7aa08908_6149bc8e","updated":"2016-06-13 03:39:50.000000000","message":"Thanks for your hand by hand tutorial, it\u0027s helpful. I think I was messed up by the meld when run merge-tools, I should learn more about this review system :)","commit_id":"f269198f9ebc77ce16c62ac697765c6c15bef5d8"},{"author":{"_account_id":4694,"name":"Miguel Lavalle","email":"miguel@mlavalle.com","username":"minsel"},"change_message_id":"652ea3ac96127ed6bb85fb61b24f9bb791bce506","unresolved":false,"context_lines":[{"line_number":1225,"context_line":"            db_port \u003d self._get_port(context, id)"},{"line_number":1226,"context_line":"            new_mac \u003d new_port.get(\u0027mac_address\u0027)"},{"line_number":1227,"context_line":"            self._validate_port_for_update(context, db_port, new_port, new_mac)"},{"line_number":1228,"context_line":"            # Note: _make_port_dict is called here to load extension data"},{"line_number":1229,"context_line":"            # (specifically host binding).  The IPAM plugin is separate from"},{"line_number":1230,"context_line":"            # the core plugin, so extensions are not loaded."},{"line_number":1231,"context_line":"            #"},{"line_number":1232,"context_line":"            # The IPAM code could cheat and get it directly from db_port but it"},{"line_number":1233,"context_line":"            # would have to know about the implementation (remember ml2 has its"},{"line_number":1234,"context_line":"            # own port binding schema that differs from the generic one)"},{"line_number":1235,"context_line":"            #"},{"line_number":1236,"context_line":"            # This code could extract just the port binding host here and pass"},{"line_number":1237,"context_line":"            # that in.  The problem is that db_base_plugin_common shouldn\u0027t"},{"line_number":1238,"context_line":"            # know anything about port binding.  This compromise sends IPAM a"},{"line_number":1239,"context_line":"            # port_dict with all of the extension data loaded."},{"line_number":1240,"context_line":"            changes \u003d self.ipam.update_port("},{"line_number":1241,"context_line":"                context,"},{"line_number":1242,"context_line":"                old_port_db\u003ddb_port,"},{"line_number":1243,"context_line":"                old_port\u003dself._make_port_dict(db_port),"},{"line_number":1244,"context_line":"                new_port\u003dnew_port)"},{"line_number":1245,"context_line":"        result \u003d self._make_port_dict(db_port)"},{"line_number":1246,"context_line":"        # Keep up with fields that changed"},{"line_number":1247,"context_line":"        if changes.original or changes.add or changes.remove:"}],"source_content_type":"text/x-python","patch_set":25,"id":"7aa08908_6149bc8e","line":1244,"range":{"start_line":1228,"start_character":12,"end_line":1244,"end_character":34},"in_reply_to":"7aa08908_a5d8fb53","updated":"2016-06-09 20:16:40.000000000","message":"OK, now understand what happened. We need to fix the conflict in the proper manner, so your patchset doesn\u0027t have to carry changes made by other patchsets. Here I walk you step by step through the process: http://paste.openstack.org/show/509304/\n\nPlease note that I used PS23 to do this. So:\n\n1) Don\u0027t forget to fix the gratuitous white space changes\n2) To get PS23, go to the top right hand corner of gerrit (with your patchset), select PS23 by clicking on the down arrowhead next to \"Patch Sets\" and then copy to the clipboard the \"Checkout\" command that you can see when you click on the down arrowhead next to \"Downloads\". Apply that command to your local copy of the Neutron git repo. You are going to get the following message:\n\nYou are in \u0027detached HEAD\u0027 state. You can look around, make experimental\nchanges and commit them, and you can discard any commits you make in this\nstate without impacting any branches by performing another checkout.\n\nIf you want to create a new branch to retain commits you create, you may\ndo so (now or later) by using -b with the checkout command again. Example:\n\n  git checkout -b new_branch_name\n\nHEAD is now at 33c643c... Refactor DNS integration out of DB core plugin\n\nSo before attempting to rebase on master, follow git\u0027s advice and create a branch, for example:\n\ngit checkout -b bin\n\nNow you can rebase on top of master (make sure master contains Carl change)\n\nHope this helps :-)","commit_id":"f269198f9ebc77ce16c62ac697765c6c15bef5d8"},{"author":{"_account_id":4694,"name":"Miguel Lavalle","email":"miguel@mlavalle.com","username":"minsel"},"change_message_id":"b415445f5e8be93d60d40fdcec04e9af7740655d","unresolved":false,"context_lines":[{"line_number":1225,"context_line":"            db_port \u003d self._get_port(context, id)"},{"line_number":1226,"context_line":"            new_mac \u003d new_port.get(\u0027mac_address\u0027)"},{"line_number":1227,"context_line":"            self._validate_port_for_update(context, db_port, new_port, new_mac)"},{"line_number":1228,"context_line":"            # Note: _make_port_dict is called here to load extension data"},{"line_number":1229,"context_line":"            # (specifically host binding).  The IPAM plugin is separate from"},{"line_number":1230,"context_line":"            # the core plugin, so extensions are not loaded."},{"line_number":1231,"context_line":"            #"},{"line_number":1232,"context_line":"            # The IPAM code could cheat and get it directly from db_port but it"},{"line_number":1233,"context_line":"            # would have to know about the implementation (remember ml2 has its"},{"line_number":1234,"context_line":"            # own port binding schema that differs from the generic one)"},{"line_number":1235,"context_line":"            #"},{"line_number":1236,"context_line":"            # This code could extract just the port binding host here and pass"},{"line_number":1237,"context_line":"            # that in.  The problem is that db_base_plugin_common shouldn\u0027t"},{"line_number":1238,"context_line":"            # know anything about port binding.  This compromise sends IPAM a"},{"line_number":1239,"context_line":"            # port_dict with all of the extension data loaded."},{"line_number":1240,"context_line":"            changes \u003d self.ipam.update_port("},{"line_number":1241,"context_line":"                context,"},{"line_number":1242,"context_line":"                old_port_db\u003ddb_port,"},{"line_number":1243,"context_line":"                old_port\u003dself._make_port_dict(db_port),"},{"line_number":1244,"context_line":"                new_port\u003dnew_port)"},{"line_number":1245,"context_line":"        result \u003d self._make_port_dict(db_port)"},{"line_number":1246,"context_line":"        # Keep up with fields that changed"},{"line_number":1247,"context_line":"        if changes.original or changes.add or changes.remove:"}],"source_content_type":"text/x-python","patch_set":25,"id":"7aa08908_0dbe7ffe","line":1244,"range":{"start_line":1228,"start_character":12,"end_line":1244,"end_character":34},"in_reply_to":"7aa08908_cacd7d67","updated":"2016-06-08 15:24:21.000000000","message":"Furthermore, no tests, DNS integration related or not, fail if we don\u0027t do this. This patchset has been verified by Jenkins many times without this change. Why do we need this?","commit_id":"f269198f9ebc77ce16c62ac697765c6c15bef5d8"},{"author":{"_account_id":20671,"name":"bin","email":"froyo.bin@gmail.com","username":"binyu"},"change_message_id":"ad5da034728b29cbea3c38d5cdff59a2e6e5e4fc","unresolved":false,"context_lines":[{"line_number":1225,"context_line":"            db_port \u003d self._get_port(context, id)"},{"line_number":1226,"context_line":"            new_mac \u003d new_port.get(\u0027mac_address\u0027)"},{"line_number":1227,"context_line":"            self._validate_port_for_update(context, db_port, new_port, new_mac)"},{"line_number":1228,"context_line":"            # Note: _make_port_dict is called here to load extension data"},{"line_number":1229,"context_line":"            # (specifically host binding).  The IPAM plugin is separate from"},{"line_number":1230,"context_line":"            # the core plugin, so extensions are not loaded."},{"line_number":1231,"context_line":"            #"},{"line_number":1232,"context_line":"            # The IPAM code could cheat and get it directly from db_port but it"},{"line_number":1233,"context_line":"            # would have to know about the implementation (remember ml2 has its"},{"line_number":1234,"context_line":"            # own port binding schema that differs from the generic one)"},{"line_number":1235,"context_line":"            #"},{"line_number":1236,"context_line":"            # This code could extract just the port binding host here and pass"},{"line_number":1237,"context_line":"            # that in.  The problem is that db_base_plugin_common shouldn\u0027t"},{"line_number":1238,"context_line":"            # know anything about port binding.  This compromise sends IPAM a"},{"line_number":1239,"context_line":"            # port_dict with all of the extension data loaded."},{"line_number":1240,"context_line":"            changes \u003d self.ipam.update_port("},{"line_number":1241,"context_line":"                context,"},{"line_number":1242,"context_line":"                old_port_db\u003ddb_port,"},{"line_number":1243,"context_line":"                old_port\u003dself._make_port_dict(db_port),"},{"line_number":1244,"context_line":"                new_port\u003dnew_port)"},{"line_number":1245,"context_line":"        result \u003d self._make_port_dict(db_port)"},{"line_number":1246,"context_line":"        # Keep up with fields that changed"},{"line_number":1247,"context_line":"        if changes.original or changes.add or changes.remove:"}],"source_content_type":"text/x-python","patch_set":25,"id":"7aa08908_a5d8fb53","line":1244,"range":{"start_line":1228,"start_character":12,"end_line":1244,"end_character":34},"in_reply_to":"7aa08908_cacd7d67","updated":"2016-06-09 07:59:07.000000000","message":"Hi Miguel,\nI just merge Carl Baldwin\u0027s patch set on  Make IPAM segment aware on port update to avoid the git rebase conflict.\nhere is the link https://github.com/openstack/neutron/commit/b937f2c2aa16c4b70842e006d655bab7e2bdcb72\n\nHe has change the parameters of \"self.ipam.update\".so I merged is codes here.","commit_id":"f269198f9ebc77ce16c62ac697765c6c15bef5d8"},{"author":{"_account_id":4694,"name":"Miguel Lavalle","email":"miguel@mlavalle.com","username":"minsel"},"change_message_id":"3005d823ea062d0a2070441366bf632fe51d30ed","unresolved":false,"context_lines":[{"line_number":1190,"context_line":"            # that in.  The problem is that db_base_plugin_common shouldn\u0027t"},{"line_number":1191,"context_line":"            # know anything about port binding.  This compromise sends IPAM a"},{"line_number":1192,"context_line":"            # port_dict with all of the extension data loaded."},{"line_number":1193,"context_line":"            changes \u003d self.ipam.update_port("},{"line_number":1194,"context_line":"                context,"},{"line_number":1195,"context_line":"                old_port_db\u003ddb_port,"},{"line_number":1196,"context_line":"                old_port\u003dself._make_port_dict(db_port),"}],"source_content_type":"text/x-python","patch_set":31,"id":"3aaa91ec_5ddef26d","line":1193,"range":{"start_line":1193,"start_character":12,"end_line":1193,"end_character":22},"updated":"2016-06-22 22:38:58.000000000","message":"For several weeks, pep8 checks were effectively disabled. They were re-enabled again with this patchset: https://review.openstack.org/#/c/332059/. This is why you are failing pep8 now with this line. Just remove \u0027changes\u0027, which is not used anymore once the dns related lines are removed","commit_id":"c6ec2bf74080e0a2f05f4fdf305eac4ef7397e97"},{"author":{"_account_id":20671,"name":"bin","email":"froyo.bin@gmail.com","username":"binyu"},"change_message_id":"f8cb4b0b0b0c06f39a28dce2460077bbaa5de3b4","unresolved":false,"context_lines":[{"line_number":1190,"context_line":"            # that in.  The problem is that db_base_plugin_common shouldn\u0027t"},{"line_number":1191,"context_line":"            # know anything about port binding.  This compromise sends IPAM a"},{"line_number":1192,"context_line":"            # port_dict with all of the extension data loaded."},{"line_number":1193,"context_line":"            changes \u003d self.ipam.update_port("},{"line_number":1194,"context_line":"                context,"},{"line_number":1195,"context_line":"                old_port_db\u003ddb_port,"},{"line_number":1196,"context_line":"                old_port\u003dself._make_port_dict(db_port),"}],"source_content_type":"text/x-python","patch_set":31,"id":"3aaa91ec_a5f40df2","line":1193,"range":{"start_line":1193,"start_character":12,"end_line":1193,"end_character":22},"in_reply_to":"3aaa91ec_5ddef26d","updated":"2016-06-24 02:51:55.000000000","message":"Done, Thanks","commit_id":"c6ec2bf74080e0a2f05f4fdf305eac4ef7397e97"}],"neutron/db/dns_db.py":[{"author":{"_account_id":4694,"name":"Miguel Lavalle","email":"miguel@mlavalle.com","username":"minsel"},"change_message_id":"0fe6967baa240f58f693a8b0180d8dff03823893","unresolved":false,"context_lines":[{"line_number":271,"context_line":"            msg \u003d _(\"dns_name cannot be specified without a dns_domain\")"},{"line_number":272,"context_line":"            raise n_exc.BadRequest(resource\u003d\u0027floatingip\u0027, msg\u003dmsg)"},{"line_number":273,"context_line":""},{"line_number":274,"context_line":"    def _get_internal_port_dns_data(self, context, floatingip_data):"},{"line_number":275,"context_line":"        internal_port \u003d context.session.query(models_v2.Port).filter_by("},{"line_number":276,"context_line":"            id\u003dfloatingip_data[\u0027port_id\u0027]).one()"},{"line_number":277,"context_line":"        dns_domain \u003d None"},{"line_number":278,"context_line":"        if internal_port[\u0027dns_name\u0027]:"},{"line_number":279,"context_line":"            net_dns \u003d context.session.query(NetworkDNSDomain).filter_by("},{"line_number":280,"context_line":"                network_id\u003dinternal_port[\u0027network_id\u0027]).one_or_none()"},{"line_number":281,"context_line":"            if net_dns:"},{"line_number":282,"context_line":"                dns_domain \u003d net_dns[\u0027dns_domain\u0027]"},{"line_number":283,"context_line":"        return internal_port[\u0027dns_name\u0027], dns_domain"},{"line_number":284,"context_line":""},{"line_number":285,"context_line":"    def _delete_floatingip_from_external_dns_service(self, context, dns_domain,"},{"line_number":286,"context_line":"                                                     dns_name, records):"}],"source_content_type":"text/x-python","patch_set":11,"id":"9abb7d3a_d20cac96","line":283,"range":{"start_line":274,"start_character":4,"end_line":283,"end_character":52},"updated":"2016-05-30 00:07:15.000000000","message":"I used James\u0027s unit tests (https://review.openstack.org/#/c/301809/) to test your patchset. Since we are moving \u0027dns_name\u0027 from the \u0027ports\u0027 table to \u0027portdnses\u0027, we broke this method. Please modify it as follows:\n\n    def _get_internal_port_dns_data(self, context, floatingip_data):\n        port_dns \u003d context.session.query(PortDNS).filter_by(\n            port_id\u003dfloatingip_data[\u0027port_id\u0027]).one_or_none()\n        dns_name \u003d None\n        dns_domain \u003d None\n        if port_dns and port_dns[\u0027dns_name\u0027]:\n            dns_name \u003d port_dns[\u0027dns_name\u0027]\n            internal_port \u003d context.session.query(models_v2.Port).filter_by(\n                id\u003dfloatingip_data[\u0027port_id\u0027]).one()\n            net_dns \u003d context.session.query(NetworkDNSDomain).filter_by(\n                network_id\u003dinternal_port[\u0027network_id\u0027]).one_or_none()\n            if net_dns:\n                dns_domain \u003d net_dns[\u0027dns_domain\u0027]\n        return dns_name, dns_domain","commit_id":"978e3f6fd03dcb2bf3b2242c675cf175569f209c"},{"author":{"_account_id":20671,"name":"bin","email":"froyo.bin@gmail.com","username":"binyu"},"change_message_id":"b07a6f00a007725f08d02c7872c678f8ace201e2","unresolved":false,"context_lines":[{"line_number":271,"context_line":"            msg \u003d _(\"dns_name cannot be specified without a dns_domain\")"},{"line_number":272,"context_line":"            raise n_exc.BadRequest(resource\u003d\u0027floatingip\u0027, msg\u003dmsg)"},{"line_number":273,"context_line":""},{"line_number":274,"context_line":"    def _get_internal_port_dns_data(self, context, floatingip_data):"},{"line_number":275,"context_line":"        internal_port \u003d context.session.query(models_v2.Port).filter_by("},{"line_number":276,"context_line":"            id\u003dfloatingip_data[\u0027port_id\u0027]).one()"},{"line_number":277,"context_line":"        dns_domain \u003d None"},{"line_number":278,"context_line":"        if internal_port[\u0027dns_name\u0027]:"},{"line_number":279,"context_line":"            net_dns \u003d context.session.query(NetworkDNSDomain).filter_by("},{"line_number":280,"context_line":"                network_id\u003dinternal_port[\u0027network_id\u0027]).one_or_none()"},{"line_number":281,"context_line":"            if net_dns:"},{"line_number":282,"context_line":"                dns_domain \u003d net_dns[\u0027dns_domain\u0027]"},{"line_number":283,"context_line":"        return internal_port[\u0027dns_name\u0027], dns_domain"},{"line_number":284,"context_line":""},{"line_number":285,"context_line":"    def _delete_floatingip_from_external_dns_service(self, context, dns_domain,"},{"line_number":286,"context_line":"                                                     dns_name, records):"}],"source_content_type":"text/x-python","patch_set":11,"id":"9abb7d3a_90fa0dbc","line":283,"range":{"start_line":274,"start_character":4,"end_line":283,"end_character":52},"in_reply_to":"9abb7d3a_d20cac96","updated":"2016-05-30 10:14:00.000000000","message":"Done","commit_id":"978e3f6fd03dcb2bf3b2242c675cf175569f209c"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"75539bcc665eeae1c43ef19721819cc09aaee83f","unresolved":false,"context_lines":[{"line_number":270,"context_line":"    def _get_internal_port_dns_data(self, context, floatingip_data):"},{"line_number":271,"context_line":"        port_dns \u003d context.session.query(PortDNS).filter_by("},{"line_number":272,"context_line":"            port_id\u003dfloatingip_data[\u0027port_id\u0027]).one_or_none()"},{"line_number":273,"context_line":"        dns_name \u003d None"},{"line_number":274,"context_line":"        dns_domain \u003d None"},{"line_number":275,"context_line":"        if port_dns and port_dns[\u0027dns_name\u0027]:"},{"line_number":276,"context_line":"            dns_name \u003d port_dns[\u0027dns_name\u0027]"},{"line_number":277,"context_line":"            internal_port \u003d context.session.query(models_v2.Port).filter_by("},{"line_number":278,"context_line":"                id\u003dfloatingip_data[\u0027port_id\u0027]).one()"}],"source_content_type":"text/x-python","patch_set":26,"id":"7aa08908_29d23d5c","line":275,"range":{"start_line":273,"start_character":8,"end_line":275,"end_character":45},"updated":"2016-06-14 17:34:45.000000000","message":"Consider replacing this with:\n\n  if not port_dns and port_dns[\u0027dns_name\u0027]:\n      return None, None\n\ndns_domain might need to be handled a little bit differently too.","commit_id":"54740383e350fc8a76ef303c410f8d31db4adf67"},{"author":{"_account_id":20671,"name":"bin","email":"froyo.bin@gmail.com","username":"binyu"},"change_message_id":"14969224b5e9cb5c5729588ec1e249180b9be085","unresolved":false,"context_lines":[{"line_number":270,"context_line":"    def _get_internal_port_dns_data(self, context, floatingip_data):"},{"line_number":271,"context_line":"        port_dns \u003d context.session.query(PortDNS).filter_by("},{"line_number":272,"context_line":"            port_id\u003dfloatingip_data[\u0027port_id\u0027]).one_or_none()"},{"line_number":273,"context_line":"        dns_name \u003d None"},{"line_number":274,"context_line":"        dns_domain \u003d None"},{"line_number":275,"context_line":"        if port_dns and port_dns[\u0027dns_name\u0027]:"},{"line_number":276,"context_line":"            dns_name \u003d port_dns[\u0027dns_name\u0027]"},{"line_number":277,"context_line":"            internal_port \u003d context.session.query(models_v2.Port).filter_by("},{"line_number":278,"context_line":"                id\u003dfloatingip_data[\u0027port_id\u0027]).one()"}],"source_content_type":"text/x-python","patch_set":26,"id":"7aa08908_d435f744","line":275,"range":{"start_line":273,"start_character":8,"end_line":275,"end_character":45},"in_reply_to":"7aa08908_29d23d5c","updated":"2016-06-17 08:35:27.000000000","message":"Done","commit_id":"54740383e350fc8a76ef303c410f8d31db4adf67"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"7f1907224c25b8a91b2368779ef1cc45e375f644","unresolved":false,"context_lines":[{"line_number":270,"context_line":"    def _get_internal_port_dns_data(self, context, floatingip_data):"},{"line_number":271,"context_line":"        port_dns \u003d context.session.query(PortDNS).filter_by("},{"line_number":272,"context_line":"            port_id\u003dfloatingip_data[\u0027port_id\u0027]).one_or_none()"},{"line_number":273,"context_line":"        dns_name \u003d None"},{"line_number":274,"context_line":"        dns_domain \u003d None"},{"line_number":275,"context_line":"        if port_dns and port_dns[\u0027dns_name\u0027]:"},{"line_number":276,"context_line":"            dns_name \u003d port_dns[\u0027dns_name\u0027]"},{"line_number":277,"context_line":"            internal_port \u003d context.session.query(models_v2.Port).filter_by("},{"line_number":278,"context_line":"                id\u003dfloatingip_data[\u0027port_id\u0027]).one()"}],"source_content_type":"text/x-python","patch_set":26,"id":"5a9d85d2_41c90b78","line":275,"range":{"start_line":273,"start_character":8,"end_line":275,"end_character":45},"in_reply_to":"7aa08908_d435f744","updated":"2016-06-20 22:20:01.000000000","message":"I messed that up.  Sorry.  Reviewer fail.  It should be:\n\n  if not (port_dns and port_dns[\u0027dns_name\u0027]):\n\nI meant to put parens in there originally but I just didn\u0027t.  That is my fault.  Might even want to go with this:\n\n  if not (port_dns and port_dns.get(\u0027dns_name\u0027)):","commit_id":"54740383e350fc8a76ef303c410f8d31db4adf67"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"75539bcc665eeae1c43ef19721819cc09aaee83f","unresolved":false,"context_lines":[{"line_number":274,"context_line":"        dns_domain \u003d None"},{"line_number":275,"context_line":"        if port_dns and port_dns[\u0027dns_name\u0027]:"},{"line_number":276,"context_line":"            dns_name \u003d port_dns[\u0027dns_name\u0027]"},{"line_number":277,"context_line":"            internal_port \u003d context.session.query(models_v2.Port).filter_by("},{"line_number":278,"context_line":"                id\u003dfloatingip_data[\u0027port_id\u0027]).one()"},{"line_number":279,"context_line":"            net_dns \u003d context.session.query(NetworkDNSDomain).filter_by("},{"line_number":280,"context_line":"                network_id\u003dinternal_port[\u0027network_id\u0027]).one_or_none()"},{"line_number":281,"context_line":"            if net_dns:"},{"line_number":282,"context_line":"                dns_domain \u003d net_dns[\u0027dns_domain\u0027]"},{"line_number":283,"context_line":"        return dns_name, dns_domain"}],"source_content_type":"text/x-python","patch_set":26,"id":"7aa08908_e9bcb507","line":280,"range":{"start_line":277,"start_character":12,"end_line":280,"end_character":69},"updated":"2016-06-14 17:34:45.000000000","message":"This can be done more efficiently with a single join query","commit_id":"54740383e350fc8a76ef303c410f8d31db4adf67"},{"author":{"_account_id":20671,"name":"bin","email":"froyo.bin@gmail.com","username":"binyu"},"change_message_id":"14969224b5e9cb5c5729588ec1e249180b9be085","unresolved":false,"context_lines":[{"line_number":274,"context_line":"        dns_domain \u003d None"},{"line_number":275,"context_line":"        if port_dns and port_dns[\u0027dns_name\u0027]:"},{"line_number":276,"context_line":"            dns_name \u003d port_dns[\u0027dns_name\u0027]"},{"line_number":277,"context_line":"            internal_port \u003d context.session.query(models_v2.Port).filter_by("},{"line_number":278,"context_line":"                id\u003dfloatingip_data[\u0027port_id\u0027]).one()"},{"line_number":279,"context_line":"            net_dns \u003d context.session.query(NetworkDNSDomain).filter_by("},{"line_number":280,"context_line":"                network_id\u003dinternal_port[\u0027network_id\u0027]).one_or_none()"},{"line_number":281,"context_line":"            if net_dns:"},{"line_number":282,"context_line":"                dns_domain \u003d net_dns[\u0027dns_domain\u0027]"},{"line_number":283,"context_line":"        return dns_name, dns_domain"}],"source_content_type":"text/x-python","patch_set":26,"id":"7aa08908_3441dba9","line":280,"range":{"start_line":277,"start_character":12,"end_line":280,"end_character":69},"in_reply_to":"7aa08908_e9bcb507","updated":"2016-06-17 08:35:27.000000000","message":"Done","commit_id":"54740383e350fc8a76ef303c410f8d31db4adf67"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"a8436d4c18118be038cbdbf9c0ff86b27d128102","unresolved":false,"context_lines":[{"line_number":279,"context_line":"            id\u003dfloatingip_data[\u0027port_id\u0027]).one_or_none()"},{"line_number":280,"context_line":"        if net_dns:"},{"line_number":281,"context_line":"            dns_domain \u003d net_dns[\u0027dns_domain\u0027]"},{"line_number":282,"context_line":"        return dns_name, dns_domain"},{"line_number":283,"context_line":""},{"line_number":284,"context_line":"    def _delete_floatingip_from_external_dns_service(self, context, dns_domain,"},{"line_number":285,"context_line":"                                                     dns_name, records):"}],"source_content_type":"text/x-python","patch_set":30,"id":"5a9d85d2_41358bd8","line":282,"range":{"start_line":282,"start_character":25,"end_line":282,"end_character":35},"updated":"2016-06-20 22:12:40.000000000","message":"I didn\u0027t mean to mislead you but I feel like I did.  I\u0027m sorry about that.\n\nHere, dns_domain may not be set if L281 is skipped over.  This can be fixed like this:\n\n  if not net_dns:\n      return dns_name, None\n return dns_name, net_dns[\u0027dns_domain\u0027]\n \nBTW, the reason I really like this pattern over the one in PS26 is that when I\u0027m reading code, I don\u0027t have to follow as many local variables through the various code paths.  So, that\u0027s why I\u0027ve suggested eliminating dns_domain as a local variable and reduced where dns_name is needed to.  In my opinion, that improves readability.","commit_id":"726511aa345ba89339c24fa5fd5bcbede45aa63c"}],"neutron/db/migration/alembic_migrations/versions/liberty/expand/34af2b5c5a59_add_dns_name_to_port.py":[{"author":{"_account_id":7249,"name":"Ann Taraday","email":"akamyshnikova@mirantis.com","username":"AKamyshnikova"},"change_message_id":"7841caf8736299b4f059c0a2feae42b169a18836","unresolved":false,"context_lines":[{"line_number":37,"context_line":""},{"line_number":38,"context_line":""},{"line_number":39,"context_line":"def upgrade():"},{"line_number":40,"context_line":"    return"},{"line_number":41,"context_line":"    op.add_column(\u0027ports\u0027,"},{"line_number":42,"context_line":"                  sa.Column(\u0027dns_name\u0027,"},{"line_number":43,"context_line":"                            sa.String(length\u003ddns.FQDN_MAX_LEN),"}],"source_content_type":"text/x-python","patch_set":1,"id":"dab17558_73b08a8c","line":40,"updated":"2016-05-06 09:29:26.000000000","message":"I\u0027m not clearly understand this. You try to avoid adding this column?\nYou should not change existing migrations, you should propose new migration that this drop column.","commit_id":"58a291e11a2bc27ae7b154538184724a4c6ea0b4"},{"author":{"_account_id":20671,"name":"bin","email":"froyo.bin@gmail.com","username":"binyu"},"change_message_id":"1a96c01a8efd180c8a05d752b7bebc6c11193bf5","unresolved":false,"context_lines":[{"line_number":37,"context_line":""},{"line_number":38,"context_line":""},{"line_number":39,"context_line":"def upgrade():"},{"line_number":40,"context_line":"    return"},{"line_number":41,"context_line":"    op.add_column(\u0027ports\u0027,"},{"line_number":42,"context_line":"                  sa.Column(\u0027dns_name\u0027,"},{"line_number":43,"context_line":"                            sa.String(length\u003ddns.FQDN_MAX_LEN),"}],"source_content_type":"text/x-python","patch_set":1,"id":"dab17558_8e5fc10d","line":40,"in_reply_to":"dab17558_73b08a8c","updated":"2016-05-06 09:38:31.000000000","message":"Thank you for your suggestions.\n\nAs I remove the dns_name out of port database, so we do not need to create this column in port database. I just want the dns plugin to handle the dns stuff, and hide the process of dns from the view of core plugin.","commit_id":"58a291e11a2bc27ae7b154538184724a4c6ea0b4"},{"author":{"_account_id":7249,"name":"Ann Taraday","email":"akamyshnikova@mirantis.com","username":"AKamyshnikova"},"change_message_id":"7ccb50d3d006f652a88c17323f24d1ef9ce0ca69","unresolved":false,"context_lines":[{"line_number":37,"context_line":""},{"line_number":38,"context_line":""},{"line_number":39,"context_line":"def upgrade():"},{"line_number":40,"context_line":"    return"},{"line_number":41,"context_line":"    op.add_column(\u0027ports\u0027,"},{"line_number":42,"context_line":"                  sa.Column(\u0027dns_name\u0027,"},{"line_number":43,"context_line":"                            sa.String(length\u003ddns.FQDN_MAX_LEN),"}],"source_content_type":"text/x-python","patch_set":1,"id":"dab17558_cec0a9e3","line":40,"in_reply_to":"dab17558_8e5fc10d","updated":"2016-05-06 09:50:55.000000000","message":"As this column already created in liberty release, the only way is to drop in another migration.","commit_id":"58a291e11a2bc27ae7b154538184724a4c6ea0b4"},{"author":{"_account_id":20671,"name":"bin","email":"froyo.bin@gmail.com","username":"binyu"},"change_message_id":"3ceaf7673c593c1b04cc6a7f9155a7ed444be91e","unresolved":false,"context_lines":[{"line_number":37,"context_line":""},{"line_number":38,"context_line":""},{"line_number":39,"context_line":"def upgrade():"},{"line_number":40,"context_line":"    return"},{"line_number":41,"context_line":"    op.add_column(\u0027ports\u0027,"},{"line_number":42,"context_line":"                  sa.Column(\u0027dns_name\u0027,"},{"line_number":43,"context_line":"                            sa.String(length\u003ddns.FQDN_MAX_LEN),"}],"source_content_type":"text/x-python","patch_set":1,"id":"dab17558_3197da91","line":40,"in_reply_to":"dab17558_cec0a9e3","updated":"2016-05-09 09:07:26.000000000","message":"Thank you for your guide.","commit_id":"58a291e11a2bc27ae7b154538184724a4c6ea0b4"}],"neutron/db/migration/alembic_migrations/versions/newton/contract/a84ccf28f06a_drop_dns_name_from_port.py":[{"author":{"_account_id":4694,"name":"Miguel Lavalle","email":"miguel@mlavalle.com","username":"minsel"},"change_message_id":"eb458af644720c50caf40da038c041aa80e6c69b","unresolved":false,"context_lines":[{"line_number":32,"context_line":"def upgrade():"},{"line_number":33,"context_line":"    op.drop_column(\u0027ports\u0027, \u0027dns_name\u0027)"},{"line_number":34,"context_line":"    op.add_column(\u0027portdnses\u0027,"},{"line_number":35,"context_line":"                  sa.Column(\u0027update_dns\u0027, sa.Boolean, nullable\u003dFalse))"}],"source_content_type":"text/x-python","patch_set":9,"id":"bab6814e_c92839e5","line":35,"updated":"2016-05-20 00:34:47.000000000","message":"The column we need to add is \u0027dns_name\u0027 and it is an string 255 long","commit_id":"9ff8f55a6b1ed95f6629f85d9580a32b131e6d83"},{"author":{"_account_id":4694,"name":"Miguel Lavalle","email":"miguel@mlavalle.com","username":"minsel"},"change_message_id":"0fe6967baa240f58f693a8b0180d8dff03823893","unresolved":false,"context_lines":[{"line_number":16,"context_line":"\"\"\"drop dns name from port"},{"line_number":17,"context_line":""},{"line_number":18,"context_line":"Revision ID: a84ccf28f06a"},{"line_number":19,"context_line":"Revises: 89ab9a816d70"},{"line_number":20,"context_line":"Create Date: 2016-04-26 14:40:11.741237"},{"line_number":21,"context_line":""},{"line_number":22,"context_line":"\"\"\""}],"source_content_type":"text/x-python","patch_set":11,"id":"9abb7d3a_c0ad0833","line":19,"range":{"start_line":19,"start_character":9,"end_line":19,"end_character":21},"updated":"2016-05-30 00:07:15.000000000","message":"This has to be the same as line 26","commit_id":"978e3f6fd03dcb2bf3b2242c675cf175569f209c"},{"author":{"_account_id":20671,"name":"bin","email":"froyo.bin@gmail.com","username":"binyu"},"change_message_id":"b07a6f00a007725f08d02c7872c678f8ace201e2","unresolved":false,"context_lines":[{"line_number":16,"context_line":"\"\"\"drop dns name from port"},{"line_number":17,"context_line":""},{"line_number":18,"context_line":"Revision ID: a84ccf28f06a"},{"line_number":19,"context_line":"Revises: 89ab9a816d70"},{"line_number":20,"context_line":"Create Date: 2016-04-26 14:40:11.741237"},{"line_number":21,"context_line":""},{"line_number":22,"context_line":"\"\"\""}],"source_content_type":"text/x-python","patch_set":11,"id":"9abb7d3a_f0d6f925","line":19,"range":{"start_line":19,"start_character":9,"end_line":19,"end_character":21},"in_reply_to":"9abb7d3a_c0ad0833","updated":"2016-05-30 10:14:00.000000000","message":"Done","commit_id":"978e3f6fd03dcb2bf3b2242c675cf175569f209c"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"5ff0ca927ce962e71c6aa5af62ceb515e0c9572c","unresolved":false,"context_lines":[{"line_number":30,"context_line":""},{"line_number":31,"context_line":""},{"line_number":32,"context_line":"def upgrade():"},{"line_number":33,"context_line":"    op.drop_column(\u0027ports\u0027, \u0027dns_name\u0027)"},{"line_number":34,"context_line":"    op.add_column(\u0027portdnses\u0027,"},{"line_number":35,"context_line":"                  sa.Column(\u0027dns_name\u0027, sa.String(length\u003d255), nullable\u003dFalse))"}],"source_content_type":"text/x-python","patch_set":20,"id":"7aa08908_c0dcca14","line":33,"range":{"start_line":33,"start_character":7,"end_line":33,"end_character":18},"updated":"2016-06-06 18:21:33.000000000","message":"This is a contract operation.\n\nAlso, once you do this drop, all of the data in the column is gone!  I expected to see something like this;\n\nExpand script:\n - Add column to portdnses table\n - Move all dns_name data from the ports table to the portdnses table.\n\nContract script:\n - Drop the dns_name column.","commit_id":"677267d8c7e956ee0e2315cb13ffbf58e6bc7c18"},{"author":{"_account_id":20671,"name":"bin","email":"froyo.bin@gmail.com","username":"binyu"},"change_message_id":"e88715f752a474a5bac4a7a74f68a93ec3e73f00","unresolved":false,"context_lines":[{"line_number":30,"context_line":""},{"line_number":31,"context_line":""},{"line_number":32,"context_line":"def upgrade():"},{"line_number":33,"context_line":"    op.drop_column(\u0027ports\u0027, \u0027dns_name\u0027)"},{"line_number":34,"context_line":"    op.add_column(\u0027portdnses\u0027,"},{"line_number":35,"context_line":"                  sa.Column(\u0027dns_name\u0027, sa.String(length\u003d255), nullable\u003dFalse))"}],"source_content_type":"text/x-python","patch_set":20,"id":"7aa08908_57d042f6","line":33,"range":{"start_line":33,"start_character":7,"end_line":33,"end_character":18},"in_reply_to":"7aa08908_41161956","updated":"2016-06-08 06:59:14.000000000","message":"Done","commit_id":"677267d8c7e956ee0e2315cb13ffbf58e6bc7c18"},{"author":{"_account_id":4694,"name":"Miguel Lavalle","email":"miguel@mlavalle.com","username":"minsel"},"change_message_id":"cb6c8d788352a68d8e583ec017a7ed4a9d75520f","unresolved":false,"context_lines":[{"line_number":30,"context_line":""},{"line_number":31,"context_line":""},{"line_number":32,"context_line":"def upgrade():"},{"line_number":33,"context_line":"    op.drop_column(\u0027ports\u0027, \u0027dns_name\u0027)"},{"line_number":34,"context_line":"    op.add_column(\u0027portdnses\u0027,"},{"line_number":35,"context_line":"                  sa.Column(\u0027dns_name\u0027, sa.String(length\u003d255), nullable\u003dFalse))"}],"source_content_type":"text/x-python","patch_set":20,"id":"7aa08908_49ee37b5","line":33,"range":{"start_line":33,"start_character":7,"end_line":33,"end_character":18},"in_reply_to":"7aa08908_41161956","updated":"2016-06-07 01:38:57.000000000","message":"Let\u0027s amend point 3 in my previous comment:\n\n3) For each port where dns_name !\u003d \"\" and dns_name is not None, if the port has an associated row in portdnses, update that row with dns_name; otherwise create a row in portdnses with the port\u0027s dns_name","commit_id":"677267d8c7e956ee0e2315cb13ffbf58e6bc7c18"},{"author":{"_account_id":20671,"name":"bin","email":"froyo.bin@gmail.com","username":"binyu"},"change_message_id":"e88715f752a474a5bac4a7a74f68a93ec3e73f00","unresolved":false,"context_lines":[{"line_number":30,"context_line":""},{"line_number":31,"context_line":""},{"line_number":32,"context_line":"def upgrade():"},{"line_number":33,"context_line":"    op.drop_column(\u0027ports\u0027, \u0027dns_name\u0027)"},{"line_number":34,"context_line":"    op.add_column(\u0027portdnses\u0027,"},{"line_number":35,"context_line":"                  sa.Column(\u0027dns_name\u0027, sa.String(length\u003d255), nullable\u003dFalse))"}],"source_content_type":"text/x-python","patch_set":20,"id":"7aa08908_97bf4aa9","line":33,"range":{"start_line":33,"start_character":7,"end_line":33,"end_character":18},"in_reply_to":"7aa08908_49ee37b5","updated":"2016-06-08 06:59:14.000000000","message":"Done","commit_id":"677267d8c7e956ee0e2315cb13ffbf58e6bc7c18"},{"author":{"_account_id":6524,"name":"Henry Gessau","email":"HenryG@gessau.net","username":"gessau"},"change_message_id":"500081b8a082b824cecfdd11d694cbcd01ffdded","unresolved":false,"context_lines":[{"line_number":30,"context_line":""},{"line_number":31,"context_line":""},{"line_number":32,"context_line":"def upgrade():"},{"line_number":33,"context_line":"    op.drop_column(\u0027ports\u0027, \u0027dns_name\u0027)"},{"line_number":34,"context_line":"    op.add_column(\u0027portdnses\u0027,"},{"line_number":35,"context_line":"                  sa.Column(\u0027dns_name\u0027, sa.String(length\u003d255), nullable\u003dFalse))"}],"source_content_type":"text/x-python","patch_set":20,"id":"7aa08908_e3d62d26","line":33,"range":{"start_line":33,"start_character":7,"end_line":33,"end_character":18},"in_reply_to":"7aa08908_c0dcca14","updated":"2016-06-06 19:35:13.000000000","message":"Right. https://review.openstack.org/325699 should catch this kind if thing once it merges.","commit_id":"677267d8c7e956ee0e2315cb13ffbf58e6bc7c18"},{"author":{"_account_id":20671,"name":"bin","email":"froyo.bin@gmail.com","username":"binyu"},"change_message_id":"e88715f752a474a5bac4a7a74f68a93ec3e73f00","unresolved":false,"context_lines":[{"line_number":30,"context_line":""},{"line_number":31,"context_line":""},{"line_number":32,"context_line":"def upgrade():"},{"line_number":33,"context_line":"    op.drop_column(\u0027ports\u0027, \u0027dns_name\u0027)"},{"line_number":34,"context_line":"    op.add_column(\u0027portdnses\u0027,"},{"line_number":35,"context_line":"                  sa.Column(\u0027dns_name\u0027, sa.String(length\u003d255), nullable\u003dFalse))"}],"source_content_type":"text/x-python","patch_set":20,"id":"7aa08908_17b35aea","line":33,"range":{"start_line":33,"start_character":7,"end_line":33,"end_character":18},"in_reply_to":"7aa08908_c0dcca14","updated":"2016-06-08 06:59:14.000000000","message":"Thanks, I have added the similar code as you described here.\nNow, I create a script in expend to create the dns_name in portdnses, and depending on that scripts,\nI will update/insert the dns_name info from port to portdnses in this Contract stage..\n\nThank Miguel for help me test this logic, he creates four dns_name and do the migration: http://paste.openstack.org/show/508766/","commit_id":"677267d8c7e956ee0e2315cb13ffbf58e6bc7c18"},{"author":{"_account_id":4694,"name":"Miguel Lavalle","email":"miguel@mlavalle.com","username":"minsel"},"change_message_id":"613a53ebb6dad02a843bacf82affa4c29f31b35a","unresolved":false,"context_lines":[{"line_number":30,"context_line":""},{"line_number":31,"context_line":""},{"line_number":32,"context_line":"def upgrade():"},{"line_number":33,"context_line":"    op.drop_column(\u0027ports\u0027, \u0027dns_name\u0027)"},{"line_number":34,"context_line":"    op.add_column(\u0027portdnses\u0027,"},{"line_number":35,"context_line":"                  sa.Column(\u0027dns_name\u0027, sa.String(length\u003d255), nullable\u003dFalse))"}],"source_content_type":"text/x-python","patch_set":20,"id":"7aa08908_41161956","line":33,"range":{"start_line":33,"start_character":7,"end_line":33,"end_character":18},"in_reply_to":"7aa08908_e3d62d26","updated":"2016-06-06 20:38:35.000000000","message":"Based on the feedback from Carl and Henry, we are going to use http://git.openstack.org/cgit/openstack/neutron/tree/neutron/db/migration/alembic_migrations/versions/mitaka/contract/8a6d8bdae39_migrate_neutron_resources_table.py as an example of what needs to be done: \n\n1) In your expand script add the column to portdnses\n\n2) Your contract script is going to depend on the expand script. Look at line 26 in the example\n\n3) The contract script is going to create a row in portdnses for each port that has dns_name !\u003d \"\". To do this, the script is going to execute a for loop similar to lines 74 to 79 in the example\n\n4) Finally, the contract script drops dns_name from ports.\n\nHope this helps :-)","commit_id":"677267d8c7e956ee0e2315cb13ffbf58e6bc7c18"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"5ff0ca927ce962e71c6aa5af62ceb515e0c9572c","unresolved":false,"context_lines":[{"line_number":31,"context_line":""},{"line_number":32,"context_line":"def upgrade():"},{"line_number":33,"context_line":"    op.drop_column(\u0027ports\u0027, \u0027dns_name\u0027)"},{"line_number":34,"context_line":"    op.add_column(\u0027portdnses\u0027,"},{"line_number":35,"context_line":"                  sa.Column(\u0027dns_name\u0027, sa.String(length\u003d255), nullable\u003dFalse))"}],"source_content_type":"text/x-python","patch_set":20,"id":"7aa08908_a0d7feeb","line":34,"range":{"start_line":34,"start_character":7,"end_line":34,"end_character":17},"updated":"2016-06-06 18:21:33.000000000","message":"This is an expand operation and we should put it in a separate expand script.\n\nThis might not be totally required for Newton but I think we should start getting in to the habit of strict distinction between the two kinds of operations.","commit_id":"677267d8c7e956ee0e2315cb13ffbf58e6bc7c18"},{"author":{"_account_id":20671,"name":"bin","email":"froyo.bin@gmail.com","username":"binyu"},"change_message_id":"e88715f752a474a5bac4a7a74f68a93ec3e73f00","unresolved":false,"context_lines":[{"line_number":31,"context_line":""},{"line_number":32,"context_line":"def upgrade():"},{"line_number":33,"context_line":"    op.drop_column(\u0027ports\u0027, \u0027dns_name\u0027)"},{"line_number":34,"context_line":"    op.add_column(\u0027portdnses\u0027,"},{"line_number":35,"context_line":"                  sa.Column(\u0027dns_name\u0027, sa.String(length\u003d255), nullable\u003dFalse))"}],"source_content_type":"text/x-python","patch_set":20,"id":"7aa08908_77045e49","line":34,"range":{"start_line":34,"start_character":7,"end_line":34,"end_character":17},"in_reply_to":"7aa08908_a0d7feeb","updated":"2016-06-08 06:59:14.000000000","message":"Done, I have created a new scripts in expend to create the dns_name in portdnses","commit_id":"677267d8c7e956ee0e2315cb13ffbf58e6bc7c18"}],"neutron/db/migration/alembic_migrations/versions/newton/contract/a84ccf28f06a_migrate_dns_name_from_port.py":[{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"75539bcc665eeae1c43ef19721819cc09aaee83f","unresolved":false,"context_lines":[{"line_number":15,"context_line":""},{"line_number":16,"context_line":"\"\"\"migrate dns name from port"},{"line_number":17,"context_line":""},{"line_number":18,"context_line":"Revision ID: a84ccf28f06a"},{"line_number":19,"context_line":"Revises: 8fd3918ef6f4"},{"line_number":20,"context_line":"Create Date: 2016-04-26 14:40:11.741237"},{"line_number":21,"context_line":""},{"line_number":22,"context_line":"\"\"\""},{"line_number":23,"context_line":""}],"source_content_type":"text/x-python","patch_set":26,"id":"7aa08908_690d65e7","line":20,"range":{"start_line":18,"start_character":0,"end_line":20,"end_character":39},"updated":"2016-06-14 17:34:45.000000000","message":"Typically I just remove these comments.  It is all redundant or unimportant information and, more often than not, it ends up getting out of date as the patch gets rebased.","commit_id":"54740383e350fc8a76ef303c410f8d31db4adf67"},{"author":{"_account_id":20671,"name":"bin","email":"froyo.bin@gmail.com","username":"binyu"},"change_message_id":"14969224b5e9cb5c5729588ec1e249180b9be085","unresolved":false,"context_lines":[{"line_number":15,"context_line":""},{"line_number":16,"context_line":"\"\"\"migrate dns name from port"},{"line_number":17,"context_line":""},{"line_number":18,"context_line":"Revision ID: a84ccf28f06a"},{"line_number":19,"context_line":"Revises: 8fd3918ef6f4"},{"line_number":20,"context_line":"Create Date: 2016-04-26 14:40:11.741237"},{"line_number":21,"context_line":""},{"line_number":22,"context_line":"\"\"\""},{"line_number":23,"context_line":""}],"source_content_type":"text/x-python","patch_set":26,"id":"7aa08908_91141ea0","line":20,"range":{"start_line":18,"start_character":0,"end_line":20,"end_character":39},"in_reply_to":"7aa08908_690d65e7","updated":"2016-06-17 08:35:27.000000000","message":"Done, Thanks","commit_id":"54740383e350fc8a76ef303c410f8d31db4adf67"},{"author":{"_account_id":6524,"name":"Henry Gessau","email":"HenryG@gessau.net","username":"gessau"},"change_message_id":"e0f035db39f98691079d81ae21e03a657e619d85","unresolved":false,"context_lines":[{"line_number":15,"context_line":""},{"line_number":16,"context_line":"\"\"\"migrate dns name from port"},{"line_number":17,"context_line":""},{"line_number":18,"context_line":"Revision ID: a84ccf28f06a"},{"line_number":19,"context_line":"Revises: 8fd3918ef6f4"},{"line_number":20,"context_line":"Create Date: 2016-04-26 14:40:11.741237"},{"line_number":21,"context_line":""},{"line_number":22,"context_line":"\"\"\""},{"line_number":23,"context_line":""}],"source_content_type":"text/x-python","patch_set":26,"id":"7aa08908_887addee","line":20,"range":{"start_line":18,"start_character":0,"end_line":20,"end_character":39},"in_reply_to":"7aa08908_690d65e7","updated":"2016-06-16 14:39:06.000000000","message":"Yeah, we could consider removing it from the template.","commit_id":"54740383e350fc8a76ef303c410f8d31db4adf67"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"75539bcc665eeae1c43ef19721819cc09aaee83f","unresolved":false,"context_lines":[{"line_number":31,"context_line":"import sqlalchemy as sa"},{"line_number":32,"context_line":""},{"line_number":33,"context_line":""},{"line_number":34,"context_line":"ports \u003d sa.Table("},{"line_number":35,"context_line":"    \u0027ports\u0027, sa.MetaData(),"},{"line_number":36,"context_line":"    sa.Column(\u0027id\u0027, sa.String(length\u003d36), nullable\u003dFalse),"},{"line_number":37,"context_line":"    sa.Column(\u0027dns_name\u0027, sa.String(length\u003ddns.FQDN_MAX_LEN), nullable\u003dTrue))"}],"source_content_type":"text/x-python","patch_set":26,"id":"7aa08908_143cb891","line":34,"range":{"start_line":34,"start_character":0,"end_line":34,"end_character":16},"updated":"2016-06-14 17:34:45.000000000","message":"I think I understand that at the time this is run, the model for the ports table that includes dns_name is gone from the models_v2.py file.  So, I think I see why you included these table definitions.  I just wonder if there is a way to have sqlalchemy get this on demand.  I don\u0027t know if there really is, just wondering.  It would be nice.\n\nI just got thinking that alembic must have some way to get the current model from the database in order to generate migration scripts.","commit_id":"54740383e350fc8a76ef303c410f8d31db4adf67"},{"author":{"_account_id":4694,"name":"Miguel Lavalle","email":"miguel@mlavalle.com","username":"minsel"},"change_message_id":"833d5b5cf200a158ef4f445ffda17b119c393e67","unresolved":false,"context_lines":[{"line_number":31,"context_line":"import sqlalchemy as sa"},{"line_number":32,"context_line":""},{"line_number":33,"context_line":""},{"line_number":34,"context_line":"ports \u003d sa.Table("},{"line_number":35,"context_line":"    \u0027ports\u0027, sa.MetaData(),"},{"line_number":36,"context_line":"    sa.Column(\u0027id\u0027, sa.String(length\u003d36), nullable\u003dFalse),"},{"line_number":37,"context_line":"    sa.Column(\u0027dns_name\u0027, sa.String(length\u003ddns.FQDN_MAX_LEN), nullable\u003dTrue))"}],"source_content_type":"text/x-python","patch_set":26,"id":"7aa08908_cdf0ac94","line":34,"range":{"start_line":34,"start_character":0,"end_line":34,"end_character":16},"in_reply_to":"7aa08908_143cb891","updated":"2016-06-15 16:10:20.000000000","message":"Carl is challenging us here to find a better way to do this. This might be useful to the community as a whole, beyond just this patchset.\n\nDuring my day time, I\u0027ll ask around and dig deeper in the documentation. If I find something, I\u0027ll post another comment here.\n\nYou can also search here:  http://alembic.readthedocs.io/en/latest/","commit_id":"54740383e350fc8a76ef303c410f8d31db4adf67"},{"author":{"_account_id":6524,"name":"Henry Gessau","email":"HenryG@gessau.net","username":"gessau"},"change_message_id":"e0f035db39f98691079d81ae21e03a657e619d85","unresolved":false,"context_lines":[{"line_number":31,"context_line":"import sqlalchemy as sa"},{"line_number":32,"context_line":""},{"line_number":33,"context_line":""},{"line_number":34,"context_line":"ports \u003d sa.Table("},{"line_number":35,"context_line":"    \u0027ports\u0027, sa.MetaData(),"},{"line_number":36,"context_line":"    sa.Column(\u0027id\u0027, sa.String(length\u003d36), nullable\u003dFalse),"},{"line_number":37,"context_line":"    sa.Column(\u0027dns_name\u0027, sa.String(length\u003ddns.FQDN_MAX_LEN), nullable\u003dTrue))"}],"source_content_type":"text/x-python","patch_set":26,"id":"7aa08908_6857b126","line":34,"range":{"start_line":34,"start_character":0,"end_line":34,"end_character":16},"in_reply_to":"7aa08908_1b1c92c0","updated":"2016-06-16 14:39:06.000000000","message":"Sorry for missing your ping Miguel.\nAs Ann says, this is the way we do it for back-versions of models. Other solutions are complex and not worth the effort IMO.","commit_id":"54740383e350fc8a76ef303c410f8d31db4adf67"},{"author":{"_account_id":7249,"name":"Ann Taraday","email":"akamyshnikova@mirantis.com","username":"AKamyshnikova"},"change_message_id":"7455d9c0efcb9aa99cc2a9b5f92c2a333fa3e68f","unresolved":false,"context_lines":[{"line_number":31,"context_line":"import sqlalchemy as sa"},{"line_number":32,"context_line":""},{"line_number":33,"context_line":""},{"line_number":34,"context_line":"ports \u003d sa.Table("},{"line_number":35,"context_line":"    \u0027ports\u0027, sa.MetaData(),"},{"line_number":36,"context_line":"    sa.Column(\u0027id\u0027, sa.String(length\u003d36), nullable\u003dFalse),"},{"line_number":37,"context_line":"    sa.Column(\u0027dns_name\u0027, sa.String(length\u003ddns.FQDN_MAX_LEN), nullable\u003dTrue))"}],"source_content_type":"text/x-python","patch_set":26,"id":"7aa08908_1b1c92c0","line":34,"range":{"start_line":34,"start_character":0,"end_line":34,"end_character":16},"in_reply_to":"7aa08908_639ed664","updated":"2016-06-16 07:44:42.000000000","message":"When you look trough neutron/db/migration/alembic_migrations you won\u0027t find anything different from what we have here :) \n\nThere is two things: current models and tables that are already created in the database. Current models we can with metadata like we have here for model migration test https://github.com/openstack/neutron/blob/master/neutron/db/migration/models/head.py#L66, but for it we need to have imports of models which is not good for migrations. Current tables scheme in the database we should be able with alembic.migration.MigrationContext.","commit_id":"54740383e350fc8a76ef303c410f8d31db4adf67"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"c9a7412c048cf07be178d0796fb9cea09f0dfc1c","unresolved":false,"context_lines":[{"line_number":31,"context_line":"import sqlalchemy as sa"},{"line_number":32,"context_line":""},{"line_number":33,"context_line":""},{"line_number":34,"context_line":"ports \u003d sa.Table("},{"line_number":35,"context_line":"    \u0027ports\u0027, sa.MetaData(),"},{"line_number":36,"context_line":"    sa.Column(\u0027id\u0027, sa.String(length\u003d36), nullable\u003dFalse),"},{"line_number":37,"context_line":"    sa.Column(\u0027dns_name\u0027, sa.String(length\u003ddns.FQDN_MAX_LEN), nullable\u003dTrue))"}],"source_content_type":"text/x-python","patch_set":26,"id":"7aa08908_d99e6b06","line":34,"range":{"start_line":34,"start_character":0,"end_line":34,"end_character":16},"in_reply_to":"7aa08908_6857b126","updated":"2016-06-16 19:13:06.000000000","message":"I thought that would be the answer.  :(  Oh well, it was worth asking about.","commit_id":"54740383e350fc8a76ef303c410f8d31db4adf67"},{"author":{"_account_id":4694,"name":"Miguel Lavalle","email":"miguel@mlavalle.com","username":"minsel"},"change_message_id":"c7025884538aa75775f9324844a7be6e654a1c3d","unresolved":false,"context_lines":[{"line_number":31,"context_line":"import sqlalchemy as sa"},{"line_number":32,"context_line":""},{"line_number":33,"context_line":""},{"line_number":34,"context_line":"ports \u003d sa.Table("},{"line_number":35,"context_line":"    \u0027ports\u0027, sa.MetaData(),"},{"line_number":36,"context_line":"    sa.Column(\u0027id\u0027, sa.String(length\u003d36), nullable\u003dFalse),"},{"line_number":37,"context_line":"    sa.Column(\u0027dns_name\u0027, sa.String(length\u003ddns.FQDN_MAX_LEN), nullable\u003dTrue))"}],"source_content_type":"text/x-python","patch_set":26,"id":"7aa08908_639ed664","line":34,"range":{"start_line":34,"start_character":0,"end_line":34,"end_character":16},"in_reply_to":"7aa08908_cdf0ac94","updated":"2016-06-15 23:41:15.000000000","message":"I pinged Henry but didn\u0027t hear back from him. So my advice is to look at the alembic documentation (mentioned above). Also, go through the scripts in neutron/db/migration/alembic_migrations and neutron/db/migration/alembic_migrations/versions/\u003cliberty, mitaka, newton\u003e and see if we find an example of what Carl is asking for. Good luck","commit_id":"54740383e350fc8a76ef303c410f8d31db4adf67"},{"author":{"_account_id":20671,"name":"bin","email":"froyo.bin@gmail.com","username":"binyu"},"change_message_id":"14969224b5e9cb5c5729588ec1e249180b9be085","unresolved":false,"context_lines":[{"line_number":31,"context_line":"import sqlalchemy as sa"},{"line_number":32,"context_line":""},{"line_number":33,"context_line":""},{"line_number":34,"context_line":"ports \u003d sa.Table("},{"line_number":35,"context_line":"    \u0027ports\u0027, sa.MetaData(),"},{"line_number":36,"context_line":"    sa.Column(\u0027id\u0027, sa.String(length\u003d36), nullable\u003dFalse),"},{"line_number":37,"context_line":"    sa.Column(\u0027dns_name\u0027, sa.String(length\u003ddns.FQDN_MAX_LEN), nullable\u003dTrue))"}],"source_content_type":"text/x-python","patch_set":26,"id":"7aa08908_5e7373b4","line":34,"range":{"start_line":34,"start_character":0,"end_line":34,"end_character":16},"in_reply_to":"7aa08908_d99e6b06","updated":"2016-06-17 08:35:27.000000000","message":"Thank you for your discussion! I learned a lot!","commit_id":"54740383e350fc8a76ef303c410f8d31db4adf67"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"75539bcc665eeae1c43ef19721819cc09aaee83f","unresolved":false,"context_lines":[{"line_number":71,"context_line":""},{"line_number":72,"context_line":""},{"line_number":73,"context_line":"def upgrade():"},{"line_number":74,"context_line":"    migrate_records_for_existing()"},{"line_number":75,"context_line":"    op.drop_column(\u0027ports\u0027, \u0027dns_name\u0027)"}],"source_content_type":"text/x-python","patch_set":26,"id":"7aa08908_a9274dc8","line":74,"range":{"start_line":74,"start_character":4,"end_line":74,"end_character":32},"updated":"2016-06-14 17:34:45.000000000","message":"I expected this in the expand migration.  Remember that contract migrations, in the future, will be run much later than expand migrations (either offline or a whole release cycle later).  The new code should be able to run as soon as an expand migration has been run.  Since the new code will need this data migrated already...","commit_id":"54740383e350fc8a76ef303c410f8d31db4adf67"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"38c179cb880264a1862a753ac2163d91d3738777","unresolved":false,"context_lines":[{"line_number":71,"context_line":""},{"line_number":72,"context_line":""},{"line_number":73,"context_line":"def upgrade():"},{"line_number":74,"context_line":"    migrate_records_for_existing()"},{"line_number":75,"context_line":"    op.drop_column(\u0027ports\u0027, \u0027dns_name\u0027)"}],"source_content_type":"text/x-python","patch_set":26,"id":"7aa08908_a417f252","line":74,"range":{"start_line":74,"start_character":4,"end_line":74,"end_character":32},"in_reply_to":"7aa08908_64934afb","updated":"2016-06-16 19:44:27.000000000","message":"Right, sorry.  This should stay in the contract script for Newton because the expand script can be run while the old server is still running.","commit_id":"54740383e350fc8a76ef303c410f8d31db4adf67"},{"author":{"_account_id":4694,"name":"Miguel Lavalle","email":"miguel@mlavalle.com","username":"minsel"},"change_message_id":"833d5b5cf200a158ef4f445ffda17b119c393e67","unresolved":false,"context_lines":[{"line_number":71,"context_line":""},{"line_number":72,"context_line":""},{"line_number":73,"context_line":"def upgrade():"},{"line_number":74,"context_line":"    migrate_records_for_existing()"},{"line_number":75,"context_line":"    op.drop_column(\u0027ports\u0027, \u0027dns_name\u0027)"}],"source_content_type":"text/x-python","patch_set":26,"id":"7aa08908_b2a81f79","line":74,"range":{"start_line":74,"start_character":4,"end_line":74,"end_character":32},"in_reply_to":"7aa08908_a9274dc8","updated":"2016-06-15 16:10:20.000000000","message":"I didn\u0027t know this. Learned!","commit_id":"54740383e350fc8a76ef303c410f8d31db4adf67"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"fbb4ce771fb6fb762e017f7e7b0bf0edd8d90b81","unresolved":false,"context_lines":[{"line_number":71,"context_line":""},{"line_number":72,"context_line":""},{"line_number":73,"context_line":"def upgrade():"},{"line_number":74,"context_line":"    migrate_records_for_existing()"},{"line_number":75,"context_line":"    op.drop_column(\u0027ports\u0027, \u0027dns_name\u0027)"}],"source_content_type":"text/x-python","patch_set":26,"id":"7aa08908_64934afb","line":74,"range":{"start_line":74,"start_character":4,"end_line":74,"end_character":32},"in_reply_to":"7aa08908_b2a81f79","updated":"2016-06-16 19:41:13.000000000","message":"Actually, I\u0027m not totally sure about this for the Newton release.  I\u0027m reading the current upgrade strategy [1] and things aren\u0027t clear.  Contract might be the right thing to do.\n\n [1] http://docs.openstack.org/developer/neutron/devref/upgrade.html","commit_id":"54740383e350fc8a76ef303c410f8d31db4adf67"},{"author":{"_account_id":6524,"name":"Henry Gessau","email":"HenryG@gessau.net","username":"gessau"},"change_message_id":"8960fb2a4e0168cdb848f24dca7d29ee152e8093","unresolved":false,"context_lines":[{"line_number":17,"context_line":""},{"line_number":18,"context_line":"# revision identifiers, used by Alembic."},{"line_number":19,"context_line":"revision \u003d \u0027a84ccf28f06a\u0027"},{"line_number":20,"context_line":"down_revision \u003d \u00274bcd4df1f426\u0027"},{"line_number":21,"context_line":"depends_on \u003d (\u0027a963b38d82f4\u0027,)"},{"line_number":22,"context_line":""},{"line_number":23,"context_line":"from alembic import op"}],"source_content_type":"text/x-python","patch_set":33,"id":"dada55a8_39003f01","line":20,"updated":"2016-07-26 01:46:30.000000000","message":"This looks wrong. The current contract head is b67e765a3524.","commit_id":"0f782faf6caf532c95de75e19b20d59992b4fbc1"},{"author":{"_account_id":20671,"name":"bin","email":"froyo.bin@gmail.com","username":"binyu"},"change_message_id":"93fbe1ee797f23aaba026f5713985f76c77c1c4b","unresolved":false,"context_lines":[{"line_number":17,"context_line":""},{"line_number":18,"context_line":"# revision identifiers, used by Alembic."},{"line_number":19,"context_line":"revision \u003d \u0027a84ccf28f06a\u0027"},{"line_number":20,"context_line":"down_revision \u003d \u00274bcd4df1f426\u0027"},{"line_number":21,"context_line":"depends_on \u003d (\u0027a963b38d82f4\u0027,)"},{"line_number":22,"context_line":""},{"line_number":23,"context_line":"from alembic import op"}],"source_content_type":"text/x-python","patch_set":33,"id":"dada55a8_d821144f","line":20,"in_reply_to":"dada55a8_39003f01","updated":"2016-07-26 07:37:37.000000000","message":"Thanks, the old head is out of date, I have update the head.","commit_id":"0f782faf6caf532c95de75e19b20d59992b4fbc1"}],"neutron/db/migration/alembic_migrations/versions/newton/expand/a963b38d82f4_add_dns_name_to_portdnses.py":[{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"75539bcc665eeae1c43ef19721819cc09aaee83f","unresolved":false,"context_lines":[{"line_number":15,"context_line":""},{"line_number":16,"context_line":"\"\"\"add dns name to portdnses"},{"line_number":17,"context_line":""},{"line_number":18,"context_line":"Revision ID: a963b38d82f4"},{"line_number":19,"context_line":"Revises: 30107ab6a3ee"},{"line_number":20,"context_line":"Create Date: 2016-06-07 09:50:52.825196"},{"line_number":21,"context_line":""},{"line_number":22,"context_line":"\"\"\""},{"line_number":23,"context_line":""}],"source_content_type":"text/x-python","patch_set":26,"id":"7aa08908_b4d04420","line":20,"range":{"start_line":18,"start_character":0,"end_line":20,"end_character":39},"updated":"2016-06-14 17:34:45.000000000","message":"Consider removing","commit_id":"54740383e350fc8a76ef303c410f8d31db4adf67"},{"author":{"_account_id":20671,"name":"bin","email":"froyo.bin@gmail.com","username":"binyu"},"change_message_id":"14969224b5e9cb5c5729588ec1e249180b9be085","unresolved":false,"context_lines":[{"line_number":15,"context_line":""},{"line_number":16,"context_line":"\"\"\"add dns name to portdnses"},{"line_number":17,"context_line":""},{"line_number":18,"context_line":"Revision ID: a963b38d82f4"},{"line_number":19,"context_line":"Revises: 30107ab6a3ee"},{"line_number":20,"context_line":"Create Date: 2016-06-07 09:50:52.825196"},{"line_number":21,"context_line":""},{"line_number":22,"context_line":"\"\"\""},{"line_number":23,"context_line":""}],"source_content_type":"text/x-python","patch_set":26,"id":"7aa08908_9106de83","line":20,"range":{"start_line":18,"start_character":0,"end_line":20,"end_character":39},"in_reply_to":"7aa08908_b4d04420","updated":"2016-06-17 08:35:27.000000000","message":"Done","commit_id":"54740383e350fc8a76ef303c410f8d31db4adf67"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"75539bcc665eeae1c43ef19721819cc09aaee83f","unresolved":false,"context_lines":[{"line_number":31,"context_line":""},{"line_number":32,"context_line":"def upgrade():"},{"line_number":33,"context_line":"    op.add_column(\u0027portdnses\u0027,"},{"line_number":34,"context_line":"                  sa.Column(\u0027dns_name\u0027, sa.String(length\u003d255), nullable\u003dFalse))"}],"source_content_type":"text/x-python","patch_set":26,"id":"7aa08908_348a941b","line":34,"updated":"2016-06-14 17:34:45.000000000","message":"This need column will need to be populated with data right away.  See my notes in the contract migration.","commit_id":"54740383e350fc8a76ef303c410f8d31db4adf67"},{"author":{"_account_id":20671,"name":"bin","email":"froyo.bin@gmail.com","username":"binyu"},"change_message_id":"14969224b5e9cb5c5729588ec1e249180b9be085","unresolved":false,"context_lines":[{"line_number":31,"context_line":""},{"line_number":32,"context_line":"def upgrade():"},{"line_number":33,"context_line":"    op.add_column(\u0027portdnses\u0027,"},{"line_number":34,"context_line":"                  sa.Column(\u0027dns_name\u0027, sa.String(length\u003d255), nullable\u003dFalse))"}],"source_content_type":"text/x-python","patch_set":26,"id":"7aa08908_51ed96b6","line":34,"in_reply_to":"7aa08908_348a941b","updated":"2016-06-17 08:35:27.000000000","message":"Done","commit_id":"54740383e350fc8a76ef303c410f8d31db4adf67"}],"neutron/plugins/ml2/extensions/dns_integration.py":[{"author":{"_account_id":4694,"name":"Miguel Lavalle","email":"miguel@mlavalle.com","username":"minsel"},"change_message_id":"cc733dc34f1a8b345807d0fd696aaa44bfa8d28c","unresolved":false,"context_lines":[{"line_number":77,"context_line":"    def process_create_port(self, plugin_context, request_data, db_data):"},{"line_number":78,"context_line":"        if not request_data[dns.DNSNAME]:"},{"line_number":79,"context_line":"            return"},{"line_number":80,"context_line":"        network \u003d self._get_network(plugin_context, db_data[\u0027network_id\u0027])"},{"line_number":81,"context_line":"        if not network[dns.DNSDOMAIN]:"},{"line_number":82,"context_line":"            return"},{"line_number":83,"context_line":"        if self.external_dns_not_needed(plugin_context, network):"}],"source_content_type":"text/x-python","patch_set":5,"id":"dab17558_1bc01ae0","line":80,"updated":"2016-05-12 22:30:59.000000000","message":"In the previous implementation, dns_name has already been processed when you reached this point. Now, you have to create something in the DB (in a PortDNS row) that allows you to store the dns_domain and at the same time indicate to _create_port_in_external_dns_service (line 258) whether it has to send something to the external DNS service. Before this change, _create_port_in_external_dns_service made that decision only based on whether the external dns driver was loaded and there was a row in PortDNS for the port. That is not sufficient anymore, because there may be a row for the port in PortDNS even if the network doesn\u0027t have a dns_domain attribute. How are you going to handle that?","commit_id":"83fa9dc0cf4489b781b206408ff8e144c84e9224"},{"author":{"_account_id":4694,"name":"Miguel Lavalle","email":"miguel@mlavalle.com","username":"minsel"},"change_message_id":"cc733dc34f1a8b345807d0fd696aaa44bfa8d28c","unresolved":false,"context_lines":[{"line_number":91,"context_line":"            previous_dns_name\u003d\u0027\u0027, previous_dns_domain\u003d\u0027\u0027))"},{"line_number":92,"context_line":""},{"line_number":93,"context_line":"    def process_update_port(self, plugin_context, request_data, db_data):"},{"line_number":94,"context_line":"        dns_name \u003d request_data.get(dns.DNSNAME)"},{"line_number":95,"context_line":"        has_fixed_ips \u003d \u0027fixed_ips\u0027 in request_data"},{"line_number":96,"context_line":"        if dns_name is None and not has_fixed_ips:"},{"line_number":97,"context_line":"            return"}],"source_content_type":"text/x-python","patch_set":5,"id":"dab17558_3b319ded","line":94,"updated":"2016-05-12 22:30:59.000000000","message":"Please see my comment to line 80. Something similar applies here. What happens if only the port\u0027s \u0027dns_name\" is updated?","commit_id":"83fa9dc0cf4489b781b206408ff8e144c84e9224"},{"author":{"_account_id":4694,"name":"Miguel Lavalle","email":"miguel@mlavalle.com","username":"minsel"},"change_message_id":"cc733dc34f1a8b345807d0fd696aaa44bfa8d28c","unresolved":false,"context_lines":[{"line_number":143,"context_line":"        return response_data"},{"line_number":144,"context_line":""},{"line_number":145,"context_line":"    def _get_dns_names_for_port(self, ips, dns_port_db\u003dNone):"},{"line_number":146,"context_line":"        dns_assignment \u003d []"},{"line_number":147,"context_line":"        if dns_port_db:"},{"line_number":148,"context_line":"            dns_domain \u003d dns_port_db.current_dns_domain"},{"line_number":149,"context_line":"            dnsname \u003d dns_port_db.current_dns_name"}],"source_content_type":"text/x-python","patch_set":5,"id":"dab17558_db98516d","line":146,"updated":"2016-05-12 22:30:59.000000000","message":"I don\u0027t see that you are using the _get_dns_domain or the _get_request_dns_name methods here. They help you to decide whether the dns_name attribute in the request should be used or not when computing the dns assignment for the port. If the dns_domain parameter in neutron.conf is equal to its default value (\u0027openstacklocal\u0027), then you don\u0027t use the value in the port\u0027s dns_name attribute to calculate dns_assignment. Please see here: http://paste.openstack.org/show/496993/","commit_id":"83fa9dc0cf4489b781b206408ff8e144c84e9224"},{"author":{"_account_id":4694,"name":"Miguel Lavalle","email":"miguel@mlavalle.com","username":"minsel"},"change_message_id":"00f688dbff924aa400efd8936dce38342fc95318","unresolved":false,"context_lines":[{"line_number":143,"context_line":"        return response_data"},{"line_number":144,"context_line":""},{"line_number":145,"context_line":"    def _get_dns_names_for_port(self, ips, dns_port_db\u003dNone):"},{"line_number":146,"context_line":"        dns_assignment \u003d []"},{"line_number":147,"context_line":"        if dns_port_db:"},{"line_number":148,"context_line":"            dns_domain \u003d dns_port_db.current_dns_domain"},{"line_number":149,"context_line":"            dnsname \u003d dns_port_db.current_dns_name"}],"source_content_type":"text/x-python","patch_set":5,"id":"dab17558_6fba3bc2","line":146,"in_reply_to":"dab17558_db98516d","updated":"2016-05-13 00:35:38.000000000","message":"We should generate a host-\u003cip_address\u003e type of dns_assignment when either:\n\n1) The port request doesn\u0027t contain a dns_name attribute or\n2) Even if the request contains a dns_name attribute, the value of dns_domain in neutron.conf is the default: \u0027openstacklocal\u0027","commit_id":"83fa9dc0cf4489b781b206408ff8e144c84e9224"},{"author":{"_account_id":4694,"name":"Miguel Lavalle","email":"miguel@mlavalle.com","username":"minsel"},"change_message_id":"cc733dc34f1a8b345807d0fd696aaa44bfa8d28c","unresolved":false,"context_lines":[{"line_number":167,"context_line":"            port_id\u003ddb_data[\u0027id\u0027]).one_or_none()"},{"line_number":168,"context_line":"        if dns_data_db:"},{"line_number":169,"context_line":"            response_data[dns.DNSNAME] \u003d dns_data_db[\u0027current_dns_name\u0027]"},{"line_number":170,"context_line":"            response_data[\u0027dns_assignment\u0027] \u003d \\"},{"line_number":171,"context_line":"                self._get_dns_name_for_port_get(db_data, dns_data_db)"},{"line_number":172,"context_line":"        else:"},{"line_number":173,"context_line":"            response_data[dns.DNSNAME] \u003d \u0027\u0027"}],"source_content_type":"text/x-python","patch_set":5,"id":"dab17558_81bae66c","line":170,"updated":"2016-05-12 22:30:59.000000000","message":"We don\u0027t use \u0027\\\u0027 to continue lines. Please use parenthesis to continue lines. An example is line 112 above","commit_id":"83fa9dc0cf4489b781b206408ff8e144c84e9224"},{"author":{"_account_id":4694,"name":"Miguel Lavalle","email":"miguel@mlavalle.com","username":"minsel"},"change_message_id":"cc733dc34f1a8b345807d0fd696aaa44bfa8d28c","unresolved":false,"context_lines":[{"line_number":171,"context_line":"                self._get_dns_name_for_port_get(db_data, dns_data_db)"},{"line_number":172,"context_line":"        else:"},{"line_number":173,"context_line":"            response_data[dns.DNSNAME] \u003d \u0027\u0027"},{"line_number":174,"context_line":"            response_data[\u0027dns_assignment\u0027] \u003d \\"},{"line_number":175,"context_line":"                self._get_dns_name_for_port_get(db_data, dns_data_db)"},{"line_number":176,"context_line":""},{"line_number":177,"context_line":"        return response_data"}],"source_content_type":"text/x-python","patch_set":5,"id":"dab17558_e1af7229","line":174,"updated":"2016-05-12 22:30:59.000000000","message":"We don\u0027t use \u0027\\\u0027 to continue lines. Please use parenthesis to continue lines. An example is line 112 above","commit_id":"83fa9dc0cf4489b781b206408ff8e144c84e9224"},{"author":{"_account_id":4694,"name":"Miguel Lavalle","email":"miguel@mlavalle.com","username":"minsel"},"change_message_id":"cc733dc34f1a8b345807d0fd696aaa44bfa8d28c","unresolved":false,"context_lines":[{"line_number":263,"context_line":"    port \u003d kwargs[\u0027port\u0027]"},{"line_number":264,"context_line":"    dns_data_db \u003d context.session.query(dns_db.PortDNS).filter_by("},{"line_number":265,"context_line":"        port_id\u003dport[\u0027id\u0027]).one_or_none()"},{"line_number":266,"context_line":"    if not dns_data_db:"},{"line_number":267,"context_line":"        return"},{"line_number":268,"context_line":"    records \u003d [ip[\u0027ip_address\u0027] for ip in port[\u0027fixed_ips\u0027]]"},{"line_number":269,"context_line":"    _send_data_to_external_dns_service(context, dns_driver,"}],"source_content_type":"text/x-python","patch_set":5,"id":"dab17558_7b784590","line":266,"updated":"2016-05-12 22:30:59.000000000","message":"This condition is not sufficient now to decide whether a record should be created in the external dns service, because there can be a PortDNS row for the port even if the network doesn\u0027t have a dns_domain","commit_id":"83fa9dc0cf4489b781b206408ff8e144c84e9224"},{"author":{"_account_id":4694,"name":"Miguel Lavalle","email":"miguel@mlavalle.com","username":"minsel"},"change_message_id":"9e9216d7ce90b9d8f0d176bb8a8d755c3455ddb9","unresolved":false,"context_lines":[{"line_number":76,"context_line":"            db_data[dns.DNSDOMAIN] \u003d new_value"},{"line_number":77,"context_line":""},{"line_number":78,"context_line":"    def process_create_port(self, plugin_context, request_data, db_data):"},{"line_number":79,"context_line":"        update_dns \u003d True"},{"line_number":80,"context_line":"        if not request_data[dns.DNSNAME]:"},{"line_number":81,"context_line":"            return"},{"line_number":82,"context_line":"        network \u003d self._get_network(plugin_context, db_data[\u0027network_id\u0027])"}],"source_content_type":"text/x-python","patch_set":9,"id":"bab6814e_c06aceb2","line":79,"updated":"2016-05-19 23:53:33.000000000","message":"I think we are getting in a lot of trouble with the \u0027update_dns\u0027 column in the \u0027portdnses\u0027 table. It will be much easier if instead we add a \u0027dns_name\u0027 column to that table. That way, we control the behavior of _create_port_in_external_dns_service, _update_port_in_external_dns_service and _delete_port_in_external_dns_service with current_dns_name, current_dns_domain, previous_dns_name and previous_dns_domain, the way we do currently. dns_name will be used of internal dns purposes and will be copied to current_dns_name if we conclude that we need to send data to the external dns service","commit_id":"9ff8f55a6b1ed95f6629f85d9580a32b131e6d83"},{"author":{"_account_id":20671,"name":"bin","email":"froyo.bin@gmail.com","username":"binyu"},"change_message_id":"320bb0cc26428ac47b0aee06a1a9f0fafe5da3ca","unresolved":false,"context_lines":[{"line_number":76,"context_line":"            db_data[dns.DNSDOMAIN] \u003d new_value"},{"line_number":77,"context_line":""},{"line_number":78,"context_line":"    def process_create_port(self, plugin_context, request_data, db_data):"},{"line_number":79,"context_line":"        update_dns \u003d True"},{"line_number":80,"context_line":"        if not request_data[dns.DNSNAME]:"},{"line_number":81,"context_line":"            return"},{"line_number":82,"context_line":"        network \u003d self._get_network(plugin_context, db_data[\u0027network_id\u0027])"}],"source_content_type":"text/x-python","patch_set":9,"id":"bab6814e_15336ef7","line":79,"in_reply_to":"bab6814e_c06aceb2","updated":"2016-05-20 08:04:35.000000000","message":"Done","commit_id":"9ff8f55a6b1ed95f6629f85d9580a32b131e6d83"},{"author":{"_account_id":4694,"name":"Miguel Lavalle","email":"miguel@mlavalle.com","username":"minsel"},"change_message_id":"9e9216d7ce90b9d8f0d176bb8a8d755c3455ddb9","unresolved":false,"context_lines":[{"line_number":80,"context_line":"        if not request_data[dns.DNSNAME]:"},{"line_number":81,"context_line":"            return"},{"line_number":82,"context_line":"        network \u003d self._get_network(plugin_context, db_data[\u0027network_id\u0027])"},{"line_number":83,"context_line":"        if self.external_dns_not_needed(plugin_context, network):"},{"line_number":84,"context_line":"            update_dns \u003d False"},{"line_number":85,"context_line":"        current_dns_name \u003d request_data[dns.DNSNAME]"},{"line_number":86,"context_line":"        current_dns_domain \u003d network[dns.DNSDOMAIN]"},{"line_number":87,"context_line":"        if not current_dns_domain:"},{"line_number":88,"context_line":"            update_dns \u003d False"},{"line_number":89,"context_line":"        plugin_context.session.add(dns_db.PortDNS("},{"line_number":90,"context_line":"            port_id\u003ddb_data[\u0027id\u0027],"},{"line_number":91,"context_line":"            current_dns_name\u003dcurrent_dns_name,"},{"line_number":92,"context_line":"            current_dns_domain\u003dcurrent_dns_domain,"},{"line_number":93,"context_line":"            previous_dns_name\u003d\u0027\u0027, previous_dns_domain\u003d\u0027\u0027,"},{"line_number":94,"context_line":"            update_dns\u003dupdate_dns))"},{"line_number":95,"context_line":""},{"line_number":96,"context_line":"    def update_dns_db(self, dns_name, dns_domain, db_data,"},{"line_number":97,"context_line":"                      plugin_context, has_fixed_ips, update_dns\u003dFalse):"}],"source_content_type":"text/x-python","patch_set":9,"id":"bab6814e_20675a4e","line":94,"range":{"start_line":83,"start_character":0,"end_line":94,"end_character":35},"updated":"2016-05-19 23:53:33.000000000","message":"If we do what I recommend in my comment to line 79, in line 83 we know that at least dns_name came in the request. So we definitely need to crate a row in table portdnses. Therefore I would implement replace the highlighted lines with:\n\nif self.external_dns_not_needed(plugin_context, network) or not network[dns.DNSDOMAIN]:\n    current_dns_name \u003d \u0027\u0027\n    current_dns_name \u003d \u0027\u0027\nelse:\n    current_dns_name \u003d request_data[dns.DNSNAME]\n    current_dns_domain \u003d network[dns.DNSDOMAIN]\nplugin_context.session.add(dns_db.PortDNS(\n    port_id\u003ddb_data[\u0027id\u0027],\n    dns_name\u003drequest_data[dns.DNSNAME],\n    current_dns_name\u003dcurrent_dns_name,\n    current_dns_domain\u003dcurrent_dns_domain,\n    previous_dns_name\u003d\u0027\u0027, previous_dns_domain\u003d\u0027\u0027))","commit_id":"9ff8f55a6b1ed95f6629f85d9580a32b131e6d83"},{"author":{"_account_id":20671,"name":"bin","email":"froyo.bin@gmail.com","username":"binyu"},"change_message_id":"320bb0cc26428ac47b0aee06a1a9f0fafe5da3ca","unresolved":false,"context_lines":[{"line_number":80,"context_line":"        if not request_data[dns.DNSNAME]:"},{"line_number":81,"context_line":"            return"},{"line_number":82,"context_line":"        network \u003d self._get_network(plugin_context, db_data[\u0027network_id\u0027])"},{"line_number":83,"context_line":"        if self.external_dns_not_needed(plugin_context, network):"},{"line_number":84,"context_line":"            update_dns \u003d False"},{"line_number":85,"context_line":"        current_dns_name \u003d request_data[dns.DNSNAME]"},{"line_number":86,"context_line":"        current_dns_domain \u003d network[dns.DNSDOMAIN]"},{"line_number":87,"context_line":"        if not current_dns_domain:"},{"line_number":88,"context_line":"            update_dns \u003d False"},{"line_number":89,"context_line":"        plugin_context.session.add(dns_db.PortDNS("},{"line_number":90,"context_line":"            port_id\u003ddb_data[\u0027id\u0027],"},{"line_number":91,"context_line":"            current_dns_name\u003dcurrent_dns_name,"},{"line_number":92,"context_line":"            current_dns_domain\u003dcurrent_dns_domain,"},{"line_number":93,"context_line":"            previous_dns_name\u003d\u0027\u0027, previous_dns_domain\u003d\u0027\u0027,"},{"line_number":94,"context_line":"            update_dns\u003dupdate_dns))"},{"line_number":95,"context_line":""},{"line_number":96,"context_line":"    def update_dns_db(self, dns_name, dns_domain, db_data,"},{"line_number":97,"context_line":"                      plugin_context, has_fixed_ips, update_dns\u003dFalse):"}],"source_content_type":"text/x-python","patch_set":9,"id":"bab6814e_95559efb","line":94,"range":{"start_line":83,"start_character":0,"end_line":94,"end_character":35},"in_reply_to":"bab6814e_20675a4e","updated":"2016-05-20 08:04:35.000000000","message":"Done","commit_id":"9ff8f55a6b1ed95f6629f85d9580a32b131e6d83"},{"author":{"_account_id":4694,"name":"Miguel Lavalle","email":"miguel@mlavalle.com","username":"minsel"},"change_message_id":"9e9216d7ce90b9d8f0d176bb8a8d755c3455ddb9","unresolved":false,"context_lines":[{"line_number":124,"context_line":"                previous_dns_name\u003d\u0027\u0027, previous_dns_domain\u003d\u0027\u0027,"},{"line_number":125,"context_line":"                update_dns\u003dupdate_dns))"},{"line_number":126,"context_line":""},{"line_number":127,"context_line":"    def process_update_port(self, plugin_context, request_data, db_data):"},{"line_number":128,"context_line":"        dns_name \u003d request_data.get(dns.DNSNAME)"},{"line_number":129,"context_line":"        has_fixed_ips \u003d \u0027fixed_ips\u0027 in request_data"},{"line_number":130,"context_line":"        update_dns \u003d True"}],"source_content_type":"text/x-python","patch_set":9,"id":"bab6814e_064d0ec4","line":127,"updated":"2016-05-19 23:53:33.000000000","message":"In general, let\u0027s adjust this method under the assumption that we have a dns_name column in portdnses and that we control the behavior of _update_port_in_external_dns_service with current_dns_name, current_dns_domain, previous_dns_name, previous_dns_domain. Similar to what I propose for process_create_port and _create_port_in_external_dns_service","commit_id":"9ff8f55a6b1ed95f6629f85d9580a32b131e6d83"},{"author":{"_account_id":20671,"name":"bin","email":"froyo.bin@gmail.com","username":"binyu"},"change_message_id":"320bb0cc26428ac47b0aee06a1a9f0fafe5da3ca","unresolved":false,"context_lines":[{"line_number":124,"context_line":"                previous_dns_name\u003d\u0027\u0027, previous_dns_domain\u003d\u0027\u0027,"},{"line_number":125,"context_line":"                update_dns\u003dupdate_dns))"},{"line_number":126,"context_line":""},{"line_number":127,"context_line":"    def process_update_port(self, plugin_context, request_data, db_data):"},{"line_number":128,"context_line":"        dns_name \u003d request_data.get(dns.DNSNAME)"},{"line_number":129,"context_line":"        has_fixed_ips \u003d \u0027fixed_ips\u0027 in request_data"},{"line_number":130,"context_line":"        update_dns \u003d True"}],"source_content_type":"text/x-python","patch_set":9,"id":"bab6814e_b5aee2e3","line":127,"in_reply_to":"bab6814e_064d0ec4","updated":"2016-05-20 08:04:35.000000000","message":"Done","commit_id":"9ff8f55a6b1ed95f6629f85d9580a32b131e6d83"},{"author":{"_account_id":4694,"name":"Miguel Lavalle","email":"miguel@mlavalle.com","username":"minsel"},"change_message_id":"9e9216d7ce90b9d8f0d176bb8a8d755c3455ddb9","unresolved":false,"context_lines":[{"line_number":167,"context_line":"            return cfg.CONF.dns_domain"},{"line_number":168,"context_line":"        return \u0027%s.\u0027 % cfg.CONF.dns_domain"},{"line_number":169,"context_line":""},{"line_number":170,"context_line":"    def _get_request_dns_name(self, dns_port_db\u003dNone):"},{"line_number":171,"context_line":"        dns_domain \u003d self._get_dns_domain()"},{"line_number":172,"context_line":"        if ((dns_domain and dns_domain !\u003d DNS_DOMAIN_DEFAULT)):"},{"line_number":173,"context_line":"            if dns_port_db is not None:"}],"source_content_type":"text/x-python","patch_set":9,"id":"bab6814e_46eb9613","line":170,"range":{"start_line":170,"start_character":36,"end_line":170,"end_character":47},"updated":"2016-05-19 23:53:33.000000000","message":"I think this should be dns_data_db","commit_id":"9ff8f55a6b1ed95f6629f85d9580a32b131e6d83"},{"author":{"_account_id":20671,"name":"bin","email":"froyo.bin@gmail.com","username":"binyu"},"change_message_id":"320bb0cc26428ac47b0aee06a1a9f0fafe5da3ca","unresolved":false,"context_lines":[{"line_number":167,"context_line":"            return cfg.CONF.dns_domain"},{"line_number":168,"context_line":"        return \u0027%s.\u0027 % cfg.CONF.dns_domain"},{"line_number":169,"context_line":""},{"line_number":170,"context_line":"    def _get_request_dns_name(self, dns_port_db\u003dNone):"},{"line_number":171,"context_line":"        dns_domain \u003d self._get_dns_domain()"},{"line_number":172,"context_line":"        if ((dns_domain and dns_domain !\u003d DNS_DOMAIN_DEFAULT)):"},{"line_number":173,"context_line":"            if dns_port_db is not None:"}],"source_content_type":"text/x-python","patch_set":9,"id":"bab6814e_d598c6c2","line":170,"range":{"start_line":170,"start_character":36,"end_line":170,"end_character":47},"in_reply_to":"bab6814e_46eb9613","updated":"2016-05-20 08:04:35.000000000","message":"Done","commit_id":"9ff8f55a6b1ed95f6629f85d9580a32b131e6d83"},{"author":{"_account_id":4694,"name":"Miguel Lavalle","email":"miguel@mlavalle.com","username":"minsel"},"change_message_id":"9e9216d7ce90b9d8f0d176bb8a8d755c3455ddb9","unresolved":false,"context_lines":[{"line_number":169,"context_line":""},{"line_number":170,"context_line":"    def _get_request_dns_name(self, dns_port_db\u003dNone):"},{"line_number":171,"context_line":"        dns_domain \u003d self._get_dns_domain()"},{"line_number":172,"context_line":"        if ((dns_domain and dns_domain !\u003d DNS_DOMAIN_DEFAULT)):"},{"line_number":173,"context_line":"            if dns_port_db is not None:"},{"line_number":174,"context_line":"                dns_name \u003d dns_port_db.current_dns_name"},{"line_number":175,"context_line":"            else:"},{"line_number":176,"context_line":"                dns_name \u003d None"},{"line_number":177,"context_line":"        else:"},{"line_number":178,"context_line":"            dns_name \u003d None"},{"line_number":179,"context_line":"        return dns_name, dns_domain"},{"line_number":180,"context_line":""},{"line_number":181,"context_line":"    def _get_dns_names_for_port(self, ips, dns_port_db\u003dNone):"}],"source_content_type":"text/x-python","patch_set":9,"id":"bab6814e_06022eb4","line":178,"range":{"start_line":172,"start_character":8,"end_line":178,"end_character":27},"updated":"2016-05-19 23:53:33.000000000","message":"I think we can simplify this nd make it more readable as follows:\n\ndns_name \u003d \u0027\u0027\nif ((dns_domain and dns_domain !\u003d DNS_DOMAIN_DEFAULT)):\n    if dns_data_db:\n        dns_name \u003d dns_data_db.current_dns_name\n\nNote that I am using \u0027\u0027 as the default value for dns_name. This is the default value for it in the API (same for dns_domain). So let\u0027s stick to it","commit_id":"9ff8f55a6b1ed95f6629f85d9580a32b131e6d83"},{"author":{"_account_id":20671,"name":"bin","email":"froyo.bin@gmail.com","username":"binyu"},"change_message_id":"320bb0cc26428ac47b0aee06a1a9f0fafe5da3ca","unresolved":false,"context_lines":[{"line_number":169,"context_line":""},{"line_number":170,"context_line":"    def _get_request_dns_name(self, dns_port_db\u003dNone):"},{"line_number":171,"context_line":"        dns_domain \u003d self._get_dns_domain()"},{"line_number":172,"context_line":"        if ((dns_domain and dns_domain !\u003d DNS_DOMAIN_DEFAULT)):"},{"line_number":173,"context_line":"            if dns_port_db is not None:"},{"line_number":174,"context_line":"                dns_name \u003d dns_port_db.current_dns_name"},{"line_number":175,"context_line":"            else:"},{"line_number":176,"context_line":"                dns_name \u003d None"},{"line_number":177,"context_line":"        else:"},{"line_number":178,"context_line":"            dns_name \u003d None"},{"line_number":179,"context_line":"        return dns_name, dns_domain"},{"line_number":180,"context_line":""},{"line_number":181,"context_line":"    def _get_dns_names_for_port(self, ips, dns_port_db\u003dNone):"}],"source_content_type":"text/x-python","patch_set":9,"id":"bab6814e_15bd2e02","line":178,"range":{"start_line":172,"start_character":8,"end_line":178,"end_character":27},"in_reply_to":"bab6814e_06022eb4","updated":"2016-05-20 08:04:35.000000000","message":"Done","commit_id":"9ff8f55a6b1ed95f6629f85d9580a32b131e6d83"},{"author":{"_account_id":4694,"name":"Miguel Lavalle","email":"miguel@mlavalle.com","username":"minsel"},"change_message_id":"9e9216d7ce90b9d8f0d176bb8a8d755c3455ddb9","unresolved":false,"context_lines":[{"line_number":178,"context_line":"            dns_name \u003d None"},{"line_number":179,"context_line":"        return dns_name, dns_domain"},{"line_number":180,"context_line":""},{"line_number":181,"context_line":"    def _get_dns_names_for_port(self, ips, dns_port_db\u003dNone):"},{"line_number":182,"context_line":"        dns_assignment \u003d []"},{"line_number":183,"context_line":"        dns_name, dns_domain \u003d self._get_request_dns_name(dns_port_db)"},{"line_number":184,"context_line":"        for ip in ips:"}],"source_content_type":"text/x-python","patch_set":9,"id":"bab6814e_867a9e75","line":181,"range":{"start_line":181,"start_character":43,"end_line":181,"end_character":54},"updated":"2016-05-19 23:53:33.000000000","message":"I think this should be dns_data_db","commit_id":"9ff8f55a6b1ed95f6629f85d9580a32b131e6d83"},{"author":{"_account_id":20671,"name":"bin","email":"froyo.bin@gmail.com","username":"binyu"},"change_message_id":"320bb0cc26428ac47b0aee06a1a9f0fafe5da3ca","unresolved":false,"context_lines":[{"line_number":178,"context_line":"            dns_name \u003d None"},{"line_number":179,"context_line":"        return dns_name, dns_domain"},{"line_number":180,"context_line":""},{"line_number":181,"context_line":"    def _get_dns_names_for_port(self, ips, dns_port_db\u003dNone):"},{"line_number":182,"context_line":"        dns_assignment \u003d []"},{"line_number":183,"context_line":"        dns_name, dns_domain \u003d self._get_request_dns_name(dns_port_db)"},{"line_number":184,"context_line":"        for ip in ips:"}],"source_content_type":"text/x-python","patch_set":9,"id":"bab6814e_f5feaaac","line":181,"range":{"start_line":181,"start_character":43,"end_line":181,"end_character":54},"in_reply_to":"bab6814e_867a9e75","updated":"2016-05-20 08:04:35.000000000","message":"Done","commit_id":"9ff8f55a6b1ed95f6629f85d9580a32b131e6d83"},{"author":{"_account_id":4694,"name":"Miguel Lavalle","email":"miguel@mlavalle.com","username":"minsel"},"change_message_id":"9e9216d7ce90b9d8f0d176bb8a8d755c3455ddb9","unresolved":false,"context_lines":[{"line_number":182,"context_line":"        dns_assignment \u003d []"},{"line_number":183,"context_line":"        dns_name, dns_domain \u003d self._get_request_dns_name(dns_port_db)"},{"line_number":184,"context_line":"        for ip in ips:"},{"line_number":185,"context_line":"            if dns_name is not None:"},{"line_number":186,"context_line":"                hostname \u003d dns_name"},{"line_number":187,"context_line":"                fqdn \u003d \u0027%s.%s\u0027 % (dns_name, dns_domain)"},{"line_number":188,"context_line":"            else:"}],"source_content_type":"text/x-python","patch_set":9,"id":"bab6814e_e6c3aa55","line":185,"updated":"2016-05-19 23:53:33.000000000","message":"If we stick to \u0027\u0027 for the default value of dns_name, then we can say:\nif dns_name:","commit_id":"9ff8f55a6b1ed95f6629f85d9580a32b131e6d83"},{"author":{"_account_id":20671,"name":"bin","email":"froyo.bin@gmail.com","username":"binyu"},"change_message_id":"320bb0cc26428ac47b0aee06a1a9f0fafe5da3ca","unresolved":false,"context_lines":[{"line_number":182,"context_line":"        dns_assignment \u003d []"},{"line_number":183,"context_line":"        dns_name, dns_domain \u003d self._get_request_dns_name(dns_port_db)"},{"line_number":184,"context_line":"        for ip in ips:"},{"line_number":185,"context_line":"            if dns_name is not None:"},{"line_number":186,"context_line":"                hostname \u003d dns_name"},{"line_number":187,"context_line":"                fqdn \u003d \u0027%s.%s\u0027 % (dns_name, dns_domain)"},{"line_number":188,"context_line":"            else:"}],"source_content_type":"text/x-python","patch_set":9,"id":"bab6814e_f5c34a55","line":185,"in_reply_to":"bab6814e_e6c3aa55","updated":"2016-05-20 08:04:35.000000000","message":"Done","commit_id":"9ff8f55a6b1ed95f6629f85d9580a32b131e6d83"},{"author":{"_account_id":4694,"name":"Miguel Lavalle","email":"miguel@mlavalle.com","username":"minsel"},"change_message_id":"9e9216d7ce90b9d8f0d176bb8a8d755c3455ddb9","unresolved":false,"context_lines":[{"line_number":194,"context_line":"                                   \u0027fqdn\u0027: fqdn})"},{"line_number":195,"context_line":"        return dns_assignment"},{"line_number":196,"context_line":""},{"line_number":197,"context_line":"    def _get_dns_name_for_port_get(self, port, dns_port_db):"},{"line_number":198,"context_line":"        if port[\u0027fixed_ips\u0027]:"},{"line_number":199,"context_line":"            return self._get_dns_names_for_port(port[\u0027fixed_ips\u0027], dns_port_db)"},{"line_number":200,"context_line":"        return []"}],"source_content_type":"text/x-python","patch_set":9,"id":"bab6814e_866c5ed1","line":197,"range":{"start_line":197,"start_character":47,"end_line":197,"end_character":58},"updated":"2016-05-19 23:53:33.000000000","message":"I think this should be dns_data_db","commit_id":"9ff8f55a6b1ed95f6629f85d9580a32b131e6d83"},{"author":{"_account_id":20671,"name":"bin","email":"froyo.bin@gmail.com","username":"binyu"},"change_message_id":"320bb0cc26428ac47b0aee06a1a9f0fafe5da3ca","unresolved":false,"context_lines":[{"line_number":194,"context_line":"                                   \u0027fqdn\u0027: fqdn})"},{"line_number":195,"context_line":"        return dns_assignment"},{"line_number":196,"context_line":""},{"line_number":197,"context_line":"    def _get_dns_name_for_port_get(self, port, dns_port_db):"},{"line_number":198,"context_line":"        if port[\u0027fixed_ips\u0027]:"},{"line_number":199,"context_line":"            return self._get_dns_names_for_port(port[\u0027fixed_ips\u0027], dns_port_db)"},{"line_number":200,"context_line":"        return []"}],"source_content_type":"text/x-python","patch_set":9,"id":"bab6814e_35a8328d","line":197,"range":{"start_line":197,"start_character":47,"end_line":197,"end_character":58},"in_reply_to":"bab6814e_866c5ed1","updated":"2016-05-20 08:04:35.000000000","message":"Done","commit_id":"9ff8f55a6b1ed95f6629f85d9580a32b131e6d83"},{"author":{"_account_id":4694,"name":"Miguel Lavalle","email":"miguel@mlavalle.com","username":"minsel"},"change_message_id":"9e9216d7ce90b9d8f0d176bb8a8d755c3455ddb9","unresolved":false,"context_lines":[{"line_number":200,"context_line":"        return []"},{"line_number":201,"context_line":""},{"line_number":202,"context_line":"    def extend_port_dict(self, session, db_data, response_data):"},{"line_number":203,"context_line":"        dns_data_db \u003d session.query(dns_db.PortDNS).filter_by("},{"line_number":204,"context_line":"            port_id\u003ddb_data[\u0027id\u0027]).one_or_none()"},{"line_number":205,"context_line":"        if dns_data_db is None:"},{"line_number":206,"context_line":"            response_data[dns.DNSNAME] \u003d None"}],"source_content_type":"text/x-python","patch_set":9,"id":"bab6814e_83e570dd","line":203,"updated":"2016-05-19 23:53:33.000000000","message":"You don\u0027t need to read PortDNS. It is already present in db_data. Please remember that we have a backref in the orm.relationship when we defined the PortDNS table. So you can access it as db_data.dns","commit_id":"9ff8f55a6b1ed95f6629f85d9580a32b131e6d83"},{"author":{"_account_id":20671,"name":"bin","email":"froyo.bin@gmail.com","username":"binyu"},"change_message_id":"320bb0cc26428ac47b0aee06a1a9f0fafe5da3ca","unresolved":false,"context_lines":[{"line_number":200,"context_line":"        return []"},{"line_number":201,"context_line":""},{"line_number":202,"context_line":"    def extend_port_dict(self, session, db_data, response_data):"},{"line_number":203,"context_line":"        dns_data_db \u003d session.query(dns_db.PortDNS).filter_by("},{"line_number":204,"context_line":"            port_id\u003ddb_data[\u0027id\u0027]).one_or_none()"},{"line_number":205,"context_line":"        if dns_data_db is None:"},{"line_number":206,"context_line":"            response_data[dns.DNSNAME] \u003d None"}],"source_content_type":"text/x-python","patch_set":9,"id":"bab6814e_07f86548","line":203,"in_reply_to":"bab6814e_83e570dd","updated":"2016-05-20 08:04:35.000000000","message":"But, If we do the following steps, I think we have to read the dns information from portdnses.\n\n1.create a port with any dns name.\n2.update the port with a new dns name.\n\nAs the dns_data_db from the backref, it will not get the newest dns name.\n\nPS, the reason why we should do extend_port_dict is that:\nIn core plugin, we make the updated port_dict before calling process_update_port, then, we have no chance to update the dns information if we do not calling extend_port_dict at the end of process_port_update","commit_id":"9ff8f55a6b1ed95f6629f85d9580a32b131e6d83"},{"author":{"_account_id":4694,"name":"Miguel Lavalle","email":"miguel@mlavalle.com","username":"minsel"},"change_message_id":"9e9216d7ce90b9d8f0d176bb8a8d755c3455ddb9","unresolved":false,"context_lines":[{"line_number":203,"context_line":"        dns_data_db \u003d session.query(dns_db.PortDNS).filter_by("},{"line_number":204,"context_line":"            port_id\u003ddb_data[\u0027id\u0027]).one_or_none()"},{"line_number":205,"context_line":"        if dns_data_db is None:"},{"line_number":206,"context_line":"            response_data[dns.DNSNAME] \u003d None"},{"line_number":207,"context_line":"        else:"},{"line_number":208,"context_line":"            response_data[dns.DNSNAME] \u003d dns_data_db[\u0027current_dns_name\u0027]"},{"line_number":209,"context_line":"        response_data[\u0027dns_assignment\u0027] \u003d \\"}],"source_content_type":"text/x-python","patch_set":9,"id":"bab6814e_8680def8","line":206,"updated":"2016-05-19 23:53:33.000000000","message":"Replace None with \u0027\u0027","commit_id":"9ff8f55a6b1ed95f6629f85d9580a32b131e6d83"},{"author":{"_account_id":20671,"name":"bin","email":"froyo.bin@gmail.com","username":"binyu"},"change_message_id":"320bb0cc26428ac47b0aee06a1a9f0fafe5da3ca","unresolved":false,"context_lines":[{"line_number":203,"context_line":"        dns_data_db \u003d session.query(dns_db.PortDNS).filter_by("},{"line_number":204,"context_line":"            port_id\u003ddb_data[\u0027id\u0027]).one_or_none()"},{"line_number":205,"context_line":"        if dns_data_db is None:"},{"line_number":206,"context_line":"            response_data[dns.DNSNAME] \u003d None"},{"line_number":207,"context_line":"        else:"},{"line_number":208,"context_line":"            response_data[dns.DNSNAME] \u003d dns_data_db[\u0027current_dns_name\u0027]"},{"line_number":209,"context_line":"        response_data[\u0027dns_assignment\u0027] \u003d \\"}],"source_content_type":"text/x-python","patch_set":9,"id":"bab6814e_95a91e93","line":206,"in_reply_to":"bab6814e_8680def8","updated":"2016-05-20 08:04:35.000000000","message":"Done","commit_id":"9ff8f55a6b1ed95f6629f85d9580a32b131e6d83"},{"author":{"_account_id":4694,"name":"Miguel Lavalle","email":"miguel@mlavalle.com","username":"minsel"},"change_message_id":"9e9216d7ce90b9d8f0d176bb8a8d755c3455ddb9","unresolved":false,"context_lines":[{"line_number":205,"context_line":"        if dns_data_db is None:"},{"line_number":206,"context_line":"            response_data[dns.DNSNAME] \u003d None"},{"line_number":207,"context_line":"        else:"},{"line_number":208,"context_line":"            response_data[dns.DNSNAME] \u003d dns_data_db[\u0027current_dns_name\u0027]"},{"line_number":209,"context_line":"        response_data[\u0027dns_assignment\u0027] \u003d \\"},{"line_number":210,"context_line":"            self._get_dns_name_for_port_get(db_data, dns_data_db)"},{"line_number":211,"context_line":"        return response_data"}],"source_content_type":"text/x-python","patch_set":9,"id":"bab6814e_86973e39","line":208,"updated":"2016-05-19 23:53:33.000000000","message":"Replace \u0027current_dns_name\u0027 with \u0027dns_name\u0027","commit_id":"9ff8f55a6b1ed95f6629f85d9580a32b131e6d83"},{"author":{"_account_id":20671,"name":"bin","email":"froyo.bin@gmail.com","username":"binyu"},"change_message_id":"320bb0cc26428ac47b0aee06a1a9f0fafe5da3ca","unresolved":false,"context_lines":[{"line_number":205,"context_line":"        if dns_data_db is None:"},{"line_number":206,"context_line":"            response_data[dns.DNSNAME] \u003d None"},{"line_number":207,"context_line":"        else:"},{"line_number":208,"context_line":"            response_data[dns.DNSNAME] \u003d dns_data_db[\u0027current_dns_name\u0027]"},{"line_number":209,"context_line":"        response_data[\u0027dns_assignment\u0027] \u003d \\"},{"line_number":210,"context_line":"            self._get_dns_name_for_port_get(db_data, dns_data_db)"},{"line_number":211,"context_line":"        return response_data"}],"source_content_type":"text/x-python","patch_set":9,"id":"bab6814e_d5972646","line":208,"in_reply_to":"bab6814e_86973e39","updated":"2016-05-20 08:04:35.000000000","message":"Done","commit_id":"9ff8f55a6b1ed95f6629f85d9580a32b131e6d83"},{"author":{"_account_id":4694,"name":"Miguel Lavalle","email":"miguel@mlavalle.com","username":"minsel"},"change_message_id":"9e9216d7ce90b9d8f0d176bb8a8d755c3455ddb9","unresolved":false,"context_lines":[{"line_number":297,"context_line":"    port \u003d kwargs[\u0027port\u0027]"},{"line_number":298,"context_line":"    dns_data_db \u003d context.session.query(dns_db.PortDNS).filter_by("},{"line_number":299,"context_line":"        port_id\u003dport[\u0027id\u0027]).one_or_none()"},{"line_number":300,"context_line":"    if not dns_data_db:"},{"line_number":301,"context_line":"        return"},{"line_number":302,"context_line":"    if not dns_data_db[\u0027update_dns\u0027]:"},{"line_number":303,"context_line":"        return"}],"source_content_type":"text/x-python","patch_set":9,"id":"bab6814e_036180d3","line":300,"updated":"2016-05-19 23:53:33.000000000","message":"Based on my comments to lines 79 and 94, we just check the following:\n\nif not (dns_data_db and dns_data_db[\u0027current_dns_name\u0027]):\n    return\n\nNo need to update the DB","commit_id":"9ff8f55a6b1ed95f6629f85d9580a32b131e6d83"},{"author":{"_account_id":20671,"name":"bin","email":"froyo.bin@gmail.com","username":"binyu"},"change_message_id":"320bb0cc26428ac47b0aee06a1a9f0fafe5da3ca","unresolved":false,"context_lines":[{"line_number":297,"context_line":"    port \u003d kwargs[\u0027port\u0027]"},{"line_number":298,"context_line":"    dns_data_db \u003d context.session.query(dns_db.PortDNS).filter_by("},{"line_number":299,"context_line":"        port_id\u003dport[\u0027id\u0027]).one_or_none()"},{"line_number":300,"context_line":"    if not dns_data_db:"},{"line_number":301,"context_line":"        return"},{"line_number":302,"context_line":"    if not dns_data_db[\u0027update_dns\u0027]:"},{"line_number":303,"context_line":"        return"}],"source_content_type":"text/x-python","patch_set":9,"id":"bab6814e_b539c2d9","line":300,"in_reply_to":"bab6814e_036180d3","updated":"2016-05-20 08:04:35.000000000","message":"Done","commit_id":"9ff8f55a6b1ed95f6629f85d9580a32b131e6d83"},{"author":{"_account_id":4694,"name":"Miguel Lavalle","email":"miguel@mlavalle.com","username":"minsel"},"change_message_id":"9e9216d7ce90b9d8f0d176bb8a8d755c3455ddb9","unresolved":false,"context_lines":[{"line_number":301,"context_line":"        return"},{"line_number":302,"context_line":"    if not dns_data_db[\u0027update_dns\u0027]:"},{"line_number":303,"context_line":"        return"},{"line_number":304,"context_line":"    dns_data_db[\u0027update_dns\u0027] \u003d False"},{"line_number":305,"context_line":"    records \u003d [ip[\u0027ip_address\u0027] for ip in port[\u0027fixed_ips\u0027]]"},{"line_number":306,"context_line":"    _send_data_to_external_dns_service(context, dns_driver,"},{"line_number":307,"context_line":"                                       dns_data_db[\u0027current_dns_domain\u0027],"}],"source_content_type":"text/x-python","patch_set":9,"id":"bab6814e_22de4111","line":304,"updated":"2016-05-19 23:53:33.000000000","message":"When we call these methods through the notifications mechanism, we are not within a DB transaction. Therefore, we shouldn\u0027t be updating tables in the DB","commit_id":"9ff8f55a6b1ed95f6629f85d9580a32b131e6d83"},{"author":{"_account_id":20671,"name":"bin","email":"froyo.bin@gmail.com","username":"binyu"},"change_message_id":"320bb0cc26428ac47b0aee06a1a9f0fafe5da3ca","unresolved":false,"context_lines":[{"line_number":301,"context_line":"        return"},{"line_number":302,"context_line":"    if not dns_data_db[\u0027update_dns\u0027]:"},{"line_number":303,"context_line":"        return"},{"line_number":304,"context_line":"    dns_data_db[\u0027update_dns\u0027] \u003d False"},{"line_number":305,"context_line":"    records \u003d [ip[\u0027ip_address\u0027] for ip in port[\u0027fixed_ips\u0027]]"},{"line_number":306,"context_line":"    _send_data_to_external_dns_service(context, dns_driver,"},{"line_number":307,"context_line":"                                       dns_data_db[\u0027current_dns_domain\u0027],"}],"source_content_type":"text/x-python","patch_set":9,"id":"bab6814e_b5942243","line":304,"in_reply_to":"bab6814e_22de4111","updated":"2016-05-20 08:04:35.000000000","message":"Done","commit_id":"9ff8f55a6b1ed95f6629f85d9580a32b131e6d83"},{"author":{"_account_id":4694,"name":"Miguel Lavalle","email":"miguel@mlavalle.com","username":"minsel"},"change_message_id":"9e9216d7ce90b9d8f0d176bb8a8d755c3455ddb9","unresolved":false,"context_lines":[{"line_number":356,"context_line":"        return"},{"line_number":357,"context_line":"    dns_data_db \u003d context.session.query(dns_db.PortDNS).filter_by("},{"line_number":358,"context_line":"        port_id\u003dupdated_port[\u0027id\u0027]).one_or_none()"},{"line_number":359,"context_line":"    if not dns_data_db:"},{"line_number":360,"context_line":"        return"},{"line_number":361,"context_line":"    if not dns_data_db[\u0027update_dns\u0027]:"},{"line_number":362,"context_line":"        return"}],"source_content_type":"text/x-python","patch_set":9,"id":"bab6814e_c3fbf8bf","line":359,"updated":"2016-05-19 23:53:33.000000000","message":"Based on my comments to lines 79 and 94, we just check the following:\n\nif not (dns_data_db and (dns_data_db[\u0027previous_dns_name\u0027] or dns_data_db[\u0027current_dns_name\u0027])):\n    return\n\nNo need to update the DB","commit_id":"9ff8f55a6b1ed95f6629f85d9580a32b131e6d83"},{"author":{"_account_id":4694,"name":"Miguel Lavalle","email":"miguel@mlavalle.com","username":"minsel"},"change_message_id":"9e9216d7ce90b9d8f0d176bb8a8d755c3455ddb9","unresolved":false,"context_lines":[{"line_number":360,"context_line":"        return"},{"line_number":361,"context_line":"    if not dns_data_db[\u0027update_dns\u0027]:"},{"line_number":362,"context_line":"        return"},{"line_number":363,"context_line":"    dns_data_db[\u0027update_dns\u0027] \u003d False"},{"line_number":364,"context_line":"    if dns_data_db[\u0027previous_dns_name\u0027]:"},{"line_number":365,"context_line":"        _remove_data_from_external_dns_service("},{"line_number":366,"context_line":"            context, dns_driver, dns_data_db[\u0027previous_dns_domain\u0027],"}],"source_content_type":"text/x-python","patch_set":9,"id":"bab6814e_cc196e7b","line":363,"updated":"2016-05-19 23:53:33.000000000","message":"When we call these methods through the notifications mechanism, we are not within a DB transaction. Therefore, we shouldn\u0027t be updating tables in the DB","commit_id":"9ff8f55a6b1ed95f6629f85d9580a32b131e6d83"},{"author":{"_account_id":20671,"name":"bin","email":"froyo.bin@gmail.com","username":"binyu"},"change_message_id":"320bb0cc26428ac47b0aee06a1a9f0fafe5da3ca","unresolved":false,"context_lines":[{"line_number":360,"context_line":"        return"},{"line_number":361,"context_line":"    if not dns_data_db[\u0027update_dns\u0027]:"},{"line_number":362,"context_line":"        return"},{"line_number":363,"context_line":"    dns_data_db[\u0027update_dns\u0027] \u003d False"},{"line_number":364,"context_line":"    if dns_data_db[\u0027previous_dns_name\u0027]:"},{"line_number":365,"context_line":"        _remove_data_from_external_dns_service("},{"line_number":366,"context_line":"            context, dns_driver, dns_data_db[\u0027previous_dns_domain\u0027],"}],"source_content_type":"text/x-python","patch_set":9,"id":"bab6814e_f59a2a6d","line":363,"in_reply_to":"bab6814e_cc196e7b","updated":"2016-05-20 08:04:35.000000000","message":"Done","commit_id":"9ff8f55a6b1ed95f6629f85d9580a32b131e6d83"},{"author":{"_account_id":4694,"name":"Miguel Lavalle","email":"miguel@mlavalle.com","username":"minsel"},"change_message_id":"0fe6967baa240f58f693a8b0180d8dff03823893","unresolved":false,"context_lines":[{"line_number":81,"context_line":"        dns_name \u003d self._get_request_dns_name(request_data)"},{"line_number":82,"context_line":"        network \u003d self._get_network(plugin_context, db_data[\u0027network_id\u0027])"},{"line_number":83,"context_line":"        if self.external_dns_not_needed("},{"line_number":84,"context_line":"                plugin_context, network)or not network[dns.DNSDOMAIN]:"},{"line_number":85,"context_line":"            current_dns_name \u003d \u0027\u0027"},{"line_number":86,"context_line":"            current_dns_domain \u003d \u0027\u0027"},{"line_number":87,"context_line":"        else:"}],"source_content_type":"text/x-python","patch_set":11,"id":"9abb7d3a_6b2b6531","line":84,"range":{"start_line":84,"start_character":39,"end_line":84,"end_character":42},"updated":"2016-05-30 00:07:15.000000000","message":"Nit: please add a space between ) and or","commit_id":"978e3f6fd03dcb2bf3b2242c675cf175569f209c"},{"author":{"_account_id":20671,"name":"bin","email":"froyo.bin@gmail.com","username":"binyu"},"change_message_id":"b07a6f00a007725f08d02c7872c678f8ace201e2","unresolved":false,"context_lines":[{"line_number":81,"context_line":"        dns_name \u003d self._get_request_dns_name(request_data)"},{"line_number":82,"context_line":"        network \u003d self._get_network(plugin_context, db_data[\u0027network_id\u0027])"},{"line_number":83,"context_line":"        if self.external_dns_not_needed("},{"line_number":84,"context_line":"                plugin_context, network)or not network[dns.DNSDOMAIN]:"},{"line_number":85,"context_line":"            current_dns_name \u003d \u0027\u0027"},{"line_number":86,"context_line":"            current_dns_domain \u003d \u0027\u0027"},{"line_number":87,"context_line":"        else:"}],"source_content_type":"text/x-python","patch_set":11,"id":"9abb7d3a_a11c2ac2","line":84,"range":{"start_line":84,"start_character":39,"end_line":84,"end_character":42},"in_reply_to":"9abb7d3a_6b2b6531","updated":"2016-05-30 10:14:00.000000000","message":"Done","commit_id":"978e3f6fd03dcb2bf3b2242c675cf175569f209c"},{"author":{"_account_id":4694,"name":"Miguel Lavalle","email":"miguel@mlavalle.com","username":"minsel"},"change_message_id":"00e8a0dfe670be32023ca39ff39622dd3762dc44","unresolved":false,"context_lines":[{"line_number":85,"context_line":"            current_dns_name \u003d \u0027\u0027"},{"line_number":86,"context_line":"            current_dns_domain \u003d \u0027\u0027"},{"line_number":87,"context_line":"        else:"},{"line_number":88,"context_line":"            current_dns_name \u003d request_data[dns.DNSNAME]"},{"line_number":89,"context_line":"            current_dns_domain \u003d network[dns.DNSDOMAIN]"},{"line_number":90,"context_line":""},{"line_number":91,"context_line":"        if not current_dns_domain and not current_dns_domain and not dns_name:"}],"source_content_type":"text/x-python","patch_set":11,"id":"bab6814e_07614805","line":88,"range":{"start_line":88,"start_character":31,"end_line":88,"end_character":56},"updated":"2016-05-26 23:59:01.000000000","message":"To be consistent, this should be dns_name","commit_id":"978e3f6fd03dcb2bf3b2242c675cf175569f209c"},{"author":{"_account_id":20671,"name":"bin","email":"froyo.bin@gmail.com","username":"binyu"},"change_message_id":"b07a6f00a007725f08d02c7872c678f8ace201e2","unresolved":false,"context_lines":[{"line_number":85,"context_line":"            current_dns_name \u003d \u0027\u0027"},{"line_number":86,"context_line":"            current_dns_domain \u003d \u0027\u0027"},{"line_number":87,"context_line":"        else:"},{"line_number":88,"context_line":"            current_dns_name \u003d request_data[dns.DNSNAME]"},{"line_number":89,"context_line":"            current_dns_domain \u003d network[dns.DNSDOMAIN]"},{"line_number":90,"context_line":""},{"line_number":91,"context_line":"        if not current_dns_domain and not current_dns_domain and not dns_name:"}],"source_content_type":"text/x-python","patch_set":11,"id":"9abb7d3a_e163d23f","line":88,"range":{"start_line":88,"start_character":31,"end_line":88,"end_character":56},"in_reply_to":"bab6814e_07614805","updated":"2016-05-30 10:14:00.000000000","message":"Done","commit_id":"978e3f6fd03dcb2bf3b2242c675cf175569f209c"},{"author":{"_account_id":4694,"name":"Miguel Lavalle","email":"miguel@mlavalle.com","username":"minsel"},"change_message_id":"00e8a0dfe670be32023ca39ff39622dd3762dc44","unresolved":false,"context_lines":[{"line_number":95,"context_line":"            current_dns_name\u003dcurrent_dns_name,"},{"line_number":96,"context_line":"            current_dns_domain\u003dcurrent_dns_domain,"},{"line_number":97,"context_line":"            previous_dns_name\u003d\u0027\u0027, previous_dns_domain\u003d\u0027\u0027,"},{"line_number":98,"context_line":"            dns_name\u003drequest_data[dns.DNSNAME]))"},{"line_number":99,"context_line":""},{"line_number":100,"context_line":"    def update_dns_db(self, dns_name, dns_domain, db_data,"},{"line_number":101,"context_line":"                      plugin_context, has_fixed_ips, db_dns_name\u003dNone,"}],"source_content_type":"text/x-python","patch_set":11,"id":"bab6814e_a73cbce1","line":98,"range":{"start_line":98,"start_character":21,"end_line":98,"end_character":46},"updated":"2016-05-26 23:59:01.000000000","message":"To be consistent, this should be dns_name","commit_id":"978e3f6fd03dcb2bf3b2242c675cf175569f209c"},{"author":{"_account_id":20671,"name":"bin","email":"froyo.bin@gmail.com","username":"binyu"},"change_message_id":"b07a6f00a007725f08d02c7872c678f8ace201e2","unresolved":false,"context_lines":[{"line_number":95,"context_line":"            current_dns_name\u003dcurrent_dns_name,"},{"line_number":96,"context_line":"            current_dns_domain\u003dcurrent_dns_domain,"},{"line_number":97,"context_line":"            previous_dns_name\u003d\u0027\u0027, previous_dns_domain\u003d\u0027\u0027,"},{"line_number":98,"context_line":"            dns_name\u003drequest_data[dns.DNSNAME]))"},{"line_number":99,"context_line":""},{"line_number":100,"context_line":"    def update_dns_db(self, dns_name, dns_domain, db_data,"},{"line_number":101,"context_line":"                      plugin_context, has_fixed_ips, db_dns_name\u003dNone,"}],"source_content_type":"text/x-python","patch_set":11,"id":"9abb7d3a_21d5dab8","line":98,"range":{"start_line":98,"start_character":21,"end_line":98,"end_character":46},"in_reply_to":"bab6814e_a73cbce1","updated":"2016-05-30 10:14:00.000000000","message":"Done","commit_id":"978e3f6fd03dcb2bf3b2242c675cf175569f209c"},{"author":{"_account_id":4694,"name":"Miguel Lavalle","email":"miguel@mlavalle.com","username":"minsel"},"change_message_id":"0fe6967baa240f58f693a8b0180d8dff03823893","unresolved":false,"context_lines":[{"line_number":97,"context_line":"            previous_dns_name\u003d\u0027\u0027, previous_dns_domain\u003d\u0027\u0027,"},{"line_number":98,"context_line":"            dns_name\u003drequest_data[dns.DNSNAME]))"},{"line_number":99,"context_line":""},{"line_number":100,"context_line":"    def update_dns_db(self, dns_name, dns_domain, db_data,"},{"line_number":101,"context_line":"                      plugin_context, has_fixed_ips, db_dns_name\u003dNone,"},{"line_number":102,"context_line":"                      need_update\u003dFalse):"},{"line_number":103,"context_line":""}],"source_content_type":"text/x-python","patch_set":11,"id":"9abb7d3a_083572d9","line":100,"range":{"start_line":100,"start_character":8,"end_line":100,"end_character":21},"updated":"2016-05-30 00:07:15.000000000","message":"This should be an internal method: _update_dns_db","commit_id":"978e3f6fd03dcb2bf3b2242c675cf175569f209c"},{"author":{"_account_id":20671,"name":"bin","email":"froyo.bin@gmail.com","username":"binyu"},"change_message_id":"b07a6f00a007725f08d02c7872c678f8ace201e2","unresolved":false,"context_lines":[{"line_number":97,"context_line":"            previous_dns_name\u003d\u0027\u0027, previous_dns_domain\u003d\u0027\u0027,"},{"line_number":98,"context_line":"            dns_name\u003drequest_data[dns.DNSNAME]))"},{"line_number":99,"context_line":""},{"line_number":100,"context_line":"    def update_dns_db(self, dns_name, dns_domain, db_data,"},{"line_number":101,"context_line":"                      plugin_context, has_fixed_ips, db_dns_name\u003dNone,"},{"line_number":102,"context_line":"                      need_update\u003dFalse):"},{"line_number":103,"context_line":""}],"source_content_type":"text/x-python","patch_set":11,"id":"9abb7d3a_3ccb3da7","line":100,"range":{"start_line":100,"start_character":8,"end_line":100,"end_character":21},"in_reply_to":"9abb7d3a_083572d9","updated":"2016-05-30 10:14:00.000000000","message":"Done","commit_id":"978e3f6fd03dcb2bf3b2242c675cf175569f209c"},{"author":{"_account_id":4694,"name":"Miguel Lavalle","email":"miguel@mlavalle.com","username":"minsel"},"change_message_id":"0fe6967baa240f58f693a8b0180d8dff03823893","unresolved":false,"context_lines":[{"line_number":139,"context_line":"                    previous_dns_name\u003d\u0027\u0027, previous_dns_domain\u003d\u0027\u0027,"},{"line_number":140,"context_line":"                    dns_name\u003ddb_dns_name))"},{"line_number":141,"context_line":""},{"line_number":142,"context_line":"    def process_update_port(self, plugin_context, request_data, db_data):"},{"line_number":143,"context_line":"        dns_name \u003d request_data.get(dns.DNSNAME)"},{"line_number":144,"context_line":"        if dns_name is None:"},{"line_number":145,"context_line":"            db_dns_name \u003d None"}],"source_content_type":"text/x-python","patch_set":11,"id":"9abb7d3a_87a93e7e","line":142,"updated":"2016-05-30 00:07:15.000000000","message":"I was really struggling to understand this method and update_dns_db above. I decided to simplify them. My goal here was to improve readability and understandability. The approach I followed was to separate the handling of the case where you have an external DNS service (handled by update_dns_db, now renamed _update_dns_db) and the case where you don\u0027t have external DNS and you are only handling the dns_name attribute (for this I added another method, _process_only_dns_name_update). The result is in https://gist.github.com/miguellavalle/98edb534c0f09bd34db4d0c07809d4c1. Here, I also implemented all the improvements I made in all my comments to this module.\n\nI tested this new version in my devstack and works fine","commit_id":"978e3f6fd03dcb2bf3b2242c675cf175569f209c"},{"author":{"_account_id":20671,"name":"bin","email":"froyo.bin@gmail.com","username":"binyu"},"change_message_id":"b07a6f00a007725f08d02c7872c678f8ace201e2","unresolved":false,"context_lines":[{"line_number":139,"context_line":"                    previous_dns_name\u003d\u0027\u0027, previous_dns_domain\u003d\u0027\u0027,"},{"line_number":140,"context_line":"                    dns_name\u003ddb_dns_name))"},{"line_number":141,"context_line":""},{"line_number":142,"context_line":"    def process_update_port(self, plugin_context, request_data, db_data):"},{"line_number":143,"context_line":"        dns_name \u003d request_data.get(dns.DNSNAME)"},{"line_number":144,"context_line":"        if dns_name is None:"},{"line_number":145,"context_line":"            db_dns_name \u003d None"}],"source_content_type":"text/x-python","patch_set":11,"id":"9abb7d3a_e9a454ba","line":142,"in_reply_to":"9abb7d3a_87a93e7e","updated":"2016-05-30 10:14:00.000000000","message":"Thanks, this is more easy for people to understand","commit_id":"978e3f6fd03dcb2bf3b2242c675cf175569f209c"},{"author":{"_account_id":4694,"name":"Miguel Lavalle","email":"miguel@mlavalle.com","username":"minsel"},"change_message_id":"00e8a0dfe670be32023ca39ff39622dd3762dc44","unresolved":false,"context_lines":[{"line_number":140,"context_line":"                    dns_name\u003ddb_dns_name))"},{"line_number":141,"context_line":""},{"line_number":142,"context_line":"    def process_update_port(self, plugin_context, request_data, db_data):"},{"line_number":143,"context_line":"        dns_name \u003d request_data.get(dns.DNSNAME)"},{"line_number":144,"context_line":"        if dns_name is None:"},{"line_number":145,"context_line":"            db_dns_name \u003d None"},{"line_number":146,"context_line":"        else:"}],"source_content_type":"text/x-python","patch_set":11,"id":"bab6814e_b26fd8c2","line":143,"range":{"start_line":143,"start_character":8,"end_line":143,"end_character":48},"updated":"2016-05-26 23:59:01.000000000","message":"Right after this line, we should have:\n \nhas_fixed_ips \u003d \u0027fixed_ips\u0027 in request_data\nif dns_name is None and not has_fixed_ips:\n    return","commit_id":"978e3f6fd03dcb2bf3b2242c675cf175569f209c"},{"author":{"_account_id":4694,"name":"Miguel Lavalle","email":"miguel@mlavalle.com","username":"minsel"},"change_message_id":"00e8a0dfe670be32023ca39ff39622dd3762dc44","unresolved":false,"context_lines":[{"line_number":145,"context_line":"            db_dns_name \u003d None"},{"line_number":146,"context_line":"        else:"},{"line_number":147,"context_line":"            db_dns_name \u003d self._get_request_dns_name(request_data)"},{"line_number":148,"context_line":"        has_fixed_ips \u003d \u0027fixed_ips\u0027 in request_data"},{"line_number":149,"context_line":"        need_update \u003d True"},{"line_number":150,"context_line":"        if dns_name is None and not has_fixed_ips:"},{"line_number":151,"context_line":"            return"}],"source_content_type":"text/x-python","patch_set":11,"id":"bab6814e_d2a37cfe","line":148,"range":{"start_line":148,"start_character":8,"end_line":148,"end_character":51},"updated":"2016-05-26 23:59:01.000000000","message":"This line should be moved up, as indicated in comment to L#143","commit_id":"978e3f6fd03dcb2bf3b2242c675cf175569f209c"},{"author":{"_account_id":20671,"name":"bin","email":"froyo.bin@gmail.com","username":"binyu"},"change_message_id":"b07a6f00a007725f08d02c7872c678f8ace201e2","unresolved":false,"context_lines":[{"line_number":145,"context_line":"            db_dns_name \u003d None"},{"line_number":146,"context_line":"        else:"},{"line_number":147,"context_line":"            db_dns_name \u003d self._get_request_dns_name(request_data)"},{"line_number":148,"context_line":"        has_fixed_ips \u003d \u0027fixed_ips\u0027 in request_data"},{"line_number":149,"context_line":"        need_update \u003d True"},{"line_number":150,"context_line":"        if dns_name is None and not has_fixed_ips:"},{"line_number":151,"context_line":"            return"}],"source_content_type":"text/x-python","patch_set":11,"id":"9abb7d3a_bcc9ed7a","line":148,"range":{"start_line":148,"start_character":8,"end_line":148,"end_character":51},"in_reply_to":"bab6814e_d2a37cfe","updated":"2016-05-30 10:14:00.000000000","message":"Done","commit_id":"978e3f6fd03dcb2bf3b2242c675cf175569f209c"},{"author":{"_account_id":4694,"name":"Miguel Lavalle","email":"miguel@mlavalle.com","username":"minsel"},"change_message_id":"00e8a0dfe670be32023ca39ff39622dd3762dc44","unresolved":false,"context_lines":[{"line_number":147,"context_line":"            db_dns_name \u003d self._get_request_dns_name(request_data)"},{"line_number":148,"context_line":"        has_fixed_ips \u003d \u0027fixed_ips\u0027 in request_data"},{"line_number":149,"context_line":"        need_update \u003d True"},{"line_number":150,"context_line":"        if dns_name is None and not has_fixed_ips:"},{"line_number":151,"context_line":"            return"},{"line_number":152,"context_line":"        network \u003d self._get_network(plugin_context, db_data[\u0027network_id\u0027])"},{"line_number":153,"context_line":"        if not network[dns.DNSDOMAIN] or self.external_dns_not_needed("},{"line_number":154,"context_line":"                plugin_context, network):"}],"source_content_type":"text/x-python","patch_set":11,"id":"bab6814e_f2acc0ee","line":151,"range":{"start_line":150,"start_character":0,"end_line":151,"end_character":18},"updated":"2016-05-26 23:59:01.000000000","message":"These lines should be moved up, as indicated in comment to L#143","commit_id":"978e3f6fd03dcb2bf3b2242c675cf175569f209c"},{"author":{"_account_id":20671,"name":"bin","email":"froyo.bin@gmail.com","username":"binyu"},"change_message_id":"b07a6f00a007725f08d02c7872c678f8ace201e2","unresolved":false,"context_lines":[{"line_number":147,"context_line":"            db_dns_name \u003d self._get_request_dns_name(request_data)"},{"line_number":148,"context_line":"        has_fixed_ips \u003d \u0027fixed_ips\u0027 in request_data"},{"line_number":149,"context_line":"        need_update \u003d True"},{"line_number":150,"context_line":"        if dns_name is None and not has_fixed_ips:"},{"line_number":151,"context_line":"            return"},{"line_number":152,"context_line":"        network \u003d self._get_network(plugin_context, db_data[\u0027network_id\u0027])"},{"line_number":153,"context_line":"        if not network[dns.DNSDOMAIN] or self.external_dns_not_needed("},{"line_number":154,"context_line":"                plugin_context, network):"}],"source_content_type":"text/x-python","patch_set":11,"id":"9abb7d3a_9cc4e95f","line":151,"range":{"start_line":150,"start_character":0,"end_line":151,"end_character":18},"in_reply_to":"bab6814e_f2acc0ee","updated":"2016-05-30 10:14:00.000000000","message":"Done","commit_id":"978e3f6fd03dcb2bf3b2242c675cf175569f209c"},{"author":{"_account_id":4694,"name":"Miguel Lavalle","email":"miguel@mlavalle.com","username":"minsel"},"change_message_id":"0fe6967baa240f58f693a8b0180d8dff03823893","unresolved":false,"context_lines":[{"line_number":154,"context_line":"                plugin_context, network):"},{"line_number":155,"context_line":"            need_update \u003d False"},{"line_number":156,"context_line":"        dns_domain \u003d network[dns.DNSDOMAIN]"},{"line_number":157,"context_line":"        self.update_dns_db(dns_name, dns_domain, db_data,"},{"line_number":158,"context_line":"                           plugin_context, has_fixed_ips, db_dns_name,"},{"line_number":159,"context_line":"                           need_update)"},{"line_number":160,"context_line":"        self.extend_port_dict(plugin_context.session, db_data, db_data)"}],"source_content_type":"text/x-python","patch_set":11,"id":"9abb7d3a_484dba71","line":157,"range":{"start_line":157,"start_character":13,"end_line":157,"end_character":26},"updated":"2016-05-30 00:07:15.000000000","message":"This should be an internal method: _update_dns_db","commit_id":"978e3f6fd03dcb2bf3b2242c675cf175569f209c"},{"author":{"_account_id":20671,"name":"bin","email":"froyo.bin@gmail.com","username":"binyu"},"change_message_id":"b07a6f00a007725f08d02c7872c678f8ace201e2","unresolved":false,"context_lines":[{"line_number":154,"context_line":"                plugin_context, network):"},{"line_number":155,"context_line":"            need_update \u003d False"},{"line_number":156,"context_line":"        dns_domain \u003d network[dns.DNSDOMAIN]"},{"line_number":157,"context_line":"        self.update_dns_db(dns_name, dns_domain, db_data,"},{"line_number":158,"context_line":"                           plugin_context, has_fixed_ips, db_dns_name,"},{"line_number":159,"context_line":"                           need_update)"},{"line_number":160,"context_line":"        self.extend_port_dict(plugin_context.session, db_data, db_data)"}],"source_content_type":"text/x-python","patch_set":11,"id":"9abb7d3a_7cc5c58c","line":157,"range":{"start_line":157,"start_character":13,"end_line":157,"end_character":26},"in_reply_to":"9abb7d3a_484dba71","updated":"2016-05-30 10:14:00.000000000","message":"Done","commit_id":"978e3f6fd03dcb2bf3b2242c675cf175569f209c"},{"author":{"_account_id":4694,"name":"Miguel Lavalle","email":"miguel@mlavalle.com","username":"minsel"},"change_message_id":"0fe6967baa240f58f693a8b0180d8dff03823893","unresolved":false,"context_lines":[{"line_number":181,"context_line":"            return cfg.CONF.dns_domain"},{"line_number":182,"context_line":"        return \u0027%s.\u0027 % cfg.CONF.dns_domain"},{"line_number":183,"context_line":""},{"line_number":184,"context_line":"    def _get_request_dns_name(self, port\u003dNone):"},{"line_number":185,"context_line":"        if port is None:"},{"line_number":186,"context_line":"            return None"},{"line_number":187,"context_line":"        dns_domain \u003d self._get_dns_domain()"},{"line_number":188,"context_line":"        if ((dns_domain and dns_domain !\u003d DNS_DOMAIN_DEFAULT)):"},{"line_number":189,"context_line":"            return port.get(dns.DNSNAME, \u0027\u0027)"}],"source_content_type":"text/x-python","patch_set":11,"id":"9abb7d3a_eb03d50d","line":186,"range":{"start_line":184,"start_character":40,"end_line":186,"end_character":23},"updated":"2016-05-30 00:07:15.000000000","message":"When is port None? _get_request_dns_name is only called in lines 81 and 147. In both cases, the port from the request data is passed to this method. I think this should be removed","commit_id":"978e3f6fd03dcb2bf3b2242c675cf175569f209c"},{"author":{"_account_id":4694,"name":"Miguel Lavalle","email":"miguel@mlavalle.com","username":"minsel"},"change_message_id":"0fe6967baa240f58f693a8b0180d8dff03823893","unresolved":false,"context_lines":[{"line_number":189,"context_line":"            return port.get(dns.DNSNAME, \u0027\u0027)"},{"line_number":190,"context_line":"        return \u0027\u0027"},{"line_number":191,"context_line":""},{"line_number":192,"context_line":"    def _get_request_dns_name_and_domain_name(self, dns_data_db\u003dNone):"},{"line_number":193,"context_line":"        dns_domain \u003d self._get_dns_domain()"},{"line_number":194,"context_line":"        dns_name \u003d \u0027\u0027"},{"line_number":195,"context_line":"        if ((dns_domain and dns_domain !\u003d DNS_DOMAIN_DEFAULT)):"}],"source_content_type":"text/x-python","patch_set":11,"id":"9abb7d3a_66a0a5f5","line":192,"range":{"start_line":192,"start_character":63,"end_line":192,"end_character":68},"updated":"2016-05-30 00:07:15.000000000","message":"dns_data_db is never None. Please remove this","commit_id":"978e3f6fd03dcb2bf3b2242c675cf175569f209c"},{"author":{"_account_id":20671,"name":"bin","email":"froyo.bin@gmail.com","username":"binyu"},"change_message_id":"b07a6f00a007725f08d02c7872c678f8ace201e2","unresolved":false,"context_lines":[{"line_number":189,"context_line":"            return port.get(dns.DNSNAME, \u0027\u0027)"},{"line_number":190,"context_line":"        return \u0027\u0027"},{"line_number":191,"context_line":""},{"line_number":192,"context_line":"    def _get_request_dns_name_and_domain_name(self, dns_data_db\u003dNone):"},{"line_number":193,"context_line":"        dns_domain \u003d self._get_dns_domain()"},{"line_number":194,"context_line":"        dns_name \u003d \u0027\u0027"},{"line_number":195,"context_line":"        if ((dns_domain and dns_domain !\u003d DNS_DOMAIN_DEFAULT)):"}],"source_content_type":"text/x-python","patch_set":11,"id":"9abb7d3a_f0f1d96b","line":192,"range":{"start_line":192,"start_character":63,"end_line":192,"end_character":68},"in_reply_to":"9abb7d3a_66a0a5f5","updated":"2016-05-30 10:14:00.000000000","message":"Done","commit_id":"978e3f6fd03dcb2bf3b2242c675cf175569f209c"},{"author":{"_account_id":4694,"name":"Miguel Lavalle","email":"miguel@mlavalle.com","username":"minsel"},"change_message_id":"0fe6967baa240f58f693a8b0180d8dff03823893","unresolved":false,"context_lines":[{"line_number":197,"context_line":"                dns_name \u003d dns_data_db.dns_name"},{"line_number":198,"context_line":"        return dns_name, dns_domain"},{"line_number":199,"context_line":""},{"line_number":200,"context_line":"    def _get_dns_names_for_port(self, ips, dns_data_db\u003dNone):"},{"line_number":201,"context_line":"        dns_assignment \u003d []"},{"line_number":202,"context_line":"        dns_name, dns_domain \u003d self._get_request_dns_name_and_domain_name("},{"line_number":203,"context_line":"            dns_data_db)"}],"source_content_type":"text/x-python","patch_set":11,"id":"9abb7d3a_869b09c9","line":200,"range":{"start_line":200,"start_character":54,"end_line":200,"end_character":59},"updated":"2016-05-30 00:07:15.000000000","message":"dns_data_db is never None. Please remove this","commit_id":"978e3f6fd03dcb2bf3b2242c675cf175569f209c"},{"author":{"_account_id":20671,"name":"bin","email":"froyo.bin@gmail.com","username":"binyu"},"change_message_id":"b07a6f00a007725f08d02c7872c678f8ace201e2","unresolved":false,"context_lines":[{"line_number":197,"context_line":"                dns_name \u003d dns_data_db.dns_name"},{"line_number":198,"context_line":"        return dns_name, dns_domain"},{"line_number":199,"context_line":""},{"line_number":200,"context_line":"    def _get_dns_names_for_port(self, ips, dns_data_db\u003dNone):"},{"line_number":201,"context_line":"        dns_assignment \u003d []"},{"line_number":202,"context_line":"        dns_name, dns_domain \u003d self._get_request_dns_name_and_domain_name("},{"line_number":203,"context_line":"            dns_data_db)"}],"source_content_type":"text/x-python","patch_set":11,"id":"9abb7d3a_50e9c57f","line":200,"range":{"start_line":200,"start_character":54,"end_line":200,"end_character":59},"in_reply_to":"9abb7d3a_869b09c9","updated":"2016-05-30 10:14:00.000000000","message":"Done","commit_id":"978e3f6fd03dcb2bf3b2242c675cf175569f209c"},{"author":{"_account_id":4694,"name":"Miguel Lavalle","email":"miguel@mlavalle.com","username":"minsel"},"change_message_id":"0fe6967baa240f58f693a8b0180d8dff03823893","unresolved":false,"context_lines":[{"line_number":224,"context_line":"        return []"},{"line_number":225,"context_line":""},{"line_number":226,"context_line":"    def extend_port_dict(self, session, db_data, response_data):"},{"line_number":227,"context_line":"        dns_data_db \u003d session.query(dns_db.PortDNS).filter_by("},{"line_number":228,"context_line":"            port_id\u003ddb_data[\u0027id\u0027]).one_or_none()"},{"line_number":229,"context_line":"        if not dns_data_db:"},{"line_number":230,"context_line":"            response_data[dns.DNSNAME] \u003d \u0027\u0027"},{"line_number":231,"context_line":"        else:"}],"source_content_type":"text/x-python","patch_set":11,"id":"9abb7d3a_6796da4d","line":228,"range":{"start_line":227,"start_character":8,"end_line":228,"end_character":48},"updated":"2016-05-30 00:07:15.000000000","message":"There is no need to query the DB to get dns_data_db. If this method is called from outside this module, you can get dns_data_db as follows:\n\ndns_data_db \u003d db_data.dns\n\nYour problem is that you are calling this method from line 160 above. But in that method, process_update_port, you already have all the data stored in dns_data_db. Why read it from the DB? I suggest splitting this method in 2:\n\ndef _extend_port_dict(self, session, db_data, response_data, dns_data_db):\n\nAs you can see, this method receives dns_data_db as input. It also does everything that is in lines 229 - 235 below. This is the method you will call from process_update_port. Of course, in that method you pass dns_data_db.\n\nThe other method is def extend_port_dict(self, session, db_data, response_data):\n\nAll it does is:\n\n    def extend_port_dict(self, session, db_data, response_data):\n        dns_data_db \u003d db_data.dns\n        return self._extend_port_dict(session, db_data, response_data,\n                                      dns_data_db)","commit_id":"978e3f6fd03dcb2bf3b2242c675cf175569f209c"},{"author":{"_account_id":20671,"name":"bin","email":"froyo.bin@gmail.com","username":"binyu"},"change_message_id":"b07a6f00a007725f08d02c7872c678f8ace201e2","unresolved":false,"context_lines":[{"line_number":224,"context_line":"        return []"},{"line_number":225,"context_line":""},{"line_number":226,"context_line":"    def extend_port_dict(self, session, db_data, response_data):"},{"line_number":227,"context_line":"        dns_data_db \u003d session.query(dns_db.PortDNS).filter_by("},{"line_number":228,"context_line":"            port_id\u003ddb_data[\u0027id\u0027]).one_or_none()"},{"line_number":229,"context_line":"        if not dns_data_db:"},{"line_number":230,"context_line":"            response_data[dns.DNSNAME] \u003d \u0027\u0027"},{"line_number":231,"context_line":"        else:"}],"source_content_type":"text/x-python","patch_set":11,"id":"9abb7d3a_d363ffda","line":228,"range":{"start_line":227,"start_character":8,"end_line":228,"end_character":48},"in_reply_to":"9abb7d3a_6796da4d","updated":"2016-05-30 10:14:00.000000000","message":"The reason to get dns information form portdnses is that when we update port[\u0027dns\u0027] and port[\u0027dns_assignemnt\u0027] in process_update_port, db_data has no key of dns.\n\nI agree, split this method into two method will avoid the problem of query portdnses","commit_id":"978e3f6fd03dcb2bf3b2242c675cf175569f209c"},{"author":{"_account_id":4694,"name":"Miguel Lavalle","email":"miguel@mlavalle.com","username":"minsel"},"change_message_id":"0fe6967baa240f58f693a8b0180d8dff03823893","unresolved":false,"context_lines":[{"line_number":380,"context_line":"    if not (dns_data_db and (dns_data_db[\u0027previous_dns_name\u0027] or dns_data_db["},{"line_number":381,"context_line":"        \u0027current_dns_name\u0027])):"},{"line_number":382,"context_line":"        return"},{"line_number":383,"context_line":"    dns_data_db[\u0027update_dns\u0027] \u003d False"},{"line_number":384,"context_line":"    if dns_data_db[\u0027previous_dns_name\u0027]:"},{"line_number":385,"context_line":"        _remove_data_from_external_dns_service("},{"line_number":386,"context_line":"            context, dns_driver, dns_data_db[\u0027previous_dns_domain\u0027],"}],"source_content_type":"text/x-python","patch_set":11,"id":"9abb7d3a_ab742dcf","line":383,"range":{"start_line":383,"start_character":4,"end_line":383,"end_character":37},"updated":"2016-05-30 00:07:15.000000000","message":"This should be removed. There is no column \u0027update_dns\u0027 in PortDNS","commit_id":"978e3f6fd03dcb2bf3b2242c675cf175569f209c"},{"author":{"_account_id":4694,"name":"Miguel Lavalle","email":"miguel@mlavalle.com","username":"minsel"},"change_message_id":"32e93d5ca545d813328e0f6583672e7b19170350","unresolved":false,"context_lines":[{"line_number":76,"context_line":"            db_data[dns.DNSDOMAIN] \u003d new_value"},{"line_number":77,"context_line":""},{"line_number":78,"context_line":"    def process_create_port(self, plugin_context, request_data, db_data):"},{"line_number":79,"context_line":"        dns_name \u003d request_data.get(dns.DNSNAME)"},{"line_number":80,"context_line":"        if not dns_name:"},{"line_number":81,"context_line":"            return"},{"line_number":82,"context_line":"        network \u003d self._get_network(plugin_context, db_data[\u0027network_id\u0027])"}],"source_content_type":"text/x-python","patch_set":15,"id":"9abb7d3a_0f2c1caa","line":79,"range":{"start_line":79,"start_character":8,"end_line":79,"end_character":48},"updated":"2016-05-30 19:28:48.000000000","message":"What happened to the line?:\n\ndns_name \u003d self._get_request_dns_name(request_data)\n\nYou are processing dns_name directly from the request. But a non empty value in dns_name should only be processed if dns_domain !\u003d \u0027openstacklocal\u0027 in neutron.conf. But you are processing it straight from the request\n\nAm I missing something?","commit_id":"37ded29bc3f79f2b5c9e8da13647dc8ca3cea83e"},{"author":{"_account_id":4694,"name":"Miguel Lavalle","email":"miguel@mlavalle.com","username":"minsel"},"change_message_id":"32e93d5ca545d813328e0f6583672e7b19170350","unresolved":false,"context_lines":[{"line_number":131,"context_line":"        return dns_data_db"},{"line_number":132,"context_line":""},{"line_number":133,"context_line":"    def process_update_port(self, plugin_context, request_data, db_data):"},{"line_number":134,"context_line":"        dns_name \u003d request_data.get(dns.DNSNAME)"},{"line_number":135,"context_line":"        has_fixed_ips \u003d \u0027fixed_ips\u0027 in request_data"},{"line_number":136,"context_line":"        if dns_name is None and not has_fixed_ips:"},{"line_number":137,"context_line":"            return"}],"source_content_type":"text/x-python","patch_set":15,"id":"9abb7d3a_ef0d583f","line":134,"range":{"start_line":134,"start_character":8,"end_line":134,"end_character":48},"updated":"2016-05-30 19:28:48.000000000","message":"What happened to the line?:\n\ndns_name \u003d self._get_request_dns_name(request_data)\n\nYou are processing dns_name directly from the request. But a non empty value in dns_name should only be processed if dns_domain !\u003d \u0027openstacklocal\u0027 in neutron.conf. But you are processing it straight from the request\n\nAm I missing something?","commit_id":"37ded29bc3f79f2b5c9e8da13647dc8ca3cea83e"},{"author":{"_account_id":20671,"name":"bin","email":"froyo.bin@gmail.com","username":"binyu"},"change_message_id":"089e905d1274fcf14ed928658434c6bf9ca64438","unresolved":false,"context_lines":[{"line_number":381,"context_line":"        return"},{"line_number":382,"context_line":"    original_ips \u003d [ip[\u0027ip_address\u0027] for ip in original_port[\u0027fixed_ips\u0027]]"},{"line_number":383,"context_line":"    updated_ips \u003d [ip[\u0027ip_address\u0027] for ip in updated_port[\u0027fixed_ips\u0027]]"},{"line_number":384,"context_line":"    if (updated_port[\u0027dns_name_db\u0027] \u003d\u003d original_port[\u0027dns_name_db\u0027] and set("},{"line_number":385,"context_line":"            original_ips) \u003d\u003d set(updated_ips)):"},{"line_number":386,"context_line":"        return"},{"line_number":387,"context_line":"    if (updated_port[\u0027dns_name_db\u0027] \u003d\u003d original_port[\u0027dns_name_db\u0027] and not"},{"line_number":388,"context_line":"    updated_port[\u0027dns_name_db\u0027]):"},{"line_number":389,"context_line":"        return"},{"line_number":390,"context_line":"    if previous_dns_name:"},{"line_number":391,"context_line":"        _remove_data_from_external_dns_service("},{"line_number":392,"context_line":"            context, dns_driver, dns_data_db[\u0027previous_dns_domain\u0027],"}],"source_content_type":"text/x-python","patch_set":15,"id":"9abb7d3a_3fcfa580","line":389,"range":{"start_line":384,"start_character":3,"end_line":389,"end_character":14},"updated":"2016-05-30 10:41:05.000000000","message":"I create the key-pair updated_port[\u0027dns_name_db\u0027] to handle the dns related operations with domainname\u003d\u0027openstacklocal.\u0027.\n\nIn the scenario that domainname\u003d\u0027openstacklocal.\u0027\n\nThe updated/originial_port[\u0027dns_name\u0027] will always return blank. So these two variables are meaningless. This make the logic like test case \"test_update_fixed_ips_no_effect_after_clearing_dns_name\" very hard to handle(we cannot detected the second update does nothing related with dns).\n\nWith the help key-pair updated_port/original[\u0027dns_name_db\u0027], they represent the dns name that the user set directly! So, even we handle with domainname\u003d\u0027openstacklocal.\u0027, we can use the same logic that with domainname\u003d\u0027domain.com.\u0027 to make the code simple.\n\nIn this way, these codes will be free from the trouble caused by the difference of default domain name and user-set domain name. They can share the same logic, so I can use the same logic as the original code safely.","commit_id":"37ded29bc3f79f2b5c9e8da13647dc8ca3cea83e"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"5ff0ca927ce962e71c6aa5af62ceb515e0c9572c","unresolved":false,"context_lines":[{"line_number":105,"context_line":"            port_id\u003ddb_data[\u0027id\u0027]).one_or_none()"},{"line_number":106,"context_line":"        if dns_data_db:"},{"line_number":107,"context_line":"            is_dns_name_changed \u003d (dns_name is not None and"},{"line_number":108,"context_line":"                                   dns_data_db[\u0027current_dns_name\u0027] !\u003d dns_name)"},{"line_number":109,"context_line":""},{"line_number":110,"context_line":"            if is_dns_name_changed or (has_fixed_ips and"},{"line_number":111,"context_line":"                                       dns_data_db[\u0027current_dns_name\u0027]):"}],"source_content_type":"text/x-python","patch_set":20,"id":"7aa08908_0061b239","line":108,"range":{"start_line":108,"start_character":0,"end_line":108,"end_character":35},"updated":"2016-06-06 18:21:33.000000000","message":"Gratuitous whitespace change.  Revert it, please.","commit_id":"677267d8c7e956ee0e2315cb13ffbf58e6bc7c18"},{"author":{"_account_id":20671,"name":"bin","email":"froyo.bin@gmail.com","username":"binyu"},"change_message_id":"e88715f752a474a5bac4a7a74f68a93ec3e73f00","unresolved":false,"context_lines":[{"line_number":105,"context_line":"            port_id\u003ddb_data[\u0027id\u0027]).one_or_none()"},{"line_number":106,"context_line":"        if dns_data_db:"},{"line_number":107,"context_line":"            is_dns_name_changed \u003d (dns_name is not None and"},{"line_number":108,"context_line":"                                   dns_data_db[\u0027current_dns_name\u0027] !\u003d dns_name)"},{"line_number":109,"context_line":""},{"line_number":110,"context_line":"            if is_dns_name_changed or (has_fixed_ips and"},{"line_number":111,"context_line":"                                       dns_data_db[\u0027current_dns_name\u0027]):"}],"source_content_type":"text/x-python","patch_set":20,"id":"7aa08908_69bfb3fb","line":108,"range":{"start_line":108,"start_character":0,"end_line":108,"end_character":35},"in_reply_to":"7aa08908_0061b239","updated":"2016-06-08 06:59:14.000000000","message":"Done","commit_id":"677267d8c7e956ee0e2315cb13ffbf58e6bc7c18"},{"author":{"_account_id":4694,"name":"Miguel Lavalle","email":"miguel@mlavalle.com","username":"minsel"},"change_message_id":"21e51513ae955c81c9295df4a5e6e924a5494329","unresolved":false,"context_lines":[{"line_number":104,"context_line":"        if dns_data_db:"},{"line_number":105,"context_line":"            is_dns_name_changed \u003d (dns_name is not None and"},{"line_number":106,"context_line":"                    dns_data_db[\u0027current_dns_name\u0027] !\u003d dns_name)"},{"line_number":107,"context_line":""},{"line_number":108,"context_line":"            if is_dns_name_changed or (has_fixed_ips and"},{"line_number":109,"context_line":"                                       dns_data_db[\u0027current_dns_name\u0027]):"},{"line_number":110,"context_line":"                dns_data_db[\u0027previous_dns_name\u0027] \u003d ("}],"source_content_type":"text/x-python","patch_set":23,"id":"7aa08908_81a396b1","side":"PARENT","line":107,"updated":"2016-06-07 21:21:31.000000000","message":"Gratuitous whitespace change. Revert it, please.","commit_id":"01a9d41ceb02ac43f8a4de1c719d2932dade4df2"},{"author":{"_account_id":20671,"name":"bin","email":"froyo.bin@gmail.com","username":"binyu"},"change_message_id":"51e8d839cba16593221d72107b50a75bd4ffc57d","unresolved":false,"context_lines":[{"line_number":104,"context_line":"        if dns_data_db:"},{"line_number":105,"context_line":"            is_dns_name_changed \u003d (dns_name is not None and"},{"line_number":106,"context_line":"                    dns_data_db[\u0027current_dns_name\u0027] !\u003d dns_name)"},{"line_number":107,"context_line":""},{"line_number":108,"context_line":"            if is_dns_name_changed or (has_fixed_ips and"},{"line_number":109,"context_line":"                                       dns_data_db[\u0027current_dns_name\u0027]):"},{"line_number":110,"context_line":"                dns_data_db[\u0027previous_dns_name\u0027] \u003d ("}],"source_content_type":"text/x-python","patch_set":23,"id":"7aa08908_c2c0f652","side":"PARENT","line":107,"in_reply_to":"7aa08908_81a396b1","updated":"2016-06-08 09:10:24.000000000","message":"Done","commit_id":"01a9d41ceb02ac43f8a4de1c719d2932dade4df2"},{"author":{"_account_id":4694,"name":"Miguel Lavalle","email":"miguel@mlavalle.com","username":"minsel"},"change_message_id":"21e51513ae955c81c9295df4a5e6e924a5494329","unresolved":false,"context_lines":[{"line_number":105,"context_line":"            port_id\u003ddb_data[\u0027id\u0027]).one_or_none()"},{"line_number":106,"context_line":"        if dns_data_db:"},{"line_number":107,"context_line":"            is_dns_name_changed \u003d (dns_name is not None and"},{"line_number":108,"context_line":"                                   dns_data_db[\u0027current_dns_name\u0027] !\u003d dns_name)"},{"line_number":109,"context_line":"            if is_dns_name_changed or (has_fixed_ips and"},{"line_number":110,"context_line":"                                       dns_data_db[\u0027current_dns_name\u0027]):"},{"line_number":111,"context_line":"                dns_data_db[\u0027previous_dns_name\u0027] \u003d ("}],"source_content_type":"text/x-python","patch_set":23,"id":"7aa08908_a1b7b2f3","line":108,"range":{"start_line":108,"start_character":20,"end_line":108,"end_character":35},"updated":"2016-06-07 21:21:31.000000000","message":"Gratuitous whitespace change. Revert it, please.","commit_id":"33c643ca7dae496fb251b55bd95108694e70060f"},{"author":{"_account_id":20671,"name":"bin","email":"froyo.bin@gmail.com","username":"binyu"},"change_message_id":"51e8d839cba16593221d72107b50a75bd4ffc57d","unresolved":false,"context_lines":[{"line_number":105,"context_line":"            port_id\u003ddb_data[\u0027id\u0027]).one_or_none()"},{"line_number":106,"context_line":"        if dns_data_db:"},{"line_number":107,"context_line":"            is_dns_name_changed \u003d (dns_name is not None and"},{"line_number":108,"context_line":"                                   dns_data_db[\u0027current_dns_name\u0027] !\u003d dns_name)"},{"line_number":109,"context_line":"            if is_dns_name_changed or (has_fixed_ips and"},{"line_number":110,"context_line":"                                       dns_data_db[\u0027current_dns_name\u0027]):"},{"line_number":111,"context_line":"                dns_data_db[\u0027previous_dns_name\u0027] \u003d ("}],"source_content_type":"text/x-python","patch_set":23,"id":"7aa08908_e2bb72e3","line":108,"range":{"start_line":108,"start_character":20,"end_line":108,"end_character":35},"in_reply_to":"7aa08908_a1b7b2f3","updated":"2016-06-08 09:10:24.000000000","message":"Done, I have updated it in PS 25","commit_id":"33c643ca7dae496fb251b55bd95108694e70060f"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"75539bcc665eeae1c43ef19721819cc09aaee83f","unresolved":false,"context_lines":[{"line_number":85,"context_line":"        network \u003d self._get_network(plugin_context, db_data[\u0027network_id\u0027])"},{"line_number":86,"context_line":"        if self.external_dns_not_needed("},{"line_number":87,"context_line":"                plugin_context, network) or not network[dns.DNSDOMAIN]:"},{"line_number":88,"context_line":"            current_dns_name \u003d \u0027\u0027"},{"line_number":89,"context_line":"            current_dns_domain \u003d \u0027\u0027"},{"line_number":90,"context_line":"        else:"},{"line_number":91,"context_line":"            current_dns_name \u003d dns_name"}],"source_content_type":"text/x-python","patch_set":26,"id":"7aa08908_b4a5e4a2","line":88,"range":{"start_line":88,"start_character":31,"end_line":88,"end_character":33},"updated":"2016-06-14 17:34:45.000000000","message":"Why aren\u0027t we using None for these again?","commit_id":"54740383e350fc8a76ef303c410f8d31db4adf67"},{"author":{"_account_id":20671,"name":"bin","email":"froyo.bin@gmail.com","username":"binyu"},"change_message_id":"14969224b5e9cb5c5729588ec1e249180b9be085","unresolved":false,"context_lines":[{"line_number":85,"context_line":"        network \u003d self._get_network(plugin_context, db_data[\u0027network_id\u0027])"},{"line_number":86,"context_line":"        if self.external_dns_not_needed("},{"line_number":87,"context_line":"                plugin_context, network) or not network[dns.DNSDOMAIN]:"},{"line_number":88,"context_line":"            current_dns_name \u003d \u0027\u0027"},{"line_number":89,"context_line":"            current_dns_domain \u003d \u0027\u0027"},{"line_number":90,"context_line":"        else:"},{"line_number":91,"context_line":"            current_dns_name \u003d dns_name"}],"source_content_type":"text/x-python","patch_set":26,"id":"7aa08908_b18cba2f","line":88,"range":{"start_line":88,"start_character":31,"end_line":88,"end_character":33},"in_reply_to":"7aa08908_b4a5e4a2","updated":"2016-06-17 08:35:27.000000000","message":"I think the reasons are :\n\n1. current_dns_name,current_dns_domain,previous_dns_name, etc. are \"nullable\u003dFalse\" columns.\n\n2. Keep the column \u0027\u0027 if it is not set consistently have 2 benefits.\n\na. It is easy to maintain the query operations, we just return as it like, otherwise, we should check whether it is none, and we return the blank value.\n\nb. It is much easy to distinguish  the dns related data between dict value and from DB. Take dns_name for example,  see L138, we check whether the request data dic has this key-value, however, all the operations on dns_name from DB will be checked like \"if dns_name or if not dns_name\"","commit_id":"54740383e350fc8a76ef303c410f8d31db4adf67"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"75539bcc665eeae1c43ef19721819cc09aaee83f","unresolved":false,"context_lines":[{"line_number":95,"context_line":"            port_id\u003ddb_data[\u0027id\u0027],"},{"line_number":96,"context_line":"            current_dns_name\u003dcurrent_dns_name,"},{"line_number":97,"context_line":"            current_dns_domain\u003dcurrent_dns_domain,"},{"line_number":98,"context_line":"            previous_dns_name\u003d\u0027\u0027, previous_dns_domain\u003d\u0027\u0027,"},{"line_number":99,"context_line":"            dns_name\u003ddns_name))"},{"line_number":100,"context_line":""},{"line_number":101,"context_line":"    def _update_dns_db(self, dns_name, dns_domain, db_data,"}],"source_content_type":"text/x-python","patch_set":26,"id":"7aa08908_f4abec72","line":98,"range":{"start_line":98,"start_character":30,"end_line":98,"end_character":32},"updated":"2016-06-14 17:34:45.000000000","message":"ditto (L88)","commit_id":"54740383e350fc8a76ef303c410f8d31db4adf67"},{"author":{"_account_id":20671,"name":"bin","email":"froyo.bin@gmail.com","username":"binyu"},"change_message_id":"14969224b5e9cb5c5729588ec1e249180b9be085","unresolved":false,"context_lines":[{"line_number":95,"context_line":"            port_id\u003ddb_data[\u0027id\u0027],"},{"line_number":96,"context_line":"            current_dns_name\u003dcurrent_dns_name,"},{"line_number":97,"context_line":"            current_dns_domain\u003dcurrent_dns_domain,"},{"line_number":98,"context_line":"            previous_dns_name\u003d\u0027\u0027, previous_dns_domain\u003d\u0027\u0027,"},{"line_number":99,"context_line":"            dns_name\u003ddns_name))"},{"line_number":100,"context_line":""},{"line_number":101,"context_line":"    def _update_dns_db(self, dns_name, dns_domain, db_data,"}],"source_content_type":"text/x-python","patch_set":26,"id":"7aa08908_ae473779","line":98,"range":{"start_line":98,"start_character":30,"end_line":98,"end_character":32},"in_reply_to":"7aa08908_f4abec72","updated":"2016-06-17 08:35:27.000000000","message":"same reason as L88","commit_id":"54740383e350fc8a76ef303c410f8d31db4adf67"}],"neutron/plugins/ml2/plugin.py":[{"author":{"_account_id":4694,"name":"Miguel Lavalle","email":"miguel@mlavalle.com","username":"minsel"},"change_message_id":"cc733dc34f1a8b345807d0fd696aaa44bfa8d28c","unresolved":false,"context_lines":[{"line_number":1060,"context_line":"        attrs \u003d port[attributes.PORT]"},{"line_number":1061,"context_line":"        if not attrs.get(\u0027status\u0027):"},{"line_number":1062,"context_line":"            attrs[\u0027status\u0027] \u003d const.PORT_STATUS_DOWN"},{"line_number":1063,"context_line":""},{"line_number":1064,"context_line":"        session \u003d context.session"},{"line_number":1065,"context_line":"        with db_api.exc_to_retry(os_db_exception.DBDuplicateEntry),\\"},{"line_number":1066,"context_line":"                session.begin(subtransactions\u003dTrue):"}],"source_content_type":"text/x-python","patch_set":5,"id":"dab17558_c11cee15","side":"PARENT","line":1063,"updated":"2016-05-12 22:30:59.000000000","message":"Please don\u0027t make don\u0027t remove or add lines unrelated to your change. It confuses reviewers","commit_id":"cd4fa82bd8967dae67217fd05c6a585b571bfaa3"},{"author":{"_account_id":4694,"name":"Miguel Lavalle","email":"miguel@mlavalle.com","username":"minsel"},"change_message_id":"cc733dc34f1a8b345807d0fd696aaa44bfa8d28c","unresolved":false,"context_lines":[{"line_number":1213,"context_line":"                port_db, attrs, binding)"},{"line_number":1214,"context_line":"            need_port_update_notify |\u003d mac_address_updated"},{"line_number":1215,"context_line":"            original_port \u003d self._make_port_dict(port_db)"},{"line_number":1216,"context_line":"            updated_port \u003d super(Ml2Plugin, self).update_port(context, id,"},{"line_number":1217,"context_line":"                                                              port)"},{"line_number":1218,"context_line":"            self.extension_manager.process_update_port(context, attrs,"},{"line_number":1219,"context_line":"                                                       updated_port)"}],"source_content_type":"text/x-python","patch_set":5,"id":"dab17558_21c85a74","side":"PARENT","line":1216,"updated":"2016-05-12 22:30:59.000000000","message":"Please don\u0027t make don\u0027t remove or add lines unrelated to your change. It confuses reviewers","commit_id":"cd4fa82bd8967dae67217fd05c6a585b571bfaa3"},{"author":{"_account_id":20671,"name":"bin","email":"froyo.bin@gmail.com","username":"binyu"},"change_message_id":"25d31046ed0c48588a90e9ef9112a60618252f7e","unresolved":false,"context_lines":[{"line_number":1274,"context_line":""},{"line_number":1275,"context_line":"        # Notifications as we updated the dns schema, so we have to read the"},{"line_number":1276,"context_line":"        # port db to get the updated dns data after above transaction is done"},{"line_number":1277,"context_line":"        port_db, binding \u003d db.get_locked_port_and_binding(session, id)"},{"line_number":1278,"context_line":"        ips_info \u003d updated_port[\u0027fixed_ips\u0027]"},{"line_number":1279,"context_line":"        updated_port \u003d self._make_port_dict(port_db)"},{"line_number":1280,"context_line":"        # Keep up with fields that changed outside ports db"},{"line_number":1281,"context_line":"        updated_port[\u0027fixed_ips\u0027] \u003d ips_info"},{"line_number":1282,"context_line":"        # Notifications must be sent after the above transaction is complete"},{"line_number":1283,"context_line":"        kwargs \u003d {"},{"line_number":1284,"context_line":"            \u0027context\u0027: context,"}],"source_content_type":"text/x-python","patch_set":5,"id":"dab17558_6e0b862c","line":1281,"range":{"start_line":1277,"start_character":4,"end_line":1281,"end_character":44},"updated":"2016-05-12 10:39:17.000000000","message":"For the case that user update the port which do not have dns name, we have to get the newest port_db by query in DB again otherwise, the new added record in portdns cannot be seen.","commit_id":"83fa9dc0cf4489b781b206408ff8e144c84e9224"},{"author":{"_account_id":4694,"name":"Miguel Lavalle","email":"miguel@mlavalle.com","username":"minsel"},"change_message_id":"cc733dc34f1a8b345807d0fd696aaa44bfa8d28c","unresolved":false,"context_lines":[{"line_number":1274,"context_line":""},{"line_number":1275,"context_line":"        # Notifications as we updated the dns schema, so we have to read the"},{"line_number":1276,"context_line":"        # port db to get the updated dns data after above transaction is done"},{"line_number":1277,"context_line":"        port_db, binding \u003d db.get_locked_port_and_binding(session, id)"},{"line_number":1278,"context_line":"        ips_info \u003d updated_port[\u0027fixed_ips\u0027]"},{"line_number":1279,"context_line":"        updated_port \u003d self._make_port_dict(port_db)"},{"line_number":1280,"context_line":"        # Keep up with fields that changed outside ports db"},{"line_number":1281,"context_line":"        updated_port[\u0027fixed_ips\u0027] \u003d ips_info"},{"line_number":1282,"context_line":"        # Notifications must be sent after the above transaction is complete"},{"line_number":1283,"context_line":"        kwargs \u003d {"},{"line_number":1284,"context_line":"            \u0027context\u0027: context,"}],"source_content_type":"text/x-python","patch_set":5,"id":"dab17558_9b036976","line":1281,"range":{"start_line":1277,"start_character":4,"end_line":1281,"end_character":44},"in_reply_to":"dab17558_6e0b862c","updated":"2016-05-12 22:30:59.000000000","message":"I don\u0027t think we should be making any changes to the ml2 plugin itself","commit_id":"83fa9dc0cf4489b781b206408ff8e144c84e9224"}],"neutron/tests/unit/extensions/test_dns.py":[{"author":{"_account_id":4694,"name":"Miguel Lavalle","email":"miguel@mlavalle.com","username":"minsel"},"change_message_id":"15cb575a46a260741343bfd05490a694fb91a9df","unresolved":false,"context_lines":[{"line_number":496,"context_line":"                                    dns_name\u003ddns_name)"},{"line_number":497,"context_line":"            self.assertEqual(201, res.status_code)"},{"line_number":498,"context_line":""},{"line_number":499,"context_line":"    def test_update_network_dns_domain(self):"},{"line_number":500,"context_line":"        with self.network() as network:"},{"line_number":501,"context_line":"            data \u003d {\u0027network\u0027: {\u0027dns_domain\u0027: \u0027my-domain.org.\u0027}}"},{"line_number":502,"context_line":"            req \u003d self.new_update_request(\u0027networks\u0027,"},{"line_number":503,"context_line":"                                          data,"},{"line_number":504,"context_line":"                                          network[\u0027network\u0027][\u0027id\u0027])"},{"line_number":505,"context_line":"            res \u003d req.get_response(self.api)"},{"line_number":506,"context_line":"            self.assertEqual(200, res.status_code)"},{"line_number":507,"context_line":"            self.assertNotIn(\u0027dns_domain\u0027,"},{"line_number":508,"context_line":"                             self.deserialize(self.fmt, res)[\u0027network\u0027])"}],"source_content_type":"text/x-python","patch_set":18,"id":"9abb7d3a_cc7b757a","side":"PARENT","line":508,"range":{"start_line":499,"start_character":3,"end_line":508,"end_character":72},"updated":"2016-06-02 23:04:33.000000000","message":"We still need this test case. But it has to be run with the DB core plugin without the ML2 plugin. So we need to add another test class that only contains this test case. This test class has to inherit from test_db_base_plugin_v2.TestNetworksV2 and its setup method has to be:\n\n    def setUp(self):\n        plugin \u003d (\u0027neutron.tests.unit.extensions.test_dns.\u0027 +\n                  \u0027DnsExtensionTestPlugin\u0027)\n        ext_mgr \u003d DnsExtensionManager()\n        super(DnsExtensionTestCase, self).setUp(plugin\u003dplugin, ext_mgr\u003dext_mgr)","commit_id":"01a9d41ceb02ac43f8a4de1c719d2932dade4df2"},{"author":{"_account_id":4694,"name":"Miguel Lavalle","email":"miguel@mlavalle.com","username":"minsel"},"change_message_id":"2b5112aa7225caaf204f1d35b9b562429ab981b7","unresolved":false,"context_lines":[{"line_number":501,"context_line":"            self.assertEqual(201, res.status_code)"},{"line_number":502,"context_line":""},{"line_number":503,"context_line":""},{"line_number":504,"context_line":"class DnsExtensionTestNetworkDnsDomain(test_db_base_plugin_v2.TestNetworksV2):"},{"line_number":505,"context_line":"    def setUp(self):"},{"line_number":506,"context_line":"        plugin \u003d (\u0027neutron.tests.unit.extensions.test_dns.\u0027 +"},{"line_number":507,"context_line":"                  \u0027DnsExtensionTestPlugin\u0027)"}],"source_content_type":"text/x-python","patch_set":19,"id":"9abb7d3a_cc6d029b","line":504,"range":{"start_line":504,"start_character":39,"end_line":504,"end_character":76},"updated":"2016-06-05 23:07:49.000000000","message":"When I originally wrote this test module, I made a mistake, which got merged. Please look at line 50 here:\n\nhttps://review.openstack.org/#/c/200952/24/neutron/tests/unit/extensions/test_dns.py\n\nThat is why are also running networks test cases, which we shouldn\u0027t. The correct class to inherit from is test_db_base_plugin_v2.NeutronDbPluginV2TestCase.\n\nI hope you don\u0027t mind fixing my mistake ;-)","commit_id":"7a992ba275437c581de117b569b7504b8b0d7448"},{"author":{"_account_id":20671,"name":"bin","email":"froyo.bin@gmail.com","username":"binyu"},"change_message_id":"415e552dc4fe44317f905268e2c75724b8a1559e","unresolved":false,"context_lines":[{"line_number":501,"context_line":"            self.assertEqual(201, res.status_code)"},{"line_number":502,"context_line":""},{"line_number":503,"context_line":""},{"line_number":504,"context_line":"class DnsExtensionTestNetworkDnsDomain(test_db_base_plugin_v2.TestNetworksV2):"},{"line_number":505,"context_line":"    def setUp(self):"},{"line_number":506,"context_line":"        plugin \u003d (\u0027neutron.tests.unit.extensions.test_dns.\u0027 +"},{"line_number":507,"context_line":"                  \u0027DnsExtensionTestPlugin\u0027)"}],"source_content_type":"text/x-python","patch_set":19,"id":"7aa08908_3126f468","line":504,"range":{"start_line":504,"start_character":39,"end_line":504,"end_character":76},"in_reply_to":"9abb7d3a_cc6d029b","updated":"2016-06-06 02:00:57.000000000","message":"It\u0027s my pleasure, I have replaced this class with NeutronDbPluginV2TestCase. When I was on PS19, I was a little confusing why we should run the base test cases, but I couldn\u0027t find a proper class and thought you may intend to do that in your codes :)","commit_id":"7a992ba275437c581de117b569b7504b8b0d7448"}],"neutron/tests/unit/plugins/ml2/extensions/test_dns_integration.py":[{"author":{"_account_id":20671,"name":"bin","email":"froyo.bin@gmail.com","username":"binyu"},"change_message_id":"25d31046ed0c48588a90e9ef9112a60618252f7e","unresolved":false,"context_lines":[{"line_number":125,"context_line":"                         current_dns_name\u003dDNSNAME, previous_dns_name\u003d\u0027\u0027):"},{"line_number":126,"context_line":"        if dns_name and dns_domain and provider_net and dns_driver:"},{"line_number":127,"context_line":"            self.assertEqual(current_dns_name, dns_data_db[\u0027current_dns_name\u0027])"},{"line_number":128,"context_line":"            self.assertEqual(current_dns_name, port[dns.DNSNAME])"},{"line_number":129,"context_line":"            self.assertEqual(previous_dns_name,"},{"line_number":130,"context_line":"                             dns_data_db[\u0027previous_dns_name\u0027])"},{"line_number":131,"context_line":"            if current_dns_name:"}],"source_content_type":"text/x-python","patch_set":5,"id":"dab17558_6e7b862a","line":128,"range":{"start_line":128,"start_character":9,"end_line":128,"end_character":65},"updated":"2016-05-12 10:39:17.000000000","message":"as we remove the dns_name in port db and retrive the port dns information from portdns db, so the port[dns.DNSNAME] is consistent with the  dns_data_db[\u0027current_dns_name\u0027]","commit_id":"83fa9dc0cf4489b781b206408ff8e144c84e9224"},{"author":{"_account_id":20671,"name":"bin","email":"froyo.bin@gmail.com","username":"binyu"},"change_message_id":"25d31046ed0c48588a90e9ef9112a60618252f7e","unresolved":false,"context_lines":[{"line_number":203,"context_line":"                len(expected_delete))"},{"line_number":204,"context_line":"        else:"},{"line_number":205,"context_line":"            self.assertTrue(dns_data_db is None)"},{"line_number":206,"context_line":"            self.assertTrue(port[dns.DNSNAME] \u003d\u003d \u0027\u0027)"},{"line_number":207,"context_line":"            self.assertFalse(mock_client.recordsets.create.call_args_list)"},{"line_number":208,"context_line":"            self.assertFalse("},{"line_number":209,"context_line":"                mock_admin_client.recordsets.create.call_args_list)"}],"source_content_type":"text/x-python","patch_set":5,"id":"dab17558_eeb496d5","line":206,"range":{"start_line":206,"start_character":11,"end_line":206,"end_character":51},"updated":"2016-05-12 10:39:17.000000000","message":"if we have no dns_data_db, we should also have empty dns_name in returned port dictionary","commit_id":"83fa9dc0cf4489b781b206408ff8e144c84e9224"},{"author":{"_account_id":20671,"name":"bin","email":"froyo.bin@gmail.com","username":"binyu"},"change_message_id":"089e905d1274fcf14ed928658434c6bf9ca64438","unresolved":false,"context_lines":[{"line_number":55,"context_line":"        dns_integration.subscribe()"},{"line_number":56,"context_line":"        self.plugin \u003d manager.NeutronManager.get_plugin()"},{"line_number":57,"context_line":"        self.network \u003d None"},{"line_number":58,"context_line":"        self.testdomains \u003d [DNSDOMAIN, DEFAULTDOMAIN]"},{"line_number":59,"context_line":""},{"line_number":60,"context_line":"    def _reset_mock_records(self):"},{"line_number":61,"context_line":"        mock_client.reset_mock()"}],"source_content_type":"text/x-python","patch_set":15,"id":"9abb7d3a_5fc0a92a","line":58,"range":{"start_line":58,"start_character":2,"end_line":58,"end_character":53},"updated":"2016-05-30 10:41:05.000000000","message":"To test the two scenarios with one test case","commit_id":"37ded29bc3f79f2b5c9e8da13647dc8ca3cea83e"},{"author":{"_account_id":4694,"name":"Miguel Lavalle","email":"miguel@mlavalle.com","username":"minsel"},"change_message_id":"60245b99b04d2f500d4bfab9034b5c79790efbf4","unresolved":false,"context_lines":[{"line_number":282,"context_line":"        for domain in self.testdomains:"},{"line_number":283,"context_line":"            config.cfg.CONF.set_override(\u0027dns_domain\u0027, domain)"},{"line_number":284,"context_line":"            net, port, dns_data_db \u003d self._create_port_for_test()"},{"line_number":285,"context_line":"            if domain \u003d\u003d \u0027openstacklocal.\u0027:"},{"line_number":286,"context_line":"                self._verify_port_dns(net, port, dns_data_db,"},{"line_number":287,"context_line":"                                      default_dns_domain\u003dTrue)"},{"line_number":288,"context_line":"            else:"},{"line_number":289,"context_line":"                self._verify_port_dns(net, port, dns_data_db,"},{"line_number":290,"context_line":"                                      default_dns_domain\u003dFalse)"},{"line_number":291,"context_line":"            self._reset_mock_records()"},{"line_number":292,"context_line":""},{"line_number":293,"context_line":"    def test_create_port_tenant_network(self, *mocks):"}],"source_content_type":"text/x-python","patch_set":17,"id":"9abb7d3a_a7b3fe96","line":290,"range":{"start_line":285,"start_character":12,"end_line":290,"end_character":62},"updated":"2016-06-01 18:34:50.000000000","message":"In my previous review, I recommended going back to the version of this test_dns_integration.py of PS11 and just add a couple of test cases to it. After seeing what you did here, I think you are right in running all the tests cases with dns_domain \u003d\u003d \u0027openstacklocal\u0027. But I think you can achieve a much cleaner implementation. Instead of adding all this if else and for statements, I suggest just create a child class that inherits from this and redefine _verify_port_dns with the code you have in _verify_port_dns_default_domain_name. That way, you re-use most of these test cases without touching them and we don\u0027t clutter the test cases with all these if then and for statements. What is inheritance for? ;-) It is not going to be completely clean for all the test cases but it is going to work for most of them.\n\nYou are going to need to define a self.testdomain variable that is initialized with the correct domain for each class","commit_id":"e2c4cafff5b7c8486b8785d12de6084fce07fe09"},{"author":{"_account_id":4694,"name":"Miguel Lavalle","email":"miguel@mlavalle.com","username":"minsel"},"change_message_id":"15cb575a46a260741343bfd05490a694fb91a9df","unresolved":false,"context_lines":[{"line_number":515,"context_line":"                         dns_domain\u003dTrue, ptr_zones\u003dTrue, delete_records\u003dFalse,"},{"line_number":516,"context_line":"                         provider_net\u003dTrue, dns_driver\u003dTrue, original_ips\u003dNone,"},{"line_number":517,"context_line":"                         current_dns_name\u003dDNSNAME, previous_dns_name\u003d\u0027\u0027,"},{"line_number":518,"context_line":"                         default_dns_domain\u003dFalse):"},{"line_number":519,"context_line":"        self.assertEqual(\u0027\u0027, port[dns.DNSNAME])"},{"line_number":520,"context_line":"        fqdn_set \u003d self._generate_dns_assignment(port)"},{"line_number":521,"context_line":"        port_fqdn_set \u003d set([each[\u0027fqdn\u0027] for each in port[\u0027dns_assignment\u0027]])"}],"source_content_type":"text/x-python","patch_set":18,"id":"9abb7d3a_48edba8d","line":518,"range":{"start_line":518,"start_character":25,"end_line":518,"end_character":49},"updated":"2016-06-02 23:04:33.000000000","message":"You don\u0027t need this. It is not used anywhere","commit_id":"ceb05dd94aeb22fe21e9228b6a735dac385b0c75"},{"author":{"_account_id":4694,"name":"Miguel Lavalle","email":"miguel@mlavalle.com","username":"minsel"},"change_message_id":"38072a9282827650e526ee6c5a0ce9d92c724b78","unresolved":false,"context_lines":[{"line_number":484,"context_line":"        self._verify_port_dns(net, port, dns_data_db)"},{"line_number":485,"context_line":""},{"line_number":486,"context_line":""},{"line_number":487,"context_line":"class TestDesignateClient(testtools.TestCase):"},{"line_number":488,"context_line":"    \"\"\"Test case for designate clients \"\"\""},{"line_number":489,"context_line":""},{"line_number":490,"context_line":"    TEST_URL \u003d \u0027http://127.0.0.1:9001/v2\u0027"},{"line_number":491,"context_line":"    TEST_ADMIN_USERNAME \u003d uuid.uuid4().hex"},{"line_number":492,"context_line":"    TEST_ADMIN_PASSWORD \u003d uuid.uuid4().hex"},{"line_number":493,"context_line":"    TEST_ADMIN_TENANT_NAME \u003d uuid.uuid4().hex"},{"line_number":494,"context_line":"    TEST_ADMIN_TENANT_ID \u003d uuid.uuid4().hex"},{"line_number":495,"context_line":"    TEST_ADMIN_AUTH_URL \u003d \u0027http://127.0.0.1:35357/v2.0\u0027"},{"line_number":496,"context_line":"    TEST_CA_CERT \u003d uuid.uuid4().hex"},{"line_number":497,"context_line":""},{"line_number":498,"context_line":"    TEST_CONTEXT \u003d mock.Mock()"},{"line_number":499,"context_line":"    TEST_CONTEXT.auth_token \u003d uuid.uuid4().hex"},{"line_number":500,"context_line":""},{"line_number":501,"context_line":"    def setUp(self):"},{"line_number":502,"context_line":"        super(TestDesignateClient, self).setUp()"},{"line_number":503,"context_line":"        config.cfg.CONF.set_override(\u0027url\u0027,"},{"line_number":504,"context_line":"                                     self.TEST_URL,"},{"line_number":505,"context_line":"                                     group\u003d\u0027designate\u0027)"},{"line_number":506,"context_line":"        config.cfg.CONF.set_override(\u0027admin_username\u0027,"},{"line_number":507,"context_line":"                                     self.TEST_ADMIN_USERNAME,"},{"line_number":508,"context_line":"                                     group\u003d\u0027designate\u0027)"},{"line_number":509,"context_line":"        config.cfg.CONF.set_override(\u0027admin_password\u0027,"},{"line_number":510,"context_line":"                                     self.TEST_ADMIN_PASSWORD,"},{"line_number":511,"context_line":"                                     group\u003d\u0027designate\u0027)"},{"line_number":512,"context_line":"        config.cfg.CONF.set_override(\u0027admin_auth_url\u0027,"},{"line_number":513,"context_line":"                                     self.TEST_ADMIN_AUTH_URL,"},{"line_number":514,"context_line":"                                     group\u003d\u0027designate\u0027)"},{"line_number":515,"context_line":"        config.cfg.CONF.set_override(\u0027admin_tenant_id\u0027,"},{"line_number":516,"context_line":"                                     self.TEST_ADMIN_TENANT_ID,"},{"line_number":517,"context_line":"                                     group\u003d\u0027designate\u0027)"},{"line_number":518,"context_line":"        config.cfg.CONF.set_override(\u0027admin_tenant_name\u0027,"},{"line_number":519,"context_line":"                                     self.TEST_ADMIN_TENANT_NAME,"},{"line_number":520,"context_line":"                                     group\u003d\u0027designate\u0027)"},{"line_number":521,"context_line":""},{"line_number":522,"context_line":"        driver.session.Session \u003d mock.MagicMock()"},{"line_number":523,"context_line":""},{"line_number":524,"context_line":"    def test_insecure_client(self):"},{"line_number":525,"context_line":"        config.cfg.CONF.set_override(\u0027insecure\u0027,"},{"line_number":526,"context_line":"                                     True,"},{"line_number":527,"context_line":"                                     group\u003d\u0027designate\u0027)"},{"line_number":528,"context_line":"        driver.get_clients(self.TEST_CONTEXT)"},{"line_number":529,"context_line":"        driver.session.Session.assert_called_with(verify\u003dFalse)"},{"line_number":530,"context_line":""},{"line_number":531,"context_line":"    def test_secure_client(self):"},{"line_number":532,"context_line":"        config.cfg.CONF.set_override(\u0027insecure\u0027,"},{"line_number":533,"context_line":"                                     False,"},{"line_number":534,"context_line":"                                     group\u003d\u0027designate\u0027)"},{"line_number":535,"context_line":"        config.cfg.CONF.set_override(\u0027ca_cert\u0027,"},{"line_number":536,"context_line":"                                     self.TEST_CA_CERT,"},{"line_number":537,"context_line":"                                     group\u003d\u0027designate\u0027)"},{"line_number":538,"context_line":"        driver.get_clients(self.TEST_CONTEXT)"},{"line_number":539,"context_line":"        driver.session.Session.assert_called_with(verify\u003dself.TEST_CA_CERT)"},{"line_number":540,"context_line":""},{"line_number":541,"context_line":""},{"line_number":542,"context_line":"class DNSIntegrationTestCaseDefaultDomain(DNSIntegrationTestCase):"}],"source_content_type":"text/x-python","patch_set":27,"id":"5a9d85d2_ef02d06e","line":539,"range":{"start_line":487,"start_character":0,"end_line":539,"end_character":75},"updated":"2016-06-20 00:13:47.000000000","message":"These changes come from https://review.openstack.org/#/c/326958/. Please resolve this merge conflict following the instructions I posted in PS25","commit_id":"e11579bec96ba248de5219a9c8c692390fed1b3d"},{"author":{"_account_id":20671,"name":"bin","email":"froyo.bin@gmail.com","username":"binyu"},"change_message_id":"5ed59a1fe6b4a8636a339741121cd3595680c834","unresolved":false,"context_lines":[{"line_number":484,"context_line":"        self._verify_port_dns(net, port, dns_data_db)"},{"line_number":485,"context_line":""},{"line_number":486,"context_line":""},{"line_number":487,"context_line":"class TestDesignateClient(testtools.TestCase):"},{"line_number":488,"context_line":"    \"\"\"Test case for designate clients \"\"\""},{"line_number":489,"context_line":""},{"line_number":490,"context_line":"    TEST_URL \u003d \u0027http://127.0.0.1:9001/v2\u0027"},{"line_number":491,"context_line":"    TEST_ADMIN_USERNAME \u003d uuid.uuid4().hex"},{"line_number":492,"context_line":"    TEST_ADMIN_PASSWORD \u003d uuid.uuid4().hex"},{"line_number":493,"context_line":"    TEST_ADMIN_TENANT_NAME \u003d uuid.uuid4().hex"},{"line_number":494,"context_line":"    TEST_ADMIN_TENANT_ID \u003d uuid.uuid4().hex"},{"line_number":495,"context_line":"    TEST_ADMIN_AUTH_URL \u003d \u0027http://127.0.0.1:35357/v2.0\u0027"},{"line_number":496,"context_line":"    TEST_CA_CERT \u003d uuid.uuid4().hex"},{"line_number":497,"context_line":""},{"line_number":498,"context_line":"    TEST_CONTEXT \u003d mock.Mock()"},{"line_number":499,"context_line":"    TEST_CONTEXT.auth_token \u003d uuid.uuid4().hex"},{"line_number":500,"context_line":""},{"line_number":501,"context_line":"    def setUp(self):"},{"line_number":502,"context_line":"        super(TestDesignateClient, self).setUp()"},{"line_number":503,"context_line":"        config.cfg.CONF.set_override(\u0027url\u0027,"},{"line_number":504,"context_line":"                                     self.TEST_URL,"},{"line_number":505,"context_line":"                                     group\u003d\u0027designate\u0027)"},{"line_number":506,"context_line":"        config.cfg.CONF.set_override(\u0027admin_username\u0027,"},{"line_number":507,"context_line":"                                     self.TEST_ADMIN_USERNAME,"},{"line_number":508,"context_line":"                                     group\u003d\u0027designate\u0027)"},{"line_number":509,"context_line":"        config.cfg.CONF.set_override(\u0027admin_password\u0027,"},{"line_number":510,"context_line":"                                     self.TEST_ADMIN_PASSWORD,"},{"line_number":511,"context_line":"                                     group\u003d\u0027designate\u0027)"},{"line_number":512,"context_line":"        config.cfg.CONF.set_override(\u0027admin_auth_url\u0027,"},{"line_number":513,"context_line":"                                     self.TEST_ADMIN_AUTH_URL,"},{"line_number":514,"context_line":"                                     group\u003d\u0027designate\u0027)"},{"line_number":515,"context_line":"        config.cfg.CONF.set_override(\u0027admin_tenant_id\u0027,"},{"line_number":516,"context_line":"                                     self.TEST_ADMIN_TENANT_ID,"},{"line_number":517,"context_line":"                                     group\u003d\u0027designate\u0027)"},{"line_number":518,"context_line":"        config.cfg.CONF.set_override(\u0027admin_tenant_name\u0027,"},{"line_number":519,"context_line":"                                     self.TEST_ADMIN_TENANT_NAME,"},{"line_number":520,"context_line":"                                     group\u003d\u0027designate\u0027)"},{"line_number":521,"context_line":""},{"line_number":522,"context_line":"        driver.session.Session \u003d mock.MagicMock()"},{"line_number":523,"context_line":""},{"line_number":524,"context_line":"    def test_insecure_client(self):"},{"line_number":525,"context_line":"        config.cfg.CONF.set_override(\u0027insecure\u0027,"},{"line_number":526,"context_line":"                                     True,"},{"line_number":527,"context_line":"                                     group\u003d\u0027designate\u0027)"},{"line_number":528,"context_line":"        driver.get_clients(self.TEST_CONTEXT)"},{"line_number":529,"context_line":"        driver.session.Session.assert_called_with(verify\u003dFalse)"},{"line_number":530,"context_line":""},{"line_number":531,"context_line":"    def test_secure_client(self):"},{"line_number":532,"context_line":"        config.cfg.CONF.set_override(\u0027insecure\u0027,"},{"line_number":533,"context_line":"                                     False,"},{"line_number":534,"context_line":"                                     group\u003d\u0027designate\u0027)"},{"line_number":535,"context_line":"        config.cfg.CONF.set_override(\u0027ca_cert\u0027,"},{"line_number":536,"context_line":"                                     self.TEST_CA_CERT,"},{"line_number":537,"context_line":"                                     group\u003d\u0027designate\u0027)"},{"line_number":538,"context_line":"        driver.get_clients(self.TEST_CONTEXT)"},{"line_number":539,"context_line":"        driver.session.Session.assert_called_with(verify\u003dself.TEST_CA_CERT)"},{"line_number":540,"context_line":""},{"line_number":541,"context_line":""},{"line_number":542,"context_line":"class DNSIntegrationTestCaseDefaultDomain(DNSIntegrationTestCase):"}],"source_content_type":"text/x-python","patch_set":27,"id":"5a9d85d2_857e8dac","line":539,"range":{"start_line":487,"start_character":0,"end_line":539,"end_character":75},"in_reply_to":"5a9d85d2_ef02d06e","updated":"2016-06-20 03:23:41.000000000","message":"Done. Hopefully my update meet your requirements. I have do some merge  test and unfortunately,cannot find the way to hide the whole patch set from  https://review.openstack.org/#/c/326958/ :(","commit_id":"e11579bec96ba248de5219a9c8c692390fed1b3d"},{"author":{"_account_id":8726,"name":"Victor Morales","email":"chipahuac@hotmail.com","username":"electrocucaracha"},"change_message_id":"3e096f85ac4e8db3ad0a0c7236771ca424a6e5f2","unresolved":false,"context_lines":[{"line_number":58,"context_line":"        dns_integration.DNS_DRIVER \u003d None"},{"line_number":59,"context_line":"        dns_integration.subscribe()"},{"line_number":60,"context_line":"        self.plugin \u003d manager.NeutronManager.get_plugin()"},{"line_number":61,"context_line":"        config.cfg.CONF.set_override(\u0027dns_domain\u0027, self._domain)"},{"line_number":62,"context_line":""},{"line_number":63,"context_line":"    def _create_port_for_test(self, provider_net\u003dTrue, dns_domain\u003dTrue,"},{"line_number":64,"context_line":"                              dns_name\u003dTrue, ipv4\u003dTrue, ipv6\u003dTrue):"}],"source_content_type":"text/x-python","patch_set":32,"id":"fad55976_45ff7934","line":61,"updated":"2016-07-15 18:11:29.000000000","message":"I like this refactor","commit_id":"0df06a08190b02e43a6d0facbe529a12341ad743"}]}
