)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":13717,"name":"Inessa Vasilevskaya","email":"ivasilevskaya@mirantis.com","username":"ivasilevskaya"},"change_message_id":"5a3642bc4dc92a4f730252c1149a4c5e18a4fddf","unresolved":false,"context_lines":[{"line_number":6,"context_line":""},{"line_number":7,"context_line":"Add a unique key to port_id in routerports table"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"If multiple commands to add router interfaces to different routers"},{"line_number":10,"context_line":"by the same port concurrently. All the commands would show success."},{"line_number":11,"context_line":"However, there are three issues:"},{"line_number":12,"context_line":"1. Only one router interface is actually added by the port"},{"line_number":13,"context_line":"2. Multiple router ports records are stored in routerports table"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":20,"id":"dada55a8_8dd55c44","line":10,"range":{"start_line":9,"start_character":45,"end_line":10,"end_character":29},"updated":"2016-07-27 08:25:35.000000000","message":"Nit: action item missed (are executed?)\n... same port are executed concurrently, then all ...","commit_id":"03c1a1c26f0766faa1a23681cb2a1bd40cf102ee"},{"author":{"_account_id":17491,"name":"Lujin Luo","email":"luo.lujin@jp.fujitsu.com","username":"Lujin"},"change_message_id":"0d73889d2508b892dd7658b7bf34794a239cd857","unresolved":false,"context_lines":[{"line_number":6,"context_line":""},{"line_number":7,"context_line":"Add a unique key to port_id in routerports table"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"If multiple commands to add router interfaces to different routers"},{"line_number":10,"context_line":"by the same port concurrently. All the commands would show success."},{"line_number":11,"context_line":"However, there are three issues:"},{"line_number":12,"context_line":"1. Only one router interface is actually added by the port"},{"line_number":13,"context_line":"2. Multiple router ports records are stored in routerports table"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":20,"id":"bacf61ea_0b3744b1","line":10,"range":{"start_line":9,"start_character":45,"end_line":10,"end_character":29},"in_reply_to":"dada55a8_8dd55c44","updated":"2016-07-28 01:33:30.000000000","message":"oops, i will fix this one","commit_id":"03c1a1c26f0766faa1a23681cb2a1bd40cf102ee"},{"author":{"_account_id":13717,"name":"Inessa Vasilevskaya","email":"ivasilevskaya@mirantis.com","username":"ivasilevskaya"},"change_message_id":"5a3642bc4dc92a4f730252c1149a4c5e18a4fddf","unresolved":false,"context_lines":[{"line_number":12,"context_line":"1. Only one router interface is actually added by the port"},{"line_number":13,"context_line":"2. Multiple router ports records are stored in routerports table"},{"line_number":14,"context_line":"3. The port table is updated multiple times and eventually the"},{"line_number":15,"context_line":"last-arrived command would trully take effect"},{"line_number":16,"context_line":""},{"line_number":17,"context_line":"This patch adds a unique key to port_id, so that only the first-"},{"line_number":18,"context_line":"arrived command will insert router port record and all the latter"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":20,"id":"dada55a8_0dc20c85","line":15,"range":{"start_line":15,"start_character":27,"end_line":15,"end_character":33},"updated":"2016-07-27 08:25:35.000000000","message":"s/trully/truly","commit_id":"03c1a1c26f0766faa1a23681cb2a1bd40cf102ee"},{"author":{"_account_id":17491,"name":"Lujin Luo","email":"luo.lujin@jp.fujitsu.com","username":"Lujin"},"change_message_id":"0d73889d2508b892dd7658b7bf34794a239cd857","unresolved":false,"context_lines":[{"line_number":12,"context_line":"1. Only one router interface is actually added by the port"},{"line_number":13,"context_line":"2. Multiple router ports records are stored in routerports table"},{"line_number":14,"context_line":"3. The port table is updated multiple times and eventually the"},{"line_number":15,"context_line":"last-arrived command would trully take effect"},{"line_number":16,"context_line":""},{"line_number":17,"context_line":"This patch adds a unique key to port_id, so that only the first-"},{"line_number":18,"context_line":"arrived command will insert router port record and all the latter"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":20,"id":"bacf61ea_cbbeccfe","line":15,"range":{"start_line":15,"start_character":27,"end_line":15,"end_character":33},"in_reply_to":"dada55a8_0dc20c85","updated":"2016-07-28 01:33:30.000000000","message":"Done","commit_id":"03c1a1c26f0766faa1a23681cb2a1bd40cf102ee"},{"author":{"_account_id":13717,"name":"Inessa Vasilevskaya","email":"ivasilevskaya@mirantis.com","username":"ivasilevskaya"},"change_message_id":"5a3642bc4dc92a4f730252c1149a4c5e18a4fddf","unresolved":false,"context_lines":[{"line_number":15,"context_line":"last-arrived command would trully take effect"},{"line_number":16,"context_line":""},{"line_number":17,"context_line":"This patch adds a unique key to port_id, so that only the first-"},{"line_number":18,"context_line":"arrived command will insert router port record and all the latter"},{"line_number":19,"context_line":"requests would raise exceptions. Besides, the patch updates port"},{"line_number":20,"context_line":"table after router port record is inserted to keep consistency."},{"line_number":21,"context_line":""}],"source_content_type":"text/x-gerrit-commit-message","patch_set":20,"id":"dada55a8_8d3c3c94","line":18,"range":{"start_line":18,"start_character":55,"end_line":18,"end_character":65},"updated":"2016-07-27 08:25:35.000000000","message":"Nit: all later requests?","commit_id":"03c1a1c26f0766faa1a23681cb2a1bd40cf102ee"},{"author":{"_account_id":17491,"name":"Lujin Luo","email":"luo.lujin@jp.fujitsu.com","username":"Lujin"},"change_message_id":"0d73889d2508b892dd7658b7bf34794a239cd857","unresolved":false,"context_lines":[{"line_number":15,"context_line":"last-arrived command would trully take effect"},{"line_number":16,"context_line":""},{"line_number":17,"context_line":"This patch adds a unique key to port_id, so that only the first-"},{"line_number":18,"context_line":"arrived command will insert router port record and all the latter"},{"line_number":19,"context_line":"requests would raise exceptions. Besides, the patch updates port"},{"line_number":20,"context_line":"table after router port record is inserted to keep consistency."},{"line_number":21,"context_line":""}],"source_content_type":"text/x-gerrit-commit-message","patch_set":20,"id":"bacf61ea_abbb980d","line":18,"range":{"start_line":18,"start_character":55,"end_line":18,"end_character":65},"in_reply_to":"dada55a8_8d3c3c94","updated":"2016-07-28 01:33:30.000000000","message":"Done","commit_id":"03c1a1c26f0766faa1a23681cb2a1bd40cf102ee"},{"author":{"_account_id":13717,"name":"Inessa Vasilevskaya","email":"ivasilevskaya@mirantis.com","username":"ivasilevskaya"},"change_message_id":"ac4c6fe2da06965b7b82533d88b2b958b672a82a","unresolved":false,"context_lines":[{"line_number":20,"context_line":"so that only the first-arrived command will insert router port"},{"line_number":21,"context_line":"record and all later requests would raise exceptions."},{"line_number":22,"context_line":""},{"line_number":23,"context_line":"Besides, port.device_id and port.device_owner in  port table"},{"line_number":24,"context_line":"needs to be updated again after routerport record is inserted."},{"line_number":25,"context_line":"Otherwise, in race condition the port table will store the router"},{"line_number":26,"context_line":"information from last-arrived request. However, in routerport table,"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":25,"id":"bacf61ea_fa7c3ced","line":23,"range":{"start_line":23,"start_character":48,"end_line":23,"end_character":50},"updated":"2016-08-02 19:21:19.000000000","message":"Nit: double space","commit_id":"ca19831a87ab0ad59e7cb31879143977356c77c2"},{"author":{"_account_id":17491,"name":"Lujin Luo","email":"luo.lujin@jp.fujitsu.com","username":"Lujin"},"change_message_id":"8f278ffad49c87c0cf9882c89356cdbbd0dfd179","unresolved":false,"context_lines":[{"line_number":20,"context_line":"so that only the first-arrived command will insert router port"},{"line_number":21,"context_line":"record and all later requests would raise exceptions."},{"line_number":22,"context_line":""},{"line_number":23,"context_line":"Besides, port.device_id and port.device_owner in  port table"},{"line_number":24,"context_line":"needs to be updated again after routerport record is inserted."},{"line_number":25,"context_line":"Otherwise, in race condition the port table will store the router"},{"line_number":26,"context_line":"information from last-arrived request. However, in routerport table,"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":25,"id":"bacf61ea_f8739d13","line":23,"range":{"start_line":23,"start_character":48,"end_line":23,"end_character":50},"in_reply_to":"bacf61ea_fa7c3ced","updated":"2016-08-02 23:54:42.000000000","message":"Done","commit_id":"ca19831a87ab0ad59e7cb31879143977356c77c2"}],"neutron/db/l3_db.py":[{"author":{"_account_id":5367,"name":"boden","email":"bodenvmw@gmail.com","username":"boden"},"change_message_id":"aba3fd93f36b55e69073f79a432bad1d0183064d","unresolved":false,"context_lines":[{"line_number":84,"context_line":"        lazy\u003d\u0027joined\u0027)"},{"line_number":85,"context_line":"    __table_args__ \u003d ("},{"line_number":86,"context_line":"        sa.UniqueConstraint("},{"line_number":87,"context_line":"            port_id, port_type,"},{"line_number":88,"context_line":"            name\u003d\u0027uniq_routerports0port_id0port_type\u0027),"},{"line_number":89,"context_line":"        model_base.BASEV2.__table_args__,)"},{"line_number":90,"context_line":""}],"source_content_type":"text/x-python","patch_set":10,"id":"7aa08908_8f8f4722","line":87,"range":{"start_line":87,"start_character":21,"end_line":87,"end_character":30},"updated":"2016-06-17 14:48:09.000000000","message":"Newbie question: why is port_type needed in this constraint, wouldn\u0027t port_id be enough?","commit_id":"733d89bed32754a0ff48f17883ac622ffe83cd6e"},{"author":{"_account_id":17491,"name":"Lujin Luo","email":"luo.lujin@jp.fujitsu.com","username":"Lujin"},"change_message_id":"dd9bcfd4f6bc6f3b217b67657dae1fd7675881ee","unresolved":false,"context_lines":[{"line_number":84,"context_line":"        lazy\u003d\u0027joined\u0027)"},{"line_number":85,"context_line":"    __table_args__ \u003d ("},{"line_number":86,"context_line":"        sa.UniqueConstraint("},{"line_number":87,"context_line":"            port_id, port_type,"},{"line_number":88,"context_line":"            name\u003d\u0027uniq_routerports0port_id0port_type\u0027),"},{"line_number":89,"context_line":"        model_base.BASEV2.__table_args__,)"},{"line_number":90,"context_line":""}],"source_content_type":"text/x-python","patch_set":10,"id":"5a9d85d2_7f73f780","line":87,"range":{"start_line":87,"start_character":21,"end_line":87,"end_character":30},"in_reply_to":"7aa08908_8f8f4722","updated":"2016-06-21 05:45:40.000000000","message":"I tested with port_id to be unique only, and it turned out you are correct! I have reflected this comment on the patch 12. Please kindly review again! :)","commit_id":"733d89bed32754a0ff48f17883ac622ffe83cd6e"},{"author":{"_account_id":17491,"name":"Lujin Luo","email":"luo.lujin@jp.fujitsu.com","username":"Lujin"},"change_message_id":"c49fa4b87c282bd6b2c993bb3109e738f33dc880","unresolved":false,"context_lines":[{"line_number":84,"context_line":"        lazy\u003d\u0027joined\u0027)"},{"line_number":85,"context_line":"    __table_args__ \u003d ("},{"line_number":86,"context_line":"        sa.UniqueConstraint("},{"line_number":87,"context_line":"            port_id, port_type,"},{"line_number":88,"context_line":"            name\u003d\u0027uniq_routerports0port_id0port_type\u0027),"},{"line_number":89,"context_line":"        model_base.BASEV2.__table_args__,)"},{"line_number":90,"context_line":""}],"source_content_type":"text/x-python","patch_set":10,"id":"5a9d85d2_7f4017a6","line":87,"range":{"start_line":87,"start_character":21,"end_line":87,"end_character":30},"in_reply_to":"7aa08908_8f8f4722","updated":"2016-06-21 05:51:10.000000000","message":"Patch 13 actually. Sorry for the spam","commit_id":"733d89bed32754a0ff48f17883ac622ffe83cd6e"},{"author":{"_account_id":13717,"name":"Inessa Vasilevskaya","email":"ivasilevskaya@mirantis.com","username":"ivasilevskaya"},"change_message_id":"5a3642bc4dc92a4f730252c1149a4c5e18a4fddf","unresolved":false,"context_lines":[{"line_number":785,"context_line":"                # Update owner after actual process again in order to"},{"line_number":786,"context_line":"                # make sure the records in routerports table and ports"},{"line_number":787,"context_line":"                # table are consistent."},{"line_number":788,"context_line":"                self._core_plugin.update_port("},{"line_number":789,"context_line":"                    context, port[\u0027id\u0027], {\u0027port\u0027: {"},{"line_number":790,"context_line":"                                         \u0027device_id\u0027: router.id,"},{"line_number":791,"context_line":"                                         \u0027device_owner\u0027: device_owner}})"},{"line_number":792,"context_line":"            except db_exc.DBDuplicateEntry:"},{"line_number":793,"context_line":"                port \u003d self._core_plugin.get_port(context, port[\u0027id\u0027])"},{"line_number":794,"context_line":"                raise n_exc.PortInUse(net_id\u003dport[\u0027network_id\u0027],"}],"source_content_type":"text/x-python","patch_set":20,"id":"dada55a8_0ddb2c7d","line":791,"range":{"start_line":788,"start_character":16,"end_line":791,"end_character":72},"updated":"2016-07-27 08:25:35.000000000","message":"Why do we have to explicitly call update_port here? Won\u0027t router_port.port \u003d port be enough?","commit_id":"03c1a1c26f0766faa1a23681cb2a1bd40cf102ee"},{"author":{"_account_id":7787,"name":"Kevin Benton","email":"kevin@benton.pub","username":"blak111"},"change_message_id":"27bc0382b1e0ee3016ee2e1dc6744f3b9dbcfbc7","unresolved":false,"context_lines":[{"line_number":785,"context_line":"                # Update owner after actual process again in order to"},{"line_number":786,"context_line":"                # make sure the records in routerports table and ports"},{"line_number":787,"context_line":"                # table are consistent."},{"line_number":788,"context_line":"                self._core_plugin.update_port("},{"line_number":789,"context_line":"                    context, port[\u0027id\u0027], {\u0027port\u0027: {"},{"line_number":790,"context_line":"                                         \u0027device_id\u0027: router.id,"},{"line_number":791,"context_line":"                                         \u0027device_owner\u0027: device_owner}})"},{"line_number":792,"context_line":"            except db_exc.DBDuplicateEntry:"},{"line_number":793,"context_line":"                port \u003d self._core_plugin.get_port(context, port[\u0027id\u0027])"},{"line_number":794,"context_line":"                raise n_exc.PortInUse(net_id\u003dport[\u0027network_id\u0027],"}],"source_content_type":"text/x-python","patch_set":20,"id":"dada55a8_cf98e3c2","line":791,"range":{"start_line":788,"start_character":16,"end_line":791,"end_character":72},"in_reply_to":"dada55a8_0ddb2c7d","updated":"2016-07-27 10:41:02.000000000","message":"all port updates need to go through the core plugin so they are propagated to whichever backend is loaded.","commit_id":"03c1a1c26f0766faa1a23681cb2a1bd40cf102ee"},{"author":{"_account_id":17491,"name":"Lujin Luo","email":"luo.lujin@jp.fujitsu.com","username":"Lujin"},"change_message_id":"0d73889d2508b892dd7658b7bf34794a239cd857","unresolved":false,"context_lines":[{"line_number":785,"context_line":"                # Update owner after actual process again in order to"},{"line_number":786,"context_line":"                # make sure the records in routerports table and ports"},{"line_number":787,"context_line":"                # table are consistent."},{"line_number":788,"context_line":"                self._core_plugin.update_port("},{"line_number":789,"context_line":"                    context, port[\u0027id\u0027], {\u0027port\u0027: {"},{"line_number":790,"context_line":"                                         \u0027device_id\u0027: router.id,"},{"line_number":791,"context_line":"                                         \u0027device_owner\u0027: device_owner}})"},{"line_number":792,"context_line":"            except db_exc.DBDuplicateEntry:"},{"line_number":793,"context_line":"                port \u003d self._core_plugin.get_port(context, port[\u0027id\u0027])"},{"line_number":794,"context_line":"                raise n_exc.PortInUse(net_id\u003dport[\u0027network_id\u0027],"}],"source_content_type":"text/x-python","patch_set":20,"id":"bacf61ea_eb863064","line":791,"range":{"start_line":788,"start_character":16,"end_line":791,"end_character":72},"in_reply_to":"dada55a8_cf98e3c2","updated":"2016-07-28 01:33:30.000000000","message":"Hi @Kevin, thanks for the reply. @Inessa, please refer to Kevin\u0027s reply as he explained better than i could do","commit_id":"03c1a1c26f0766faa1a23681cb2a1bd40cf102ee"},{"author":{"_account_id":7787,"name":"Kevin Benton","email":"kevin@benton.pub","username":"blak111"},"change_message_id":"9c8eb133959d455b1cdc7d3caf8cf54b5bf7fd2c","unresolved":false,"context_lines":[{"line_number":785,"context_line":"                # Update owner after actual process again in order to"},{"line_number":786,"context_line":"                # make sure the records in routerports table and ports"},{"line_number":787,"context_line":"                # table are consistent."},{"line_number":788,"context_line":"                self._core_plugin.update_port("},{"line_number":789,"context_line":"                    context, port[\u0027id\u0027], {\u0027port\u0027: {"},{"line_number":790,"context_line":"                                         \u0027device_id\u0027: router.id,"},{"line_number":791,"context_line":"                                         \u0027device_owner\u0027: device_owner}})"}],"source_content_type":"text/x-python","patch_set":21,"id":"bacf61ea_3887f562","line":788,"updated":"2016-07-28 04:59:13.000000000","message":"is this update call actually related to the bug? It seems like it may be fixing a related bug where the user sneaks in a device_owner udpate or something but it\u0027s not clear why this is needed.","commit_id":"81b9c4a1c07f7fbcd46c4ec9efde9df011929c54"},{"author":{"_account_id":17491,"name":"Lujin Luo","email":"luo.lujin@jp.fujitsu.com","username":"Lujin"},"change_message_id":"a80ba562b8cf5a56473ee5140ffe1712f543bd83","unresolved":false,"context_lines":[{"line_number":785,"context_line":"                # Update owner after actual process again in order to"},{"line_number":786,"context_line":"                # make sure the records in routerports table and ports"},{"line_number":787,"context_line":"                # table are consistent."},{"line_number":788,"context_line":"                self._core_plugin.update_port("},{"line_number":789,"context_line":"                    context, port[\u0027id\u0027], {\u0027port\u0027: {"},{"line_number":790,"context_line":"                                         \u0027device_id\u0027: router.id,"},{"line_number":791,"context_line":"                                         \u0027device_owner\u0027: device_owner}})"}],"source_content_type":"text/x-python","patch_set":21,"id":"bacf61ea_d83fb923","line":788,"in_reply_to":"bacf61ea_3887f562","updated":"2016-07-28 05:19:57.000000000","message":"Yes, it is needed. The problem lies in _add_interface_by_port(), which calls _core_plugin.update_port() in line 681. \n\nConsider we have two concurrent requests, called first and second. These two requests will have slight time difference to pass _check_router_port() in _add_interface_by_port(). \n\nThen _core_plugin.update_port() is called sequentially (by sequentially here I mean the slight time difference), so the port update will be changed from blank to first.device_id and first.device_owner. \n\nThen from first.device_id and first.device_owner to second.device_id and second.device_owner. \n\nWhen the two requests come to db transaction, the second request\u0027s insertion will be rolled back, because the record of first request already exists. \n\nIf we do not update port\u0027s device_id and device_owner again here, the info stored in port table is second.device_id and second.device_owner. And this is not correct.","commit_id":"81b9c4a1c07f7fbcd46c4ec9efde9df011929c54"},{"author":{"_account_id":7787,"name":"Kevin Benton","email":"kevin@benton.pub","username":"blak111"},"change_message_id":"ee8ae728333f1bd2c337fffcd9bdfe98bc1175cb","unresolved":false,"context_lines":[{"line_number":783,"context_line":"                        router_id\u003drouter.id,"},{"line_number":784,"context_line":"                        port_type\u003ddevice_owner"},{"line_number":785,"context_line":"                    )"},{"line_number":786,"context_line":"                    context.session.add(router_port)"},{"line_number":787,"context_line":"                # Update owner after actual process again in order to"},{"line_number":788,"context_line":"                # make sure the records in routerports table and ports"},{"line_number":789,"context_line":"                # table are consistent."}],"source_content_type":"text/x-python","patch_set":22,"id":"bacf61ea_ecd727bd","line":786,"updated":"2016-07-29 02:31:57.000000000","message":"move the except block right here then the update_port is completely out of the try:except block.","commit_id":"0f5f1ef8540a8530abc96b69a72bca252c22c60d"},{"author":{"_account_id":17491,"name":"Lujin Luo","email":"luo.lujin@jp.fujitsu.com","username":"Lujin"},"change_message_id":"08ee47e8f7dd62fc66dbe37483af0e79f745826f","unresolved":false,"context_lines":[{"line_number":783,"context_line":"                        router_id\u003drouter.id,"},{"line_number":784,"context_line":"                        port_type\u003ddevice_owner"},{"line_number":785,"context_line":"                    )"},{"line_number":786,"context_line":"                    context.session.add(router_port)"},{"line_number":787,"context_line":"                # Update owner after actual process again in order to"},{"line_number":788,"context_line":"                # make sure the records in routerports table and ports"},{"line_number":789,"context_line":"                # table are consistent."}],"source_content_type":"text/x-python","patch_set":22,"id":"bacf61ea_e2d723bd","line":786,"in_reply_to":"bacf61ea_ecd727bd","updated":"2016-07-29 09:24:36.000000000","message":"I see. I have moved update_port after else keyword. \n\nAnother change to the latest patch is that instead of calling get_port() after except keyword, we make a query to RouterPort table to get the actually stored routerport record\u0027s router_id. This is to avoid the race condition in the below:\n\nfirst: update_port---\u003eadd routerport record----NO exception----\u003eupdate_port\nsecond:  update_port---\u003eadd routerport record---exception---\u003eget_port(the result is second.device_id)\n\nThis will return incorrect error message. Making query to routerport table will solve this race problem.","commit_id":"0f5f1ef8540a8530abc96b69a72bca252c22c60d"}],"neutron/db/l3_dvr_db.py":[{"author":{"_account_id":10267,"name":"venkata anil","email":"anilvenkata@redhat.com","username":"anil"},"change_message_id":"16accd58e4fdc8f7089aa7190a2f6e46ab47dd04","unresolved":false,"context_lines":[{"line_number":273,"context_line":"                            admin_context, port[\u0027id\u0027])"},{"line_number":274,"context_line":""},{"line_number":275,"context_line":"            try:"},{"line_number":276,"context_line":"                with context.session.begin(subtransactions\u003dTrue):"},{"line_number":277,"context_line":"                    router_port \u003d l3_db.RouterPort("},{"line_number":278,"context_line":"                        port_id\u003dport[\u0027id\u0027],"},{"line_number":279,"context_line":"                        router_id\u003drouter.id,"}],"source_content_type":"text/x-python","patch_set":9,"id":"7aa08908_d5529934","line":276,"updated":"2016-06-17 06:55:43.000000000","message":"Why for only DVR ports? This should be applicable to legacy router interface ports also, right?","commit_id":"c2ac7c7eaee81a5db690c0e77a643b7009d93de0"},{"author":{"_account_id":17491,"name":"Lujin Luo","email":"luo.lujin@jp.fujitsu.com","username":"Lujin"},"change_message_id":"1461e03724ba679211ddaaa6b766d0cb71b50578","unresolved":false,"context_lines":[{"line_number":273,"context_line":"                            admin_context, port[\u0027id\u0027])"},{"line_number":274,"context_line":""},{"line_number":275,"context_line":"            try:"},{"line_number":276,"context_line":"                with context.session.begin(subtransactions\u003dTrue):"},{"line_number":277,"context_line":"                    router_port \u003d l3_db.RouterPort("},{"line_number":278,"context_line":"                        port_id\u003dport[\u0027id\u0027],"},{"line_number":279,"context_line":"                        router_id\u003drouter.id,"}],"source_content_type":"text/x-python","patch_set":9,"id":"5a9d85d2_9f8ce380","line":276,"in_reply_to":"7aa08908_d5529934","updated":"2016-06-21 05:39:29.000000000","message":"Yes, I added this part in the latest patch. Thanks for the catch!","commit_id":"c2ac7c7eaee81a5db690c0e77a643b7009d93de0"},{"author":{"_account_id":5367,"name":"boden","email":"bodenvmw@gmail.com","username":"boden"},"change_message_id":"fa551a2a6991e2359560e533faac5083648c48cc","unresolved":false,"context_lines":[{"line_number":344,"context_line":"                # Update owner after actual process again in order to"},{"line_number":345,"context_line":"                # make sure the records in routerports table and ports"},{"line_number":346,"context_line":"                # table are consistent."},{"line_number":347,"context_line":"                self._core_plugin.update_port("},{"line_number":348,"context_line":"                    context, port[\u0027id\u0027], {\u0027port\u0027: {"},{"line_number":349,"context_line":"                                         \u0027device_id\u0027: router.id,"},{"line_number":350,"context_line":"                                         \u0027device_owner\u0027: device_owner}})"}],"source_content_type":"text/x-python","patch_set":14,"id":"5a9d85d2_cd7193aa","line":347,"updated":"2016-06-21 11:24:35.000000000","message":"Another newbie question :)\n\nSo the RouterPort model has a backref for port:\n\n    port \u003d orm.relationship(\n        models_v2.Port,\n        backref\u003dorm.backref(\u0027routerport\u0027, uselist\u003dFalse, cascade\u003d\"all,delete\"),\n        lazy\u003d\u0027joined\u0027)\n\nDoesn\u0027t this mean we can just do \u0027router_port.port \u003d port\u0027 in a transaction and that relationship get persisted for us automagically rather than having to explicitly update port like this?","commit_id":"674ab3ca8986faeee85579b57b9037dad6787ef2"},{"author":{"_account_id":17491,"name":"Lujin Luo","email":"luo.lujin@jp.fujitsu.com","username":"Lujin"},"change_message_id":"597205f6069d3e9d18d6084ddacff50d46ed18d3","unresolved":false,"context_lines":[{"line_number":344,"context_line":"                # Update owner after actual process again in order to"},{"line_number":345,"context_line":"                # make sure the records in routerports table and ports"},{"line_number":346,"context_line":"                # table are consistent."},{"line_number":347,"context_line":"                self._core_plugin.update_port("},{"line_number":348,"context_line":"                    context, port[\u0027id\u0027], {\u0027port\u0027: {"},{"line_number":349,"context_line":"                                         \u0027device_id\u0027: router.id,"},{"line_number":350,"context_line":"                                         \u0027device_owner\u0027: device_owner}})"}],"source_content_type":"text/x-python","patch_set":14,"id":"3aaa91ec_f0557c1d","line":347,"in_reply_to":"5a9d85d2_cd7193aa","updated":"2016-06-22 04:50:53.000000000","message":"I am not a pro of database but I do not think it will work here. I  have never seen any similar codes either...","commit_id":"674ab3ca8986faeee85579b57b9037dad6787ef2"},{"author":{"_account_id":13717,"name":"Inessa Vasilevskaya","email":"ivasilevskaya@mirantis.com","username":"ivasilevskaya"},"change_message_id":"5a3642bc4dc92a4f730252c1149a4c5e18a4fddf","unresolved":false,"context_lines":[{"line_number":341,"context_line":"                # Update owner after actual process again in order to"},{"line_number":342,"context_line":"                # make sure the records in routerports table and ports"},{"line_number":343,"context_line":"                # table are consistent."},{"line_number":344,"context_line":"                self._core_plugin.update_port("},{"line_number":345,"context_line":"                    context, port[\u0027id\u0027], {\u0027port\u0027: {"},{"line_number":346,"context_line":"                                         \u0027device_id\u0027: router.id,"},{"line_number":347,"context_line":"                                         \u0027device_owner\u0027: device_owner}})"},{"line_number":348,"context_line":"            except db_exc.DBDuplicateEntry:"},{"line_number":349,"context_line":"                port \u003d self._core_plugin.get_port(context, port[\u0027id\u0027])"},{"line_number":350,"context_line":"                raise n_exc.PortInUse(net_id\u003dport[\u0027network_id\u0027],"}],"source_content_type":"text/x-python","patch_set":20,"id":"dada55a8_cd10f402","line":347,"range":{"start_line":344,"start_character":15,"end_line":347,"end_character":72},"updated":"2016-07-27 08:25:35.000000000","message":"Same question here: won\u0027t setting router_port.port be enough?","commit_id":"03c1a1c26f0766faa1a23681cb2a1bd40cf102ee"},{"author":{"_account_id":17491,"name":"Lujin Luo","email":"luo.lujin@jp.fujitsu.com","username":"Lujin"},"change_message_id":"0d73889d2508b892dd7658b7bf34794a239cd857","unresolved":false,"context_lines":[{"line_number":341,"context_line":"                # Update owner after actual process again in order to"},{"line_number":342,"context_line":"                # make sure the records in routerports table and ports"},{"line_number":343,"context_line":"                # table are consistent."},{"line_number":344,"context_line":"                self._core_plugin.update_port("},{"line_number":345,"context_line":"                    context, port[\u0027id\u0027], {\u0027port\u0027: {"},{"line_number":346,"context_line":"                                         \u0027device_id\u0027: router.id,"},{"line_number":347,"context_line":"                                         \u0027device_owner\u0027: device_owner}})"},{"line_number":348,"context_line":"            except db_exc.DBDuplicateEntry:"},{"line_number":349,"context_line":"                port \u003d self._core_plugin.get_port(context, port[\u0027id\u0027])"},{"line_number":350,"context_line":"                raise n_exc.PortInUse(net_id\u003dport[\u0027network_id\u0027],"}],"source_content_type":"text/x-python","patch_set":20,"id":"bacf61ea_cbe7ec3e","line":347,"range":{"start_line":344,"start_character":15,"end_line":347,"end_character":72},"in_reply_to":"dada55a8_2fd53f42","updated":"2016-07-28 01:33:30.000000000","message":"@Kevin, thank you again! @Inessa, please refer to Kevin\u0027s reply","commit_id":"03c1a1c26f0766faa1a23681cb2a1bd40cf102ee"},{"author":{"_account_id":7787,"name":"Kevin Benton","email":"kevin@benton.pub","username":"blak111"},"change_message_id":"27bc0382b1e0ee3016ee2e1dc6744f3b9dbcfbc7","unresolved":false,"context_lines":[{"line_number":341,"context_line":"                # Update owner after actual process again in order to"},{"line_number":342,"context_line":"                # make sure the records in routerports table and ports"},{"line_number":343,"context_line":"                # table are consistent."},{"line_number":344,"context_line":"                self._core_plugin.update_port("},{"line_number":345,"context_line":"                    context, port[\u0027id\u0027], {\u0027port\u0027: {"},{"line_number":346,"context_line":"                                         \u0027device_id\u0027: router.id,"},{"line_number":347,"context_line":"                                         \u0027device_owner\u0027: device_owner}})"},{"line_number":348,"context_line":"            except db_exc.DBDuplicateEntry:"},{"line_number":349,"context_line":"                port \u003d self._core_plugin.get_port(context, port[\u0027id\u0027])"},{"line_number":350,"context_line":"                raise n_exc.PortInUse(net_id\u003dport[\u0027network_id\u0027],"}],"source_content_type":"text/x-python","patch_set":20,"id":"dada55a8_2fd53f42","line":347,"range":{"start_line":344,"start_character":15,"end_line":347,"end_character":72},"in_reply_to":"dada55a8_cd10f402","updated":"2016-07-27 10:41:02.000000000","message":"same, any port changes must go through the core plugin interface.","commit_id":"03c1a1c26f0766faa1a23681cb2a1bd40cf102ee"}],"neutron/db/migration/alembic_migrations/versions/mitaka/expand/19fed86a054d_uniq_routerports0port_id0port_type.py":[{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"change_message_id":"f58879e8ee5cce585020d886bfa09cdf65231228","unresolved":false,"context_lines":[{"line_number":25,"context_line":"revision \u003d \u002719fed86a054d\u0027"},{"line_number":26,"context_line":"down_revision \u003d \u00270e66c5227a8a\u0027"},{"line_number":27,"context_line":""},{"line_number":28,"context_line":"from alembic import op"},{"line_number":29,"context_line":"from neutron.common import exceptions"},{"line_number":30,"context_line":"import sqlalchemy as sa"},{"line_number":31,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"5aef4532_74d860f0","line":28,"updated":"2016-03-07 13:37:50.000000000","message":"missing from neutron._i18n import _","commit_id":"89f312bf5c0d4c50585dcc779c9f4a96a88e1411"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"change_message_id":"f58879e8ee5cce585020d886bfa09cdf65231228","unresolved":false,"context_lines":[{"line_number":37,"context_line":""},{"line_number":38,"context_line":""},{"line_number":39,"context_line":"class DuplicatePortRecordinRouterPortdatabase(exceptions.Conflict):"},{"line_number":40,"context_line":"    message \u003d _(\"Duplicate port(s) %(port_id)s records exist in routerport\""},{"line_number":41,"context_line":"                \" database. Database cannot be upgraded. Please remove all\""},{"line_number":42,"context_line":"                \"duplicated records before upgrading the database.\")"},{"line_number":43,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"5aef4532_14c75c13","line":40,"updated":"2016-03-07 13:37:50.000000000","message":"nit - please have a space at the end of the line","commit_id":"89f312bf5c0d4c50585dcc779c9f4a96a88e1411"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"change_message_id":"f58879e8ee5cce585020d886bfa09cdf65231228","unresolved":false,"context_lines":[{"line_number":38,"context_line":""},{"line_number":39,"context_line":"class DuplicatePortRecordinRouterPortdatabase(exceptions.Conflict):"},{"line_number":40,"context_line":"    message \u003d _(\"Duplicate port(s) %(port_id)s records exist in routerport\""},{"line_number":41,"context_line":"                \" database. Database cannot be upgraded. Please remove all\""},{"line_number":42,"context_line":"                \"duplicated records before upgrading the database.\")"},{"line_number":43,"context_line":""},{"line_number":44,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"5aef4532_d477b400","line":41,"updated":"2016-03-07 13:37:50.000000000","message":"missing space at the end of the line","commit_id":"89f312bf5c0d4c50585dcc779c9f4a96a88e1411"},{"author":{"_account_id":6524,"name":"Henry Gessau","email":"HenryG@gessau.net","username":"gessau"},"change_message_id":"c21eadd6f4619d16bdfabd5de8ddbb4eb827453e","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":8,"id":"1af94dfe_02b3e750","updated":"2016-03-18 14:41:26.000000000","message":"This must now go in the newton versions directory.","commit_id":"4bff1b00defc5098d57b7f3637d12ad4f1888ae2"}],"neutron/db/migration/alembic_migrations/versions/newton/expand/030a959ceafa_uniq_routerports0port_id.py":[{"author":{"_account_id":13717,"name":"Inessa Vasilevskaya","email":"ivasilevskaya@mirantis.com","username":"ivasilevskaya"},"change_message_id":"5a3642bc4dc92a4f730252c1149a4c5e18a4fddf","unresolved":false,"context_lines":[{"line_number":61,"context_line":"def get_duplicate_port_records_in_routerport_database(connection):"},{"line_number":62,"context_line":"    insp \u003d sa.engine.reflection.Inspector.from_engine(connection)"},{"line_number":63,"context_line":"    if \u0027routerports\u0027 not in insp.get_table_names():"},{"line_number":64,"context_line":"        return {}"},{"line_number":65,"context_line":"    session \u003d sa.orm.Session(bind\u003dconnection.connect())"},{"line_number":66,"context_line":"    query \u003d (session.query(routerports.c.port_id)"},{"line_number":67,"context_line":"            .group_by(routerports.c.port_id)"}],"source_content_type":"text/x-python","patch_set":20,"id":"dada55a8_6d02a8b5","line":64,"range":{"start_line":64,"start_character":8,"end_line":64,"end_character":17},"updated":"2016-07-27 08:25:35.000000000","message":"Why do you return a dict here while the function generally returns a list?","commit_id":"03c1a1c26f0766faa1a23681cb2a1bd40cf102ee"},{"author":{"_account_id":7787,"name":"Kevin Benton","email":"kevin@benton.pub","username":"blak111"},"change_message_id":"27bc0382b1e0ee3016ee2e1dc6744f3b9dbcfbc7","unresolved":false,"context_lines":[{"line_number":61,"context_line":"def get_duplicate_port_records_in_routerport_database(connection):"},{"line_number":62,"context_line":"    insp \u003d sa.engine.reflection.Inspector.from_engine(connection)"},{"line_number":63,"context_line":"    if \u0027routerports\u0027 not in insp.get_table_names():"},{"line_number":64,"context_line":"        return {}"},{"line_number":65,"context_line":"    session \u003d sa.orm.Session(bind\u003dconnection.connect())"},{"line_number":66,"context_line":"    query \u003d (session.query(routerports.c.port_id)"},{"line_number":67,"context_line":"            .group_by(routerports.c.port_id)"}],"source_content_type":"text/x-python","patch_set":20,"id":"dada55a8_efe04728","line":64,"range":{"start_line":64,"start_character":8,"end_line":64,"end_character":17},"in_reply_to":"dada55a8_6d02a8b5","updated":"2016-07-27 10:41:02.000000000","message":"+1","commit_id":"03c1a1c26f0766faa1a23681cb2a1bd40cf102ee"},{"author":{"_account_id":17491,"name":"Lujin Luo","email":"luo.lujin@jp.fujitsu.com","username":"Lujin"},"change_message_id":"0d73889d2508b892dd7658b7bf34794a239cd857","unresolved":false,"context_lines":[{"line_number":61,"context_line":"def get_duplicate_port_records_in_routerport_database(connection):"},{"line_number":62,"context_line":"    insp \u003d sa.engine.reflection.Inspector.from_engine(connection)"},{"line_number":63,"context_line":"    if \u0027routerports\u0027 not in insp.get_table_names():"},{"line_number":64,"context_line":"        return {}"},{"line_number":65,"context_line":"    session \u003d sa.orm.Session(bind\u003dconnection.connect())"},{"line_number":66,"context_line":"    query \u003d (session.query(routerports.c.port_id)"},{"line_number":67,"context_line":"            .group_by(routerports.c.port_id)"}],"source_content_type":"text/x-python","patch_set":20,"id":"bacf61ea_4bcadca2","line":64,"range":{"start_line":64,"start_character":8,"end_line":64,"end_character":17},"in_reply_to":"dada55a8_efe04728","updated":"2016-07-28 01:33:30.000000000","message":"I will fix this one","commit_id":"03c1a1c26f0766faa1a23681cb2a1bd40cf102ee"},{"author":{"_account_id":13717,"name":"Inessa Vasilevskaya","email":"ivasilevskaya@mirantis.com","username":"ivasilevskaya"},"change_message_id":"ac4c6fe2da06965b7b82533d88b2b958b672a82a","unresolved":false,"context_lines":[{"line_number":13,"context_line":"#    under the License."},{"line_number":14,"context_line":"#"},{"line_number":15,"context_line":""},{"line_number":16,"context_line":"\"\"\"uniq_routerports0port_id"},{"line_number":17,"context_line":""},{"line_number":18,"context_line":"Revision ID: 030a959ceafa"},{"line_number":19,"context_line":"Revises: 3d0e74aa7d37"}],"source_content_type":"text/x-python","patch_set":25,"id":"bacf61ea_dada1817","line":16,"range":{"start_line":16,"start_character":3,"end_line":16,"end_character":27},"updated":"2016-08-02 19:21:19.000000000","message":"Nit: s/0/_? (uniq_routerports_port_id)","commit_id":"ca19831a87ab0ad59e7cb31879143977356c77c2"},{"author":{"_account_id":17491,"name":"Lujin Luo","email":"luo.lujin@jp.fujitsu.com","username":"Lujin"},"change_message_id":"8f278ffad49c87c0cf9882c89356cdbbd0dfd179","unresolved":false,"context_lines":[{"line_number":13,"context_line":"#    under the License."},{"line_number":14,"context_line":"#"},{"line_number":15,"context_line":""},{"line_number":16,"context_line":"\"\"\"uniq_routerports0port_id"},{"line_number":17,"context_line":""},{"line_number":18,"context_line":"Revision ID: 030a959ceafa"},{"line_number":19,"context_line":"Revises: 3d0e74aa7d37"}],"source_content_type":"text/x-python","patch_set":25,"id":"bacf61ea_3816d5a7","line":16,"range":{"start_line":16,"start_character":3,"end_line":16,"end_character":27},"in_reply_to":"bacf61ea_dada1817","updated":"2016-08-02 23:54:42.000000000","message":"I would prefer using \u00270\u0027 to separate table_name and column_name, because we have \u0027_\u0027 in column name.","commit_id":"ca19831a87ab0ad59e7cb31879143977356c77c2"},{"author":{"_account_id":13717,"name":"Inessa Vasilevskaya","email":"ivasilevskaya@mirantis.com","username":"ivasilevskaya"},"change_message_id":"ac4c6fe2da06965b7b82533d88b2b958b672a82a","unresolved":false,"context_lines":[{"line_number":47,"context_line":""},{"line_number":48,"context_line":"def upgrade():"},{"line_number":49,"context_line":"    op.create_unique_constraint("},{"line_number":50,"context_line":"            \u0027uniq_routerports0port_id\u0027,"},{"line_number":51,"context_line":"            \u0027routerports\u0027,"},{"line_number":52,"context_line":"            [\u0027port_id\u0027])"},{"line_number":53,"context_line":""},{"line_number":54,"context_line":""},{"line_number":55,"context_line":"def check_sanity(connection):"}],"source_content_type":"text/x-python","patch_set":25,"id":"bacf61ea_1a8e7027","line":52,"range":{"start_line":50,"start_character":4,"end_line":52,"end_character":24},"updated":"2016-08-02 19:21:19.000000000","message":"Nit: overindented","commit_id":"ca19831a87ab0ad59e7cb31879143977356c77c2"},{"author":{"_account_id":17491,"name":"Lujin Luo","email":"luo.lujin@jp.fujitsu.com","username":"Lujin"},"change_message_id":"8f278ffad49c87c0cf9882c89356cdbbd0dfd179","unresolved":false,"context_lines":[{"line_number":47,"context_line":""},{"line_number":48,"context_line":"def upgrade():"},{"line_number":49,"context_line":"    op.create_unique_constraint("},{"line_number":50,"context_line":"            \u0027uniq_routerports0port_id\u0027,"},{"line_number":51,"context_line":"            \u0027routerports\u0027,"},{"line_number":52,"context_line":"            [\u0027port_id\u0027])"},{"line_number":53,"context_line":""},{"line_number":54,"context_line":""},{"line_number":55,"context_line":"def check_sanity(connection):"}],"source_content_type":"text/x-python","patch_set":25,"id":"bacf61ea_d825f90a","line":52,"range":{"start_line":50,"start_character":4,"end_line":52,"end_character":24},"in_reply_to":"bacf61ea_1a8e7027","updated":"2016-08-02 23:54:42.000000000","message":"Done","commit_id":"ca19831a87ab0ad59e7cb31879143977356c77c2"},{"author":{"_account_id":13717,"name":"Inessa Vasilevskaya","email":"ivasilevskaya@mirantis.com","username":"ivasilevskaya"},"change_message_id":"ac4c6fe2da06965b7b82533d88b2b958b672a82a","unresolved":false,"context_lines":[{"line_number":63,"context_line":"    if \u0027routerports\u0027 not in insp.get_table_names():"},{"line_number":64,"context_line":"        return []"},{"line_number":65,"context_line":"    session \u003d sa.orm.Session(bind\u003dconnection.connect())"},{"line_number":66,"context_line":"    query \u003d (session.query(routerports.c.port_id)"},{"line_number":67,"context_line":"            .group_by(routerports.c.port_id)"},{"line_number":68,"context_line":"            .having(sa.func.count() \u003e 1)).all()"},{"line_number":69,"context_line":"    return [q[0] for q in query]"}],"source_content_type":"text/x-python","patch_set":25,"id":"bacf61ea_baa9247e","line":68,"range":{"start_line":66,"start_character":12,"end_line":68,"end_character":47},"updated":"2016-08-02 19:21:19.000000000","message":"Underindented, E128","commit_id":"ca19831a87ab0ad59e7cb31879143977356c77c2"},{"author":{"_account_id":17491,"name":"Lujin Luo","email":"luo.lujin@jp.fujitsu.com","username":"Lujin"},"change_message_id":"8f278ffad49c87c0cf9882c89356cdbbd0dfd179","unresolved":false,"context_lines":[{"line_number":63,"context_line":"    if \u0027routerports\u0027 not in insp.get_table_names():"},{"line_number":64,"context_line":"        return []"},{"line_number":65,"context_line":"    session \u003d sa.orm.Session(bind\u003dconnection.connect())"},{"line_number":66,"context_line":"    query \u003d (session.query(routerports.c.port_id)"},{"line_number":67,"context_line":"            .group_by(routerports.c.port_id)"},{"line_number":68,"context_line":"            .having(sa.func.count() \u003e 1)).all()"},{"line_number":69,"context_line":"    return [q[0] for q in query]"}],"source_content_type":"text/x-python","patch_set":25,"id":"bacf61ea_182031f7","line":68,"range":{"start_line":66,"start_character":12,"end_line":68,"end_character":47},"in_reply_to":"bacf61ea_baa9247e","updated":"2016-08-02 23:54:42.000000000","message":"Done","commit_id":"ca19831a87ab0ad59e7cb31879143977356c77c2"}],"neutron/db/migration/alembic_migrations/versions/newton/expand/19fed86a054d_uniq_routerports0port_id0port_type.py":[{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"change_message_id":"6761d5981e7cb2f5082900b132e6e385680fea45","unresolved":false,"context_lines":[{"line_number":40,"context_line":""},{"line_number":41,"context_line":""},{"line_number":42,"context_line":"class DuplicatePortRecordinRouterPortdatabase(exceptions.Conflict):"},{"line_number":43,"context_line":"    message \u003d _(\"Duplicate port(s) %(port_id)s records exist in routerport \""},{"line_number":44,"context_line":"                \"database. Database cannot be upgraded. Please remove all \""},{"line_number":45,"context_line":"                \"duplicated records before upgrading the database.\")"},{"line_number":46,"context_line":""}],"source_content_type":"text/x-python","patch_set":9,"id":"fa0719c6_2758af55","line":43,"updated":"2016-03-24 12:44:26.000000000","message":"how would one do this?","commit_id":"c2ac7c7eaee81a5db690c0e77a643b7009d93de0"},{"author":{"_account_id":17491,"name":"Lujin Luo","email":"luo.lujin@jp.fujitsu.com","username":"Lujin"},"change_message_id":"0b75245235644801a222da7652977a6609a1213b","unresolved":false,"context_lines":[{"line_number":40,"context_line":""},{"line_number":41,"context_line":""},{"line_number":42,"context_line":"class DuplicatePortRecordinRouterPortdatabase(exceptions.Conflict):"},{"line_number":43,"context_line":"    message \u003d _(\"Duplicate port(s) %(port_id)s records exist in routerport \""},{"line_number":44,"context_line":"                \"database. Database cannot be upgraded. Please remove all \""},{"line_number":45,"context_line":"                \"duplicated records before upgrading the database.\")"},{"line_number":46,"context_line":""}],"source_content_type":"text/x-python","patch_set":9,"id":"7aa08908_1e1de00e","line":43,"in_reply_to":"fa0719c6_2758af55","updated":"2016-06-15 05:04:23.000000000","message":"As my reply to anil, I would consider this as an operator misbehave, but the consequences are severe. If we have operator-1 who is trying to add port_1 as router_1\u0027s interface while at the same time operator-2 is trying to add port_2 as router_2\u0027s interface. However, operator-2 miss-typed \"port-2\" to \"port-1\". Without this unique key, both commands will return Success. Operator-2 would hardly realize that he/she did a wrong command. What is worse is that, if router_1 truly added port_1 as interface, and router_2 did not. If we perform interface_delete command on router_2, port_1 is deleted and router_1 (which truly has the interface of port_1) will lose interface.","commit_id":"c2ac7c7eaee81a5db690c0e77a643b7009d93de0"},{"author":{"_account_id":5367,"name":"boden","email":"bodenvmw@gmail.com","username":"boden"},"change_message_id":"aba3fd93f36b55e69073f79a432bad1d0183064d","unresolved":false,"context_lines":[{"line_number":40,"context_line":""},{"line_number":41,"context_line":""},{"line_number":42,"context_line":"class DuplicatePortRecordinRouterPortdatabase(exceptions.Conflict):"},{"line_number":43,"context_line":"    message \u003d _(\"Duplicate port(s) %(port_id)s records exist in routerport \""},{"line_number":44,"context_line":"                \"database. Database cannot be upgraded. Please remove all \""},{"line_number":45,"context_line":"                \"duplicated records before upgrading the database.\")"},{"line_number":46,"context_line":""}],"source_content_type":"text/x-python","patch_set":10,"id":"7aa08908_4f90bfed","line":43,"range":{"start_line":43,"start_character":64,"end_line":43,"end_character":74},"updated":"2016-06-17 14:48:09.000000000","message":"Nit: shouldn\u0027t this be \"routerports\" (with an \u0027s\u0027)?","commit_id":"733d89bed32754a0ff48f17883ac622ffe83cd6e"},{"author":{"_account_id":17491,"name":"Lujin Luo","email":"luo.lujin@jp.fujitsu.com","username":"Lujin"},"change_message_id":"dd9bcfd4f6bc6f3b217b67657dae1fd7675881ee","unresolved":false,"context_lines":[{"line_number":40,"context_line":""},{"line_number":41,"context_line":""},{"line_number":42,"context_line":"class DuplicatePortRecordinRouterPortdatabase(exceptions.Conflict):"},{"line_number":43,"context_line":"    message \u003d _(\"Duplicate port(s) %(port_id)s records exist in routerport \""},{"line_number":44,"context_line":"                \"database. Database cannot be upgraded. Please remove all \""},{"line_number":45,"context_line":"                \"duplicated records before upgrading the database.\")"},{"line_number":46,"context_line":""}],"source_content_type":"text/x-python","patch_set":10,"id":"5a9d85d2_9f686389","line":43,"range":{"start_line":43,"start_character":64,"end_line":43,"end_character":74},"in_reply_to":"7aa08908_4f90bfed","updated":"2016-06-21 05:45:40.000000000","message":"Done","commit_id":"733d89bed32754a0ff48f17883ac622ffe83cd6e"}],"neutron/tests/unit/extensions/test_l3.py":[{"author":{"_account_id":10267,"name":"venkata anil","email":"anilvenkata@redhat.com","username":"anil"},"change_message_id":"3f742d0f2d0e2b81848036d1d3f2f37e861b82c3","unresolved":false,"context_lines":[{"line_number":1223,"context_line":"        with self.router() as r1:"},{"line_number":1224,"context_line":"            with self.router() as r2:"},{"line_number":1225,"context_line":"                with self.subnet() as s:"},{"line_number":1226,"context_line":"                    with self.port(subnet\u003ds) as p:"},{"line_number":1227,"context_line":"                        self._router_interface_action(\u0027add\u0027,"},{"line_number":1228,"context_line":"                                                      r1[\u0027router\u0027][\u0027id\u0027],"},{"line_number":1229,"context_line":"                                                      None,"}],"source_content_type":"text/x-python","patch_set":9,"id":"fa0719c6_ac7d541e","line":1226,"updated":"2016-03-22 08:41:51.000000000","message":"I don\u0027t think two different routers try to add same interface port. I might be missing something. Can you please explain in which scenario - two different routers try to add same port?","commit_id":"c2ac7c7eaee81a5db690c0e77a643b7009d93de0"},{"author":{"_account_id":10267,"name":"venkata anil","email":"anilvenkata@redhat.com","username":"anil"},"change_message_id":"0b6def9cc52b5547e53dbd15d66cddf620a0a1ee","unresolved":false,"context_lines":[{"line_number":1223,"context_line":"        with self.router() as r1:"},{"line_number":1224,"context_line":"            with self.router() as r2:"},{"line_number":1225,"context_line":"                with self.subnet() as s:"},{"line_number":1226,"context_line":"                    with self.port(subnet\u003ds) as p:"},{"line_number":1227,"context_line":"                        self._router_interface_action(\u0027add\u0027,"},{"line_number":1228,"context_line":"                                                      r1[\u0027router\u0027][\u0027id\u0027],"},{"line_number":1229,"context_line":"                                                      None,"}],"source_content_type":"text/x-python","patch_set":9,"id":"7aa08908_42c6ed16","line":1226,"in_reply_to":"7aa08908_1e6fa092","updated":"2016-06-17 06:12:37.000000000","message":"Can\u0027t this check https://github.com/openstack/neutron/blob/master/neutron/db/l3_db.py#L619 prevent adding same port to two different routers?","commit_id":"c2ac7c7eaee81a5db690c0e77a643b7009d93de0"},{"author":{"_account_id":17491,"name":"Lujin Luo","email":"luo.lujin@jp.fujitsu.com","username":"Lujin"},"change_message_id":"1461e03724ba679211ddaaa6b766d0cb71b50578","unresolved":false,"context_lines":[{"line_number":1223,"context_line":"        with self.router() as r1:"},{"line_number":1224,"context_line":"            with self.router() as r2:"},{"line_number":1225,"context_line":"                with self.subnet() as s:"},{"line_number":1226,"context_line":"                    with self.port(subnet\u003ds) as p:"},{"line_number":1227,"context_line":"                        self._router_interface_action(\u0027add\u0027,"},{"line_number":1228,"context_line":"                                                      r1[\u0027router\u0027][\u0027id\u0027],"},{"line_number":1229,"context_line":"                                                      None,"}],"source_content_type":"text/x-python","patch_set":9,"id":"7aa08908_0e140e9d","line":1226,"in_reply_to":"7aa08908_38fe7405","updated":"2016-06-21 05:39:29.000000000","message":"As session is not thread-safe, I do no think it can actually prevent the concurrency here (and it truly does not). Please go ahead and do a simple test with the latest codes. This bug is still valid.","commit_id":"c2ac7c7eaee81a5db690c0e77a643b7009d93de0"},{"author":{"_account_id":17491,"name":"Lujin Luo","email":"luo.lujin@jp.fujitsu.com","username":"Lujin"},"change_message_id":"38bbcaae7e7cf2f2510af3d3eed7667b15a41765","unresolved":false,"context_lines":[{"line_number":1223,"context_line":"        with self.router() as r1:"},{"line_number":1224,"context_line":"            with self.router() as r2:"},{"line_number":1225,"context_line":"                with self.subnet() as s:"},{"line_number":1226,"context_line":"                    with self.port(subnet\u003ds) as p:"},{"line_number":1227,"context_line":"                        self._router_interface_action(\u0027add\u0027,"},{"line_number":1228,"context_line":"                                                      r1[\u0027router\u0027][\u0027id\u0027],"},{"line_number":1229,"context_line":"                                                      None,"}],"source_content_type":"text/x-python","patch_set":9,"id":"7aa08908_f56195d4","line":1226,"in_reply_to":"7aa08908_42c6ed16","updated":"2016-06-17 06:22:24.000000000","message":"Yes, it can. But if the two requests arrive concurrently, this check validate to both requests.","commit_id":"c2ac7c7eaee81a5db690c0e77a643b7009d93de0"},{"author":{"_account_id":10267,"name":"venkata anil","email":"anilvenkata@redhat.com","username":"anil"},"change_message_id":"16accd58e4fdc8f7089aa7190a2f6e46ab47dd04","unresolved":false,"context_lines":[{"line_number":1223,"context_line":"        with self.router() as r1:"},{"line_number":1224,"context_line":"            with self.router() as r2:"},{"line_number":1225,"context_line":"                with self.subnet() as s:"},{"line_number":1226,"context_line":"                    with self.port(subnet\u003ds) as p:"},{"line_number":1227,"context_line":"                        self._router_interface_action(\u0027add\u0027,"},{"line_number":1228,"context_line":"                                                      r1[\u0027router\u0027][\u0027id\u0027],"},{"line_number":1229,"context_line":"                                                      None,"}],"source_content_type":"text/x-python","patch_set":9,"id":"7aa08908_38fe7405","line":1226,"in_reply_to":"7aa08908_f56195d4","updated":"2016-06-17 06:55:43.000000000","message":"we have one more check https://github.com/openstack/neutron/blob/master/neutron/db/l3_db.py#L638 with a commit \"to mitigate race\"","commit_id":"c2ac7c7eaee81a5db690c0e77a643b7009d93de0"},{"author":{"_account_id":17491,"name":"Lujin Luo","email":"luo.lujin@jp.fujitsu.com","username":"Lujin"},"change_message_id":"0b75245235644801a222da7652977a6609a1213b","unresolved":false,"context_lines":[{"line_number":1223,"context_line":"        with self.router() as r1:"},{"line_number":1224,"context_line":"            with self.router() as r2:"},{"line_number":1225,"context_line":"                with self.subnet() as s:"},{"line_number":1226,"context_line":"                    with self.port(subnet\u003ds) as p:"},{"line_number":1227,"context_line":"                        self._router_interface_action(\u0027add\u0027,"},{"line_number":1228,"context_line":"                                                      r1[\u0027router\u0027][\u0027id\u0027],"},{"line_number":1229,"context_line":"                                                      None,"}],"source_content_type":"text/x-python","patch_set":9,"id":"7aa08908_1e6fa092","line":1226,"in_reply_to":"fa0719c6_ac7d541e","updated":"2016-06-15 05:04:23.000000000","message":"I would consider this as a miss behavior of the operators. Say we have operator-1 who is trying to add port_1 as router_1\u0027s interface while at the same time operator-2 is trying to add port_2 as router_2\u0027s interface. However, operator-2 miss-typed \"port-2\" to \"port-1\". Without this unique key, both commands will return Success. Operator-2 would hardly realize that he/she did a wrong command. What is worse is that, if router_1 truly added port_1 as interface, and router_2 did not. If we perform interface_delete command on router_2, port_1 is deleted and router_1 (which truly has the interface of port_1) will lose interface.","commit_id":"c2ac7c7eaee81a5db690c0e77a643b7009d93de0"},{"author":{"_account_id":5367,"name":"boden","email":"bodenvmw@gmail.com","username":"boden"},"change_message_id":"aba3fd93f36b55e69073f79a432bad1d0183064d","unresolved":false,"context_lines":[{"line_number":1241,"context_line":"                                          None,"},{"line_number":1242,"context_line":"                                          p[\u0027port\u0027][\u0027id\u0027])"},{"line_number":1243,"context_line":""},{"line_number":1244,"context_line":"    def test_router_add_interface_port_concurrently(self):"},{"line_number":1245,"context_line":"        \u0027\u0027\u0027This tests that if multiple routers add one port as their"},{"line_number":1246,"context_line":"        interfaces at the same time. Only the first router\u0027s interface"},{"line_number":1247,"context_line":"        would be added to this port. All the later requests would return"}],"source_content_type":"text/x-python","patch_set":10,"id":"7aa08908_92ee4e89","line":1244,"range":{"start_line":1244,"start_character":8,"end_line":1244,"end_character":51},"updated":"2016-06-17 14:48:09.000000000","message":"Maybe I\u0027m missing something, but I don\u0027t see this test actual verifying the behavior added in this patch.\n\nThis test will pass even if added + run atop neutron master (without the \"fix code\" from this patch).","commit_id":"733d89bed32754a0ff48f17883ac622ffe83cd6e"},{"author":{"_account_id":17491,"name":"Lujin Luo","email":"luo.lujin@jp.fujitsu.com","username":"Lujin"},"change_message_id":"dd9bcfd4f6bc6f3b217b67657dae1fd7675881ee","unresolved":false,"context_lines":[{"line_number":1241,"context_line":"                                          None,"},{"line_number":1242,"context_line":"                                          p[\u0027port\u0027][\u0027id\u0027])"},{"line_number":1243,"context_line":""},{"line_number":1244,"context_line":"    def test_router_add_interface_port_concurrently(self):"},{"line_number":1245,"context_line":"        \u0027\u0027\u0027This tests that if multiple routers add one port as their"},{"line_number":1246,"context_line":"        interfaces at the same time. Only the first router\u0027s interface"},{"line_number":1247,"context_line":"        would be added to this port. All the later requests would return"}],"source_content_type":"text/x-python","patch_set":10,"id":"5a9d85d2_9f9b4372","line":1244,"range":{"start_line":1244,"start_character":8,"end_line":1244,"end_character":51},"in_reply_to":"7aa08908_92ee4e89","updated":"2016-06-21 05:45:40.000000000","message":"This test is simply meant to test adding a port, which has been added as one router\u0027s interface, to another router and see if we can get the exception as we expect. I have renamed it, since the name is very confusing. \n\nThe reason I do not think we can test the concurrent scenario is that even if I can run two threads here, I cannot tell for sure which thread would receive the exception because the time difference is less than milliseconds.","commit_id":"733d89bed32754a0ff48f17883ac622ffe83cd6e"},{"author":{"_account_id":5367,"name":"boden","email":"bodenvmw@gmail.com","username":"boden"},"change_message_id":"fa551a2a6991e2359560e533faac5083648c48cc","unresolved":false,"context_lines":[{"line_number":1241,"context_line":"                                          None,"},{"line_number":1242,"context_line":"                                          p[\u0027port\u0027][\u0027id\u0027])"},{"line_number":1243,"context_line":""},{"line_number":1244,"context_line":"    def test_router_add_interface_dup_port(self):"},{"line_number":1245,"context_line":"        \u0027\u0027\u0027This tests that if multiple routers add one port as their"},{"line_number":1246,"context_line":"        interfaces. Only the first router\u0027s interface would be added"},{"line_number":1247,"context_line":"        to this port. All the later requests would return exceptions."}],"source_content_type":"text/x-python","patch_set":14,"id":"5a9d85d2_0d91db52","line":1244,"range":{"start_line":1244,"start_character":8,"end_line":1244,"end_character":42},"updated":"2016-06-21 11:24:35.000000000","message":"Again I might be missing something, but this test doesn\u0027t seem to be testing the changes in this patch.\n\nIf you add this test method to test_l3.py atop neutron master (without any other changes from this patch), the test passes. Likewise if you comment out the unique constraint in l3_db.py and run this test with this patch it passes.\n\nSeems to indicate this test works regardless of the other changes in this patch.","commit_id":"674ab3ca8986faeee85579b57b9037dad6787ef2"},{"author":{"_account_id":17491,"name":"Lujin Luo","email":"luo.lujin@jp.fujitsu.com","username":"Lujin"},"change_message_id":"597205f6069d3e9d18d6084ddacff50d46ed18d3","unresolved":false,"context_lines":[{"line_number":1241,"context_line":"                                          None,"},{"line_number":1242,"context_line":"                                          p[\u0027port\u0027][\u0027id\u0027])"},{"line_number":1243,"context_line":""},{"line_number":1244,"context_line":"    def test_router_add_interface_dup_port(self):"},{"line_number":1245,"context_line":"        \u0027\u0027\u0027This tests that if multiple routers add one port as their"},{"line_number":1246,"context_line":"        interfaces. Only the first router\u0027s interface would be added"},{"line_number":1247,"context_line":"        to this port. All the later requests would return exceptions."}],"source_content_type":"text/x-python","patch_set":14,"id":"3aaa91ec_534d7a71","line":1244,"range":{"start_line":1244,"start_character":8,"end_line":1244,"end_character":42},"in_reply_to":"5a9d85d2_0d91db52","updated":"2016-06-22 04:50:53.000000000","message":"I get what you meant last time you commented on this part. I guess I did not make myself clear enough. \n\nI know that this test will pass without my fix in this patch. But there is no such a test to test duplicated port scenario before, so I decided to add it here. \n\nMy patch is focusing on handling concurrency. But I feel it difficult to write test codes here. I can write up two threads to add router interface at the same time, but the problem is to tell which thread will raise exception. I am refactoring the part of codes which do validation check, say _check_router_port and _check_for_dup_router_subnets. But I am not sure if this is necessary, since non-concurrent scenarios are covered well by those two functions and the database lock will handle the concurrent scenario. Anyway, I will try to code it up first.","commit_id":"674ab3ca8986faeee85579b57b9037dad6787ef2"},{"author":{"_account_id":7787,"name":"Kevin Benton","email":"kevin@benton.pub","username":"blak111"},"change_message_id":"ba668fb5a801d1c90c92c68e8aac025406658960","unresolved":false,"context_lines":[{"line_number":1265,"context_line":"                                  p[\u0027port\u0027][\u0027id\u0027],"},{"line_number":1266,"context_line":"                                  exc.HTTPConflict.code))"},{"line_number":1267,"context_line":"                        thread_A.run()"},{"line_number":1268,"context_line":"                        thread_B.run()"},{"line_number":1269,"context_line":""},{"line_number":1270,"context_line":"    def test_router_add_interface_multiple_ipv4_subnet_port_returns_400(self):"},{"line_number":1271,"context_line":"        \"\"\"Test adding router port with multiple IPv4 subnets fails."}],"source_content_type":"text/x-python","patch_set":15,"id":"1aa78d24_e7a1d095","line":1268,"updated":"2016-07-12 03:41:22.000000000","message":"This doesn\u0027t really guarantee the ordering very well or that it\u0027s actually testing the right scenario. It also doesn\u0027t seem to be actually waiting until the threads complete (no join call).\n\nI suggest you just call them sequentially and mock out the function that checks to see if the port is already in use. No threading required and it ensures the key constraint is the thing blocking it.","commit_id":"39265714d499c0144d1f69e1b02b3c14c8e89131"},{"author":{"_account_id":17491,"name":"Lujin Luo","email":"luo.lujin@jp.fujitsu.com","username":"Lujin"},"change_message_id":"b6fbba6c3dc7cde926e6c7a4b9367de712e7a0cd","unresolved":false,"context_lines":[{"line_number":1265,"context_line":"                                  p[\u0027port\u0027][\u0027id\u0027],"},{"line_number":1266,"context_line":"                                  exc.HTTPConflict.code))"},{"line_number":1267,"context_line":"                        thread_A.run()"},{"line_number":1268,"context_line":"                        thread_B.run()"},{"line_number":1269,"context_line":""},{"line_number":1270,"context_line":"    def test_router_add_interface_multiple_ipv4_subnet_port_returns_400(self):"},{"line_number":1271,"context_line":"        \"\"\"Test adding router port with multiple IPv4 subnets fails."}],"source_content_type":"text/x-python","patch_set":15,"id":"1aa78d24_52125b59","line":1268,"in_reply_to":"1aa78d24_e7a1d095","updated":"2016-07-15 09:13:04.000000000","message":"Thanks! Please check PS 16, where I call them sequentially but only mock out _check_router_port() before the second _router_interface_action(\u0027add\u0027..","commit_id":"39265714d499c0144d1f69e1b02b3c14c8e89131"},{"author":{"_account_id":13717,"name":"Inessa Vasilevskaya","email":"ivasilevskaya@mirantis.com","username":"ivasilevskaya"},"change_message_id":"0055218340a65bf6a040bd4793cbe4ae96ddd85f","unresolved":false,"context_lines":[{"line_number":1249,"context_line":"        with self.router() as r1, self.router() as r2, self.network() as n:"},{"line_number":1250,"context_line":"            with self.subnet(network\u003dn) as s:"},{"line_number":1251,"context_line":"                with self.port(subnet\u003ds) as p:"},{"line_number":1252,"context_line":"                    self._router_interface_action(\u0027add\u0027,"},{"line_number":1253,"context_line":"                        r1[\u0027router\u0027][\u0027id\u0027],"},{"line_number":1254,"context_line":"                        None,"},{"line_number":1255,"context_line":"                        p[\u0027port\u0027][\u0027id\u0027])"},{"line_number":1256,"context_line":"                    # mock out the sequential check"},{"line_number":1257,"context_line":"                    plugin \u003d \u0027neutron.db.l3_db.L3_NAT_dbonly_mixin\u0027"},{"line_number":1258,"context_line":"                    with mock.patch(plugin + \u0027._check_router_port\u0027,"}],"source_content_type":"text/x-python","patch_set":24,"id":"bacf61ea_fc649822","line":1255,"range":{"start_line":1252,"start_character":0,"end_line":1255,"end_character":40},"updated":"2016-08-01 10:17:04.000000000","message":"underindented","commit_id":"9dc99bf72ad4ab935165a70590a6be8030c13162"},{"author":{"_account_id":17491,"name":"Lujin Luo","email":"luo.lujin@jp.fujitsu.com","username":"Lujin"},"change_message_id":"d772cc2b4c4929d5bf5555f9f87eb99166078f08","unresolved":false,"context_lines":[{"line_number":1249,"context_line":"        with self.router() as r1, self.router() as r2, self.network() as n:"},{"line_number":1250,"context_line":"            with self.subnet(network\u003dn) as s:"},{"line_number":1251,"context_line":"                with self.port(subnet\u003ds) as p:"},{"line_number":1252,"context_line":"                    self._router_interface_action(\u0027add\u0027,"},{"line_number":1253,"context_line":"                        r1[\u0027router\u0027][\u0027id\u0027],"},{"line_number":1254,"context_line":"                        None,"},{"line_number":1255,"context_line":"                        p[\u0027port\u0027][\u0027id\u0027])"},{"line_number":1256,"context_line":"                    # mock out the sequential check"},{"line_number":1257,"context_line":"                    plugin \u003d \u0027neutron.db.l3_db.L3_NAT_dbonly_mixin\u0027"},{"line_number":1258,"context_line":"                    with mock.patch(plugin + \u0027._check_router_port\u0027,"}],"source_content_type":"text/x-python","patch_set":24,"id":"bacf61ea_9638b0d4","line":1255,"range":{"start_line":1252,"start_character":0,"end_line":1255,"end_character":40},"in_reply_to":"bacf61ea_fc649822","updated":"2016-08-01 23:51:13.000000000","message":"I will fix this","commit_id":"9dc99bf72ad4ab935165a70590a6be8030c13162"},{"author":{"_account_id":13717,"name":"Inessa Vasilevskaya","email":"ivasilevskaya@mirantis.com","username":"ivasilevskaya"},"change_message_id":"0055218340a65bf6a040bd4793cbe4ae96ddd85f","unresolved":false,"context_lines":[{"line_number":1255,"context_line":"                        p[\u0027port\u0027][\u0027id\u0027])"},{"line_number":1256,"context_line":"                    # mock out the sequential check"},{"line_number":1257,"context_line":"                    plugin \u003d \u0027neutron.db.l3_db.L3_NAT_dbonly_mixin\u0027"},{"line_number":1258,"context_line":"                    with mock.patch(plugin + \u0027._check_router_port\u0027,"},{"line_number":1259,"context_line":"                        port_id\u003dp[\u0027port\u0027][\u0027id\u0027], device_id\u003dr2[\u0027router\u0027][\u0027id\u0027])\\"},{"line_number":1260,"context_line":"                        as checkport:"},{"line_number":1261,"context_line":"                        checkport.return_value \u003d p[\u0027port\u0027]"},{"line_number":1262,"context_line":"                        self._router_interface_action(\u0027add\u0027,"},{"line_number":1263,"context_line":"                                                  r2[\u0027router\u0027][\u0027id\u0027],"}],"source_content_type":"text/x-python","patch_set":24,"id":"bacf61ea_dc18b4d5","line":1260,"range":{"start_line":1258,"start_character":36,"end_line":1260,"end_character":37},"updated":"2016-08-01 10:17:04.000000000","message":"Difficult to read, i\u0027d reformat like\n\nwith mock.patch(plugin + \u0027._check_router_port\u0027,\n                port_id\u003dp[\u0027port\u0027][\u0027id\u0027],\n                device_id\u003dr2[\u0027router\u0027][\u0027id\u0027]) as checkport:\n\nNit: FYI, it is encouraged to wrap long lines in parentheses instead of using backslashes for continuation (http://docs.openstack.org/developer/hacking/#general)","commit_id":"9dc99bf72ad4ab935165a70590a6be8030c13162"},{"author":{"_account_id":17491,"name":"Lujin Luo","email":"luo.lujin@jp.fujitsu.com","username":"Lujin"},"change_message_id":"d772cc2b4c4929d5bf5555f9f87eb99166078f08","unresolved":false,"context_lines":[{"line_number":1255,"context_line":"                        p[\u0027port\u0027][\u0027id\u0027])"},{"line_number":1256,"context_line":"                    # mock out the sequential check"},{"line_number":1257,"context_line":"                    plugin \u003d \u0027neutron.db.l3_db.L3_NAT_dbonly_mixin\u0027"},{"line_number":1258,"context_line":"                    with mock.patch(plugin + \u0027._check_router_port\u0027,"},{"line_number":1259,"context_line":"                        port_id\u003dp[\u0027port\u0027][\u0027id\u0027], device_id\u003dr2[\u0027router\u0027][\u0027id\u0027])\\"},{"line_number":1260,"context_line":"                        as checkport:"},{"line_number":1261,"context_line":"                        checkport.return_value \u003d p[\u0027port\u0027]"},{"line_number":1262,"context_line":"                        self._router_interface_action(\u0027add\u0027,"},{"line_number":1263,"context_line":"                                                  r2[\u0027router\u0027][\u0027id\u0027],"}],"source_content_type":"text/x-python","patch_set":24,"id":"bacf61ea_f633ecf3","line":1260,"range":{"start_line":1258,"start_character":36,"end_line":1260,"end_character":37},"in_reply_to":"bacf61ea_dc18b4d5","updated":"2016-08-01 23:51:13.000000000","message":"Thank you for the reference! ;)","commit_id":"9dc99bf72ad4ab935165a70590a6be8030c13162"},{"author":{"_account_id":13717,"name":"Inessa Vasilevskaya","email":"ivasilevskaya@mirantis.com","username":"ivasilevskaya"},"change_message_id":"0055218340a65bf6a040bd4793cbe4ae96ddd85f","unresolved":false,"context_lines":[{"line_number":1259,"context_line":"                        port_id\u003dp[\u0027port\u0027][\u0027id\u0027], device_id\u003dr2[\u0027router\u0027][\u0027id\u0027])\\"},{"line_number":1260,"context_line":"                        as checkport:"},{"line_number":1261,"context_line":"                        checkport.return_value \u003d p[\u0027port\u0027]"},{"line_number":1262,"context_line":"                        self._router_interface_action(\u0027add\u0027,"},{"line_number":1263,"context_line":"                                                  r2[\u0027router\u0027][\u0027id\u0027],"},{"line_number":1264,"context_line":"                                                  None,"},{"line_number":1265,"context_line":"                                                  p[\u0027port\u0027][\u0027id\u0027],"},{"line_number":1266,"context_line":"                                                  exc.HTTPConflict.code)"},{"line_number":1267,"context_line":"                    # clean-up"},{"line_number":1268,"context_line":"                    self._router_interface_action(\u0027remove\u0027,"},{"line_number":1269,"context_line":"                                                  r1[\u0027router\u0027][\u0027id\u0027],"}],"source_content_type":"text/x-python","patch_set":24,"id":"bacf61ea_1c86ccda","line":1266,"range":{"start_line":1262,"start_character":24,"end_line":1266,"end_character":72},"updated":"2016-08-01 10:17:04.000000000","message":"underindented","commit_id":"9dc99bf72ad4ab935165a70590a6be8030c13162"},{"author":{"_account_id":17491,"name":"Lujin Luo","email":"luo.lujin@jp.fujitsu.com","username":"Lujin"},"change_message_id":"d772cc2b4c4929d5bf5555f9f87eb99166078f08","unresolved":false,"context_lines":[{"line_number":1259,"context_line":"                        port_id\u003dp[\u0027port\u0027][\u0027id\u0027], device_id\u003dr2[\u0027router\u0027][\u0027id\u0027])\\"},{"line_number":1260,"context_line":"                        as checkport:"},{"line_number":1261,"context_line":"                        checkport.return_value \u003d p[\u0027port\u0027]"},{"line_number":1262,"context_line":"                        self._router_interface_action(\u0027add\u0027,"},{"line_number":1263,"context_line":"                                                  r2[\u0027router\u0027][\u0027id\u0027],"},{"line_number":1264,"context_line":"                                                  None,"},{"line_number":1265,"context_line":"                                                  p[\u0027port\u0027][\u0027id\u0027],"},{"line_number":1266,"context_line":"                                                  exc.HTTPConflict.code)"},{"line_number":1267,"context_line":"                    # clean-up"},{"line_number":1268,"context_line":"                    self._router_interface_action(\u0027remove\u0027,"},{"line_number":1269,"context_line":"                                                  r1[\u0027router\u0027][\u0027id\u0027],"}],"source_content_type":"text/x-python","patch_set":24,"id":"bacf61ea_3650e40a","line":1266,"range":{"start_line":1262,"start_character":24,"end_line":1266,"end_character":72},"in_reply_to":"bacf61ea_1c86ccda","updated":"2016-08-01 23:51:13.000000000","message":"I will fix this","commit_id":"9dc99bf72ad4ab935165a70590a6be8030c13162"},{"author":{"_account_id":17734,"name":"Shih-Hao Li","email":"shihli@vmware.com","username":"shli"},"change_message_id":"253e20240036c5c5ab04597ad7f13ac44fe49c84","unresolved":false,"context_lines":[{"line_number":1263,"context_line":"                                                      r2[\u0027router\u0027][\u0027id\u0027],"},{"line_number":1264,"context_line":"                                                      None,"},{"line_number":1265,"context_line":"                                                      p[\u0027port\u0027][\u0027id\u0027],"},{"line_number":1266,"context_line":"                                                      exc.HTTPConflict.code)"},{"line_number":1267,"context_line":"                    # clean-up"},{"line_number":1268,"context_line":"                    self._router_interface_action(\u0027remove\u0027,"},{"line_number":1269,"context_line":"                                                  r1[\u0027router\u0027][\u0027id\u0027],"}],"source_content_type":"text/x-python","patch_set":26,"id":"7ac969e8_c0dc021b","line":1266,"updated":"2016-08-13 00:08:08.000000000","message":"Why not using HTTPBadRequest instead of HTTPConflict, like in test_router_add_interface_dup_subnet1_returns_400 and test_router_add_interface_dup_subnet2_returns_400?","commit_id":"6281fddbcb4c471b6b06e24d3faa2990e040f3d2"}]}
