)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"17434b504a168180449f3633874eeb1a272215a3","unresolved":false,"context_lines":[{"line_number":8,"context_line":""},{"line_number":9,"context_line":"This patch integrates Port Binding OVO in /plugin/ml2/db.py"},{"line_number":10,"context_line":"and /plugin/ml2/plugin.py It also changes to use context"},{"line_number":11,"context_line":"instead of session"},{"line_number":12,"context_line":""},{"line_number":13,"context_line":"Co-Authored-By: Artur Korzeniewski \u003cartur.korzeniewski@intel.com\u003e"},{"line_number":14,"context_line":"Change-Id: Idb76c0cb2a4d66690c9aca5ba338d5df814cd21e"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":23,"id":"ba5201f7_ec49a032","line":11,"updated":"2017-01-11 20:16:58.000000000","message":"nit: missing dots after sentences","commit_id":"6ce05e18eede9f9799e8e67d7421f17d653ba5bc"},{"author":{"_account_id":8726,"name":"Victor Morales","email":"chipahuac@hotmail.com","username":"electrocucaracha"},"change_message_id":"35c3e255a00143300938a0c344095ee62968f87d","unresolved":false,"context_lines":[{"line_number":7,"context_line":"Integration of (Distributed) Port Binding OVO"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"This patch integrates Port Binding OVO in /plugin/ml2/db.py"},{"line_number":10,"context_line":"and /plugin/ml2/plugin.py It also changes to use context"},{"line_number":11,"context_line":"instead of session."},{"line_number":12,"context_line":""},{"line_number":13,"context_line":"Co-Authored-By: Artur Korzeniewski \u003cartur.korzeniewski@intel.com\u003e"},{"line_number":14,"context_line":"Change-Id: Idb76c0cb2a4d66690c9aca5ba338d5df814cd21e"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":27,"id":"5a3905b3_776309b2","line":11,"range":{"start_line":10,"start_character":34,"end_line":11,"end_character":19},"updated":"2017-01-19 23:41:03.000000000","message":"nit: if this changes the session for context maybe should be valuable to mention this bp\n\nPartially-Implements blueprint: enginefacade-switch","commit_id":"03238ffce6ea07e4b6e5b71d2e689b4cf6e63375"},{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"231c4991ba00d62a2f26e754f3ec6b540186056a","unresolved":false,"context_lines":[{"line_number":6,"context_line":""},{"line_number":7,"context_line":"Integration of (Distributed) Port Binding OVO"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"This patch integrates Port Binding OVO in /plugin/ml2/db.py"},{"line_number":10,"context_line":"and /plugin/ml2/plugin.py It also changes to use context"},{"line_number":11,"context_line":"instead of session."},{"line_number":12,"context_line":""}],"source_content_type":"text/x-gerrit-commit-message","patch_set":78,"id":"df87a7cf_7d604502","line":9,"range":{"start_line":9,"start_character":42,"end_line":9,"end_character":50},"updated":"2017-12-06 19:48:49.000000000","message":"plugins","commit_id":"429eab719f78c3f48fa7a32c55332cce80cb0c68"},{"author":{"_account_id":17491,"name":"Lujin Luo","email":"luo.lujin@jp.fujitsu.com","username":"Lujin"},"change_message_id":"e52e819d3369fa22568eded9b9b598c6f41fdda9","unresolved":false,"context_lines":[{"line_number":6,"context_line":""},{"line_number":7,"context_line":"Integration of (Distributed) Port Binding OVO"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"This patch integrates Port Binding OVO in /plugin/ml2/db.py"},{"line_number":10,"context_line":"and /plugin/ml2/plugin.py It also changes to use context"},{"line_number":11,"context_line":"instead of session."},{"line_number":12,"context_line":""}],"source_content_type":"text/x-gerrit-commit-message","patch_set":78,"id":"df87a7cf_5a7f7914","line":9,"range":{"start_line":9,"start_character":42,"end_line":9,"end_character":50},"in_reply_to":"df87a7cf_7d604502","updated":"2017-12-07 08:50:15.000000000","message":"Done","commit_id":"429eab719f78c3f48fa7a32c55332cce80cb0c68"},{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"231c4991ba00d62a2f26e754f3ec6b540186056a","unresolved":false,"context_lines":[{"line_number":7,"context_line":"Integration of (Distributed) Port Binding OVO"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"This patch integrates Port Binding OVO in /plugin/ml2/db.py"},{"line_number":10,"context_line":"and /plugin/ml2/plugin.py It also changes to use context"},{"line_number":11,"context_line":"instead of session."},{"line_number":12,"context_line":""},{"line_number":13,"context_line":"Co-Authored-By: Artur Korzeniewski \u003cartur.korzeniewski@intel.com\u003e"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":78,"id":"df87a7cf_3d5abd4e","line":10,"range":{"start_line":10,"start_character":4,"end_line":10,"end_character":11},"updated":"2017-12-06 19:48:49.000000000","message":"ditto","commit_id":"429eab719f78c3f48fa7a32c55332cce80cb0c68"},{"author":{"_account_id":17491,"name":"Lujin Luo","email":"luo.lujin@jp.fujitsu.com","username":"Lujin"},"change_message_id":"e52e819d3369fa22568eded9b9b598c6f41fdda9","unresolved":false,"context_lines":[{"line_number":7,"context_line":"Integration of (Distributed) Port Binding OVO"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"This patch integrates Port Binding OVO in /plugin/ml2/db.py"},{"line_number":10,"context_line":"and /plugin/ml2/plugin.py It also changes to use context"},{"line_number":11,"context_line":"instead of session."},{"line_number":12,"context_line":""},{"line_number":13,"context_line":"Co-Authored-By: Artur Korzeniewski \u003cartur.korzeniewski@intel.com\u003e"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":78,"id":"df87a7cf_7a7cbd1e","line":10,"range":{"start_line":10,"start_character":4,"end_line":10,"end_character":11},"in_reply_to":"df87a7cf_3d5abd4e","updated":"2017-12-07 08:50:15.000000000","message":"Done","commit_id":"429eab719f78c3f48fa7a32c55332cce80cb0c68"},{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"231c4991ba00d62a2f26e754f3ec6b540186056a","unresolved":false,"context_lines":[{"line_number":7,"context_line":"Integration of (Distributed) Port Binding OVO"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"This patch integrates Port Binding OVO in /plugin/ml2/db.py"},{"line_number":10,"context_line":"and /plugin/ml2/plugin.py It also changes to use context"},{"line_number":11,"context_line":"instead of session."},{"line_number":12,"context_line":""},{"line_number":13,"context_line":"Co-Authored-By: Artur Korzeniewski \u003cartur.korzeniewski@intel.com\u003e"},{"line_number":14,"context_line":"Change-Id: Idb76c0cb2a4d66690c9aca5ba338d5df814cd21e"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":78,"id":"df87a7cf_9d20a9b2","line":11,"range":{"start_line":10,"start_character":26,"end_line":11,"end_character":19},"updated":"2017-12-06 19:48:49.000000000","message":"this is not clear worded. please expand what you mean (or remove the sentence, it doesn\u0027t seem especially important to understand the intent of the patch).","commit_id":"429eab719f78c3f48fa7a32c55332cce80cb0c68"},{"author":{"_account_id":17491,"name":"Lujin Luo","email":"luo.lujin@jp.fujitsu.com","username":"Lujin"},"change_message_id":"e52e819d3369fa22568eded9b9b598c6f41fdda9","unresolved":false,"context_lines":[{"line_number":7,"context_line":"Integration of (Distributed) Port Binding OVO"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"This patch integrates Port Binding OVO in /plugin/ml2/db.py"},{"line_number":10,"context_line":"and /plugin/ml2/plugin.py It also changes to use context"},{"line_number":11,"context_line":"instead of session."},{"line_number":12,"context_line":""},{"line_number":13,"context_line":"Co-Authored-By: Artur Korzeniewski \u003cartur.korzeniewski@intel.com\u003e"},{"line_number":14,"context_line":"Change-Id: Idb76c0cb2a4d66690c9aca5ba338d5df814cd21e"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":78,"id":"df87a7cf_ba9b2564","line":11,"range":{"start_line":10,"start_character":26,"end_line":11,"end_character":19},"in_reply_to":"df87a7cf_9d20a9b2","updated":"2017-12-07 08:50:15.000000000","message":"I will remove this. Originally, this patch modified passing session to context.session. As time goes by, those parts have been taken care of by Ann\u0027s patches of engine facade.","commit_id":"429eab719f78c3f48fa7a32c55332cce80cb0c68"},{"author":{"_account_id":11975,"name":"Slawek Kaplonski","email":"skaplons@redhat.com","username":"slaweq"},"change_message_id":"22d75d2f0104782d87ae6a9e370fe82179890e35","unresolved":false,"context_lines":[{"line_number":6,"context_line":""},{"line_number":7,"context_line":"Integration of (Distributed) Port Binding OVO"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"This patch integrates Port Binding OVO in /plugins/ml2/db.py"},{"line_number":10,"context_line":"and /plugins/ml2/plugin.py."},{"line_number":11,"context_line":""},{"line_number":12,"context_line":"Co-Authored-By: Artur Korzeniewski \u003cartur.korzeniewski@intel.com\u003e"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":86,"id":"bf8cb3f7_f45ecb10","line":9,"range":{"start_line":9,"start_character":42,"end_line":9,"end_character":43},"updated":"2017-12-26 21:35:43.000000000","message":"nit: I think that this \"/\" is not necessary and better would be to use dots instead of \"/\"","commit_id":"febeaf5d4016157d0cca41023e64b91e550453e8"},{"author":{"_account_id":11975,"name":"Slawek Kaplonski","email":"skaplons@redhat.com","username":"slaweq"},"change_message_id":"22d75d2f0104782d87ae6a9e370fe82179890e35","unresolved":false,"context_lines":[{"line_number":7,"context_line":"Integration of (Distributed) Port Binding OVO"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"This patch integrates Port Binding OVO in /plugins/ml2/db.py"},{"line_number":10,"context_line":"and /plugins/ml2/plugin.py."},{"line_number":11,"context_line":""},{"line_number":12,"context_line":"Co-Authored-By: Artur Korzeniewski \u003cartur.korzeniewski@intel.com\u003e"},{"line_number":13,"context_line":"Change-Id: Idb76c0cb2a4d66690c9aca5ba338d5df814cd21e"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":86,"id":"bf8cb3f7_949bbfc7","line":10,"updated":"2017-12-26 21:35:43.000000000","message":"same as above","commit_id":"febeaf5d4016157d0cca41023e64b91e550453e8"}],"neutron/objects/base.py":[{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"change_message_id":"660062a6821d5ca8413044e76f5ca2bab1cf7293","unresolved":false,"context_lines":[{"line_number":405,"context_line":"        # detach the model so that consequent fetches don\u0027t reuse it"},{"line_number":406,"context_line":"        try:"},{"line_number":407,"context_line":"            context.session.expunge(obj.db_obj)"},{"line_number":408,"context_line":"        except sql_exc.InvalidRequestError:"},{"line_number":409,"context_line":"            # already detached"},{"line_number":410,"context_line":"            pass"},{"line_number":411,"context_line":"        return obj"}],"source_content_type":"text/x-python","patch_set":68,"id":"1f485f77_1d7fc715","line":408,"updated":"2017-11-16 11:36:46.000000000","message":"this looks unrelated to this path. can we do this in a sperate patch?","commit_id":"39432f80f6f49d7558633dbb6e56997770f48802"},{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"231c4991ba00d62a2f26e754f3ec6b540186056a","unresolved":false,"context_lines":[{"line_number":407,"context_line":"            context.session.expunge(obj.db_obj)"},{"line_number":408,"context_line":"        except sql_exc.InvalidRequestError:"},{"line_number":409,"context_line":"            # already detached"},{"line_number":410,"context_line":"            pass"},{"line_number":411,"context_line":"        return obj"},{"line_number":412,"context_line":""},{"line_number":413,"context_line":"    def obj_load_attr(self, attrname):"}],"source_content_type":"text/x-python","patch_set":78,"id":"df87a7cf_f89b03c6","line":410,"updated":"2017-12-06 19:48:49.000000000","message":"this needs an explanation. why is it needed? what\u0027s the use case where we hit _load_object for the same model twice in a session, second time as detached?\n\nPerhaps it even requires a separate patch not to conflate with the goal of the patch (to move to binding ovo objects).","commit_id":"429eab719f78c3f48fa7a32c55332cce80cb0c68"},{"author":{"_account_id":17491,"name":"Lujin Luo","email":"luo.lujin@jp.fujitsu.com","username":"Lujin"},"change_message_id":"e52e819d3369fa22568eded9b9b598c6f41fdda9","unresolved":false,"context_lines":[{"line_number":407,"context_line":"            context.session.expunge(obj.db_obj)"},{"line_number":408,"context_line":"        except sql_exc.InvalidRequestError:"},{"line_number":409,"context_line":"            # already detached"},{"line_number":410,"context_line":"            pass"},{"line_number":411,"context_line":"        return obj"},{"line_number":412,"context_line":""},{"line_number":413,"context_line":"    def obj_load_attr(self, attrname):"}],"source_content_type":"text/x-python","patch_set":78,"id":"df87a7cf_b77260ac","line":410,"in_reply_to":"df87a7cf_f89b03c6","updated":"2017-12-07 08:50:15.000000000","message":"The reason I did not split it is because I think this is only related to this patch. \n\nIf we do not have this try clause, in update_port() in plugins/ml2/plugin.py, we call bindings \u003d obj_port.PortBinding.get_objects() , here we have detached port_binding. Then as it proceeds to [1] we are directed to [2] where we call port.get_object(), which will try to detach port_binding again, because it is a synthetic field. \n\nI think we will not need this check after Port OVO is in place, cause instead of calling port_binding.get_object(), we will call port.binding, thus port_binding OVO will not be detached twice. \n\n[1] https://review.openstack.org/#/c/407868/78/neutron/plugins/ml2/plugin.py@1381 \n[2] https://github.com/openstack/neutron/blob/master/neutron/services/qos/qos_plugin.py#L109","commit_id":"429eab719f78c3f48fa7a32c55332cce80cb0c68"},{"author":{"_account_id":11975,"name":"Slawek Kaplonski","email":"skaplons@redhat.com","username":"slaweq"},"change_message_id":"7d16c75d91ef3c33d86b13e5aa6a7f0a2195f64b","unresolved":false,"context_lines":[{"line_number":233,"context_line":"        # detach the model so that consequent fetches don\u0027t reuse it"},{"line_number":234,"context_line":"        try:"},{"line_number":235,"context_line":"            self.obj_context.session.expunge(self.db_obj)"},{"line_number":236,"context_line":"        except sql_exc.InvalidRequestError:"},{"line_number":237,"context_line":"            # already detached"},{"line_number":238,"context_line":"            pass"},{"line_number":239,"context_line":"        return res"}],"source_content_type":"text/x-python","patch_set":80,"id":"df87a7cf_00f61264","line":236,"updated":"2017-12-11 10:09:59.000000000","message":"just out of curiosity: why it can happen that object is already expunged and it couldn\u0027t be like that before this patch?","commit_id":"ee3c52a60752586c7d0c261acf7fcfec9eeaff05"},{"author":{"_account_id":17491,"name":"Lujin Luo","email":"luo.lujin@jp.fujitsu.com","username":"Lujin"},"change_message_id":"ba2445effd4b3a08870417d258d5eba0e7fc1cba","unresolved":false,"context_lines":[{"line_number":233,"context_line":"        # detach the model so that consequent fetches don\u0027t reuse it"},{"line_number":234,"context_line":"        try:"},{"line_number":235,"context_line":"            self.obj_context.session.expunge(self.db_obj)"},{"line_number":236,"context_line":"        except sql_exc.InvalidRequestError:"},{"line_number":237,"context_line":"            # already detached"},{"line_number":238,"context_line":"            pass"},{"line_number":239,"context_line":"        return res"}],"source_content_type":"text/x-python","patch_set":80,"id":"df87a7cf_71155f48","line":236,"in_reply_to":"df87a7cf_00f61264","updated":"2017-12-12 01:47:48.000000000","message":"This is because I override update() in PortBindingBase, and inside update() we have create(). This decorator works on both create() and update(), which will lead to expunge the created portbinding OVO object twice.","commit_id":"ee3c52a60752586c7d0c261acf7fcfec9eeaff05"},{"author":{"_account_id":11975,"name":"Slawek Kaplonski","email":"skaplons@redhat.com","username":"slaweq"},"change_message_id":"7d16c75d91ef3c33d86b13e5aa6a7f0a2195f64b","unresolved":false,"context_lines":[{"line_number":409,"context_line":"        # detach the model so that consequent fetches don\u0027t reuse it"},{"line_number":410,"context_line":"        try:"},{"line_number":411,"context_line":"            context.session.expunge(obj.db_obj)"},{"line_number":412,"context_line":"        except sql_exc.InvalidRequestError:"},{"line_number":413,"context_line":"            # already detached"},{"line_number":414,"context_line":"            pass"},{"line_number":415,"context_line":"        return obj"}],"source_content_type":"text/x-python","patch_set":80,"id":"df87a7cf_a0e8867b","line":412,"updated":"2017-12-11 10:09:59.000000000","message":"same question as above","commit_id":"ee3c52a60752586c7d0c261acf7fcfec9eeaff05"},{"author":{"_account_id":17491,"name":"Lujin Luo","email":"luo.lujin@jp.fujitsu.com","username":"Lujin"},"change_message_id":"a677800ee4a0a607c49298ca6772e1d4b588167c","unresolved":false,"context_lines":[{"line_number":409,"context_line":"        # detach the model so that consequent fetches don\u0027t reuse it"},{"line_number":410,"context_line":"        try:"},{"line_number":411,"context_line":"            context.session.expunge(obj.db_obj)"},{"line_number":412,"context_line":"        except sql_exc.InvalidRequestError:"},{"line_number":413,"context_line":"            # already detached"},{"line_number":414,"context_line":"            pass"},{"line_number":415,"context_line":"        return obj"}],"source_content_type":"text/x-python","patch_set":80,"id":"bf8cb3f7_4c52d569","line":412,"in_reply_to":"df87a7cf_72fa8b43","updated":"2017-12-21 07:59:58.000000000","message":"OK!","commit_id":"ee3c52a60752586c7d0c261acf7fcfec9eeaff05"},{"author":{"_account_id":11975,"name":"Slawek Kaplonski","email":"skaplons@redhat.com","username":"slaweq"},"change_message_id":"e739f5c9c46cac1997c903d32da68bfd796021bb","unresolved":false,"context_lines":[{"line_number":409,"context_line":"        # detach the model so that consequent fetches don\u0027t reuse it"},{"line_number":410,"context_line":"        try:"},{"line_number":411,"context_line":"            context.session.expunge(obj.db_obj)"},{"line_number":412,"context_line":"        except sql_exc.InvalidRequestError:"},{"line_number":413,"context_line":"            # already detached"},{"line_number":414,"context_line":"            pass"},{"line_number":415,"context_line":"        return obj"}],"source_content_type":"text/x-python","patch_set":80,"id":"df87a7cf_72fa8b43","line":412,"in_reply_to":"df87a7cf_8401bf07","updated":"2017-12-19 08:49:54.000000000","message":"So please add TODO note to remove it when Port OVO will be in place :)","commit_id":"ee3c52a60752586c7d0c261acf7fcfec9eeaff05"},{"author":{"_account_id":17491,"name":"Lujin Luo","email":"luo.lujin@jp.fujitsu.com","username":"Lujin"},"change_message_id":"ba2445effd4b3a08870417d258d5eba0e7fc1cba","unresolved":false,"context_lines":[{"line_number":409,"context_line":"        # detach the model so that consequent fetches don\u0027t reuse it"},{"line_number":410,"context_line":"        try:"},{"line_number":411,"context_line":"            context.session.expunge(obj.db_obj)"},{"line_number":412,"context_line":"        except sql_exc.InvalidRequestError:"},{"line_number":413,"context_line":"            # already detached"},{"line_number":414,"context_line":"            pass"},{"line_number":415,"context_line":"        return obj"}],"source_content_type":"text/x-python","patch_set":80,"id":"df87a7cf_8401bf07","line":412,"in_reply_to":"df87a7cf_a0e8867b","updated":"2017-12-12 01:47:48.000000000","message":"This one is anther problem, which I think is only valid in this patch. \n\nIn update_port() in plugins/ml2/plugin.py, we call bindings \u003d obj_port.PortBinding.get_objects(), here we have detached port_binding. Then as it proceeds to [1] we are directed to [2] where we call port.get_object(), which will try to detach port_binding again, because portbinding is a synthetic field of port. \n\nI think we will not need this check after Port OVO is in place, cause instead of calling port_binding.get_object(), we will call port.binding, thus port_binding OVO will not be detached twice. \n\n[1] https://review.openstack.org/#/c/407868/78/neutron/plugins/ml2/plugin.py@1381 \n[2] https://github.com/openstack/neutron/blob/master/neutron/services/qos/qos_plugin.py#L109","commit_id":"ee3c52a60752586c7d0c261acf7fcfec9eeaff05"}],"neutron/objects/ports.py":[{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"change_message_id":"c0ff90245b9095a757fe82e764ed99efe5a8b0ec","unresolved":false,"context_lines":[{"line_number":81,"context_line":"    # like get_port_binding_host"},{"line_number":82,"context_line":"    @classmethod"},{"line_number":83,"context_line":"    def get_ids_startswith(cls, context, prefix_port_id):"},{"line_number":84,"context_line":"        query \u003d (context.session.query(ml2_models.PortBinding)."},{"line_number":85,"context_line":"                 filter(ml2_models.PortBinding.port_id."},{"line_number":86,"context_line":"                        startswith(prefix_port_id)))"},{"line_number":87,"context_line":"        return [cls._load_object(context, host)"}],"source_content_type":"text/x-python","patch_set":8,"id":"1a6eadb0_c35890fd","line":84,"updated":"2016-12-13 14:24:12.000000000","message":"i do not think that a specific plugin models should be here in generic code","commit_id":"c0f762aa1053324b2c06f4539558e5b3d7cab377"},{"author":{"_account_id":17120,"name":"Manjeet Singh Bhatia","email":"manjeet.s.bhatia@intel.com","username":"manjeets"},"change_message_id":"fcfad6ffa5f0fddfb0d2b51bbff29138605cf8a5","unresolved":false,"context_lines":[{"line_number":39,"context_line":"    # where port_id is a substring of other port_ids. For example in methods"},{"line_number":40,"context_line":"    # like get_port_binding_host"},{"line_number":41,"context_line":"    @classmethod"},{"line_number":42,"context_line":"    def get_ids_startswith(cls, context, prefix_port_id, host\u003dNone):"},{"line_number":43,"context_line":"        bindings \u003d (context.session.query(cls.db_model)."},{"line_number":44,"context_line":"                    filter(cls.db_model.port_id."},{"line_number":45,"context_line":"                        startswith(prefix_port_id)))"},{"line_number":46,"context_line":"        if host:"},{"line_number":47,"context_line":"            bindings \u003d bindings.filter_by(host\u003dhost)"},{"line_number":48,"context_line":"        return [cls._load_object(context, binding)"},{"line_number":49,"context_line":"                for binding in bindings.all()]"},{"line_number":50,"context_line":""},{"line_number":51,"context_line":"    @staticmethod"},{"line_number":52,"context_line":"    def load_json_from_str(field, default\u003dNone):"}],"source_content_type":"text/x-python","patch_set":12,"id":"1a6eadb0_e39d8c5a","line":49,"range":{"start_line":42,"start_character":4,"end_line":49,"end_character":46},"updated":"2016-12-19 18:36:43.000000000","message":"for this there should be unit test in tests/unit/objects/test_ports.py","commit_id":"eb606cefc90a7d2f7232d3f084d93f6c86183566"},{"author":{"_account_id":15518,"name":"Artur Korzeniewski","email":"artur.korzen@wp.pl","username":"akorzeni"},"change_message_id":"5492ebfd7e7abbcdd81b468d962a8c459c2775c7","unresolved":false,"context_lines":[{"line_number":95,"context_line":"    fields \u003d {"},{"line_number":96,"context_line":"        \u0027port_id\u0027: common_types.UUIDField(),"},{"line_number":97,"context_line":"        \u0027host\u0027: obj_fields.StringField(),"},{"line_number":98,"context_line":"        \u0027profile\u0027: common_types.DictOfMiscValuesField(),"},{"line_number":99,"context_line":"        \u0027vif_type\u0027: obj_fields.StringField(),"},{"line_number":100,"context_line":"        \u0027vif_details\u0027: common_types.DictOfMiscValuesField(nullable\u003dTrue),"},{"line_number":101,"context_line":"        \u0027vnic_type\u0027: obj_fields.StringField(),"}],"source_content_type":"text/x-python","patch_set":12,"id":"1a6eadb0_09f8ef7b","line":98,"range":{"start_line":98,"start_character":8,"end_line":98,"end_character":17},"updated":"2016-12-19 16:50:47.000000000","message":"I have converted \u0027profile\u0027 to be DictOfMiscValues, because it is the same case in code that vif_details.","commit_id":"eb606cefc90a7d2f7232d3f084d93f6c86183566"},{"author":{"_account_id":15518,"name":"Artur Korzeniewski","email":"artur.korzen@wp.pl","username":"akorzeni"},"change_message_id":"5492ebfd7e7abbcdd81b468d962a8c459c2775c7","unresolved":false,"context_lines":[{"line_number":115,"context_line":"        query \u003d (context.session.query(cls.db_model)."},{"line_number":116,"context_line":"                 enable_eagerloads(False)."},{"line_number":117,"context_line":"                 filter_by(port_id\u003dport_id)."},{"line_number":118,"context_line":"                 with_lockmode(\u0027update\u0027)."},{"line_number":119,"context_line":"                 one())"},{"line_number":120,"context_line":"        return cls._load_object(context, query)"},{"line_number":121,"context_line":""}],"source_content_type":"text/x-python","patch_set":12,"id":"1a6eadb0_09262f16","line":118,"range":{"start_line":118,"start_character":17,"end_line":118,"end_character":41},"updated":"2016-12-19 16:50:47.000000000","message":"I\u0027m not sure if this would work, we should check that on another iteration of this patch. Is there UT or tempest test covering/guarding the lockmode?","commit_id":"eb606cefc90a7d2f7232d3f084d93f6c86183566"},{"author":{"_account_id":17120,"name":"Manjeet Singh Bhatia","email":"manjeet.s.bhatia@intel.com","username":"manjeets"},"change_message_id":"fcfad6ffa5f0fddfb0d2b51bbff29138605cf8a5","unresolved":false,"context_lines":[{"line_number":115,"context_line":"        query \u003d (context.session.query(cls.db_model)."},{"line_number":116,"context_line":"                 enable_eagerloads(False)."},{"line_number":117,"context_line":"                 filter_by(port_id\u003dport_id)."},{"line_number":118,"context_line":"                 with_lockmode(\u0027update\u0027)."},{"line_number":119,"context_line":"                 one())"},{"line_number":120,"context_line":"        return cls._load_object(context, query)"},{"line_number":121,"context_line":""}],"source_content_type":"text/x-python","patch_set":12,"id":"1a6eadb0_f271d8e1","line":118,"range":{"start_line":118,"start_character":17,"end_line":118,"end_character":41},"in_reply_to":"1a6eadb0_09262f16","updated":"2016-12-19 18:36:43.000000000","message":"I have a question here, so can\u0027t these lockmode queries be done in generic way, I mean having these in object/db/api and pass the type of lockmode and filters, ?","commit_id":"eb606cefc90a7d2f7232d3f084d93f6c86183566"},{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"17434b504a168180449f3633874eeb1a272215a3","unresolved":false,"context_lines":[{"line_number":34,"context_line":"        \u0027Port\u0027: {\u0027port_id\u0027: \u0027id\u0027},"},{"line_number":35,"context_line":"    }"},{"line_number":36,"context_line":""},{"line_number":37,"context_line":"    # NOTE(lujinluo): This method has been added to take care of certain UTs"},{"line_number":38,"context_line":"    # where port_id is a substring of other port_ids. For example in methods"},{"line_number":39,"context_line":"    # like get_port_binding_host"},{"line_number":40,"context_line":"    @classmethod"}],"source_content_type":"text/x-python","patch_set":23,"id":"ba5201f7_b56b58b8","line":37,"updated":"2017-01-11 20:16:58.000000000","message":"I think if that\u0027s the only reason to keep the code, we better scrap/rewrite the tests and simplify the code instead of maintaining the code that is not used in production AND slows down queries.","commit_id":"6ce05e18eede9f9799e8e67d7421f17d653ba5bc"},{"author":{"_account_id":17491,"name":"Lujin Luo","email":"luo.lujin@jp.fujitsu.com","username":"Lujin"},"change_message_id":"620a9c8d74f02d757b82a51c51e1225d94d3f9e9","unresolved":false,"context_lines":[{"line_number":34,"context_line":"        \u0027Port\u0027: {\u0027port_id\u0027: \u0027id\u0027},"},{"line_number":35,"context_line":"    }"},{"line_number":36,"context_line":""},{"line_number":37,"context_line":"    # NOTE(lujinluo): This method has been added to take care of certain UTs"},{"line_number":38,"context_line":"    # where port_id is a substring of other port_ids. For example in methods"},{"line_number":39,"context_line":"    # like get_port_binding_host"},{"line_number":40,"context_line":"    @classmethod"}],"source_content_type":"text/x-python","patch_set":23,"id":"7a3c09a3_a21d5868","line":37,"in_reply_to":"ba5201f7_b56b58b8","updated":"2017-01-17 09:45:32.000000000","message":"Done","commit_id":"6ce05e18eede9f9799e8e67d7421f17d653ba5bc"},{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"17434b504a168180449f3633874eeb1a272215a3","unresolved":false,"context_lines":[{"line_number":98,"context_line":"        :param port_id: id of port for port binding"},{"line_number":99,"context_line":"        :return: PortBinding object"},{"line_number":100,"context_line":"        \"\"\""},{"line_number":101,"context_line":"        query \u003d (context.session.query(cls.db_model)."},{"line_number":102,"context_line":"                 enable_eagerloads(False)."},{"line_number":103,"context_line":"                 filter_by(port_id\u003dport_id)."},{"line_number":104,"context_line":"                 with_lockmode(\u0027update\u0027)."},{"line_number":105,"context_line":"                 one())"},{"line_number":106,"context_line":"        return cls._load_object(context, query)"},{"line_number":107,"context_line":""},{"line_number":108,"context_line":""}],"source_content_type":"text/x-python","patch_set":23,"id":"ba5201f7_5b5dfd13","line":105,"range":{"start_line":101,"start_character":8,"end_line":105,"end_character":23},"updated":"2017-01-11 20:16:58.000000000","message":"That will raise sqlalchemy error. Should we instead mimic behavior of other getters, returning None if query does not return a result?","commit_id":"6ce05e18eede9f9799e8e67d7421f17d653ba5bc"},{"author":{"_account_id":17491,"name":"Lujin Luo","email":"luo.lujin@jp.fujitsu.com","username":"Lujin"},"change_message_id":"620a9c8d74f02d757b82a51c51e1225d94d3f9e9","unresolved":false,"context_lines":[{"line_number":98,"context_line":"        :param port_id: id of port for port binding"},{"line_number":99,"context_line":"        :return: PortBinding object"},{"line_number":100,"context_line":"        \"\"\""},{"line_number":101,"context_line":"        query \u003d (context.session.query(cls.db_model)."},{"line_number":102,"context_line":"                 enable_eagerloads(False)."},{"line_number":103,"context_line":"                 filter_by(port_id\u003dport_id)."},{"line_number":104,"context_line":"                 with_lockmode(\u0027update\u0027)."},{"line_number":105,"context_line":"                 one())"},{"line_number":106,"context_line":"        return cls._load_object(context, query)"},{"line_number":107,"context_line":""},{"line_number":108,"context_line":""}],"source_content_type":"text/x-python","patch_set":23,"id":"7a3c09a3_ef042b4b","line":105,"range":{"start_line":101,"start_character":8,"end_line":105,"end_character":23},"in_reply_to":"ba5201f7_5b5dfd13","updated":"2017-01-17 09:45:32.000000000","message":"Done","commit_id":"6ce05e18eede9f9799e8e67d7421f17d653ba5bc"},{"author":{"_account_id":15518,"name":"Artur Korzeniewski","email":"artur.korzen@wp.pl","username":"akorzeni"},"change_message_id":"387c99b87ba8d0ca9aff9bb25836e6fdf30c0a71","unresolved":false,"context_lines":[{"line_number":77,"context_line":"    primary_keys \u003d [\u0027port_id\u0027]"},{"line_number":78,"context_line":""},{"line_number":79,"context_line":"    @classmethod"},{"line_number":80,"context_line":"    def get_binding_with_lockmode(cls, context, port_id):"},{"line_number":81,"context_line":"        \"\"\""},{"line_number":82,"context_line":"        Get PortBinding object locked for update"},{"line_number":83,"context_line":""}],"source_content_type":"text/x-python","patch_set":24,"id":"7a3c09a3_7ad37404","line":80,"updated":"2017-01-17 18:10:43.000000000","message":"Some interesting approach is in [1], to add lock_mode to Objects DB API. Manjeet is working on separate patch introducing the lock_mode to object framework.\n\n[1] https://review.openstack.org/#/c/338625/24/neutron/objects/db/api.py","commit_id":"75c749045282e376b9bb129a8c1f66a4e1af1ab9"},{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"e11d2446308ff191f1dfe5c72331778b99a5bc10","unresolved":false,"context_lines":[{"line_number":89,"context_line":"                 enable_eagerloads(False)."},{"line_number":90,"context_line":"                 filter_by(port_id\u003dport_id)."},{"line_number":91,"context_line":"                 with_lockmode(\u0027update\u0027))"},{"line_number":92,"context_line":"        binding \u003d query.one() if query else None"},{"line_number":93,"context_line":"        return binding"},{"line_number":94,"context_line":""},{"line_number":95,"context_line":""}],"source_content_type":"text/x-python","patch_set":24,"id":"7a3c09a3_b37b5027","line":92,"range":{"start_line":92,"start_character":33,"end_line":92,"end_character":38},"updated":"2017-01-17 16:21:38.000000000","message":"I think query is always True in boolean context. What you should probably do is calling .first() or .all(), then returning None if result is empty.","commit_id":"75c749045282e376b9bb129a8c1f66a4e1af1ab9"},{"author":{"_account_id":15518,"name":"Artur Korzeniewski","email":"artur.korzen@wp.pl","username":"akorzeni"},"change_message_id":"387c99b87ba8d0ca9aff9bb25836e6fdf30c0a71","unresolved":false,"context_lines":[{"line_number":89,"context_line":"                 enable_eagerloads(False)."},{"line_number":90,"context_line":"                 filter_by(port_id\u003dport_id)."},{"line_number":91,"context_line":"                 with_lockmode(\u0027update\u0027))"},{"line_number":92,"context_line":"        binding \u003d query.one() if query else None"},{"line_number":93,"context_line":"        return binding"},{"line_number":94,"context_line":""},{"line_number":95,"context_line":""}],"source_content_type":"text/x-python","patch_set":24,"id":"7a3c09a3_7a79b4c7","line":92,"range":{"start_line":92,"start_character":33,"end_line":92,"end_character":38},"in_reply_to":"7a3c09a3_b37b5027","updated":"2017-01-17 18:10:43.000000000","message":"I was thinking of introducing the change to sort binding by future field status, sort or filter by status \u0027active\u0027. In that case we can run .all() and try to select the binding with ACTIVE status (if present). If only one port binding is fetched, then we can return the only result.\n\nWhen adding sorting by status, we can be backward compatible from newton to ocata, and ocata to pike.","commit_id":"75c749045282e376b9bb129a8c1f66a4e1af1ab9"},{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"e11d2446308ff191f1dfe5c72331778b99a5bc10","unresolved":false,"context_lines":[{"line_number":90,"context_line":"                 filter_by(port_id\u003dport_id)."},{"line_number":91,"context_line":"                 with_lockmode(\u0027update\u0027))"},{"line_number":92,"context_line":"        binding \u003d query.one() if query else None"},{"line_number":93,"context_line":"        return binding"},{"line_number":94,"context_line":""},{"line_number":95,"context_line":""},{"line_number":96,"context_line":"@obj_base.VersionedObjectRegistry.register"}],"source_content_type":"text/x-python","patch_set":24,"id":"7a3c09a3_b3c9905b","line":93,"updated":"2017-01-17 16:21:38.000000000","message":"this method must return an object, as docstring in line 82 suggests.","commit_id":"75c749045282e376b9bb129a8c1f66a4e1af1ab9"},{"author":{"_account_id":17491,"name":"Lujin Luo","email":"luo.lujin@jp.fujitsu.com","username":"Lujin"},"change_message_id":"90d86c43599ec40284383c555bba28acb9cc5233","unresolved":false,"context_lines":[{"line_number":90,"context_line":"                 filter_by(port_id\u003dport_id)."},{"line_number":91,"context_line":"                 with_lockmode(\u0027update\u0027))"},{"line_number":92,"context_line":"        binding \u003d query.one() if query else None"},{"line_number":93,"context_line":"        return binding"},{"line_number":94,"context_line":""},{"line_number":95,"context_line":""},{"line_number":96,"context_line":"@obj_base.VersionedObjectRegistry.register"}],"source_content_type":"text/x-python","patch_set":24,"id":"7a3c09a3_c9bd5903","line":93,"in_reply_to":"7a3c09a3_5a15d846","updated":"2017-01-18 11:57:53.000000000","message":"Done","commit_id":"75c749045282e376b9bb129a8c1f66a4e1af1ab9"},{"author":{"_account_id":15518,"name":"Artur Korzeniewski","email":"artur.korzen@wp.pl","username":"akorzeni"},"change_message_id":"387c99b87ba8d0ca9aff9bb25836e6fdf30c0a71","unresolved":false,"context_lines":[{"line_number":90,"context_line":"                 filter_by(port_id\u003dport_id)."},{"line_number":91,"context_line":"                 with_lockmode(\u0027update\u0027))"},{"line_number":92,"context_line":"        binding \u003d query.one() if query else None"},{"line_number":93,"context_line":"        return binding"},{"line_number":94,"context_line":""},{"line_number":95,"context_line":""},{"line_number":96,"context_line":"@obj_base.VersionedObjectRegistry.register"}],"source_content_type":"text/x-python","patch_set":24,"id":"7a3c09a3_5a15d846","line":93,"in_reply_to":"7a3c09a3_b3c9905b","updated":"2017-01-17 18:10:43.000000000","message":"It was returning object in PS23. We should return to it.","commit_id":"75c749045282e376b9bb129a8c1f66a4e1af1ab9"},{"author":{"_account_id":8726,"name":"Victor Morales","email":"chipahuac@hotmail.com","username":"electrocucaracha"},"change_message_id":"35c3e255a00143300938a0c344095ee62968f87d","unresolved":false,"context_lines":[{"line_number":94,"context_line":"        binding \u003d query.first()"},{"line_number":95,"context_line":"        if binding:"},{"line_number":96,"context_line":"            return cls._load_object(context, binding)"},{"line_number":97,"context_line":"        else:"},{"line_number":98,"context_line":"            return None"},{"line_number":99,"context_line":""},{"line_number":100,"context_line":""},{"line_number":101,"context_line":"@obj_base.VersionedObjectRegistry.register"}],"source_content_type":"text/x-python","patch_set":27,"id":"5a3905b3_b787310e","line":98,"range":{"start_line":97,"start_character":8,"end_line":98,"end_character":23},"updated":"2017-01-19 23:41:03.000000000","message":"nit: this else sentence(and maybe return None) is not needed\n\n    if binding:\n        return cls._load_object(context, binding)\n    return None","commit_id":"03238ffce6ea07e4b6e5b71d2e689b4cf6e63375"},{"author":{"_account_id":17491,"name":"Lujin Luo","email":"luo.lujin@jp.fujitsu.com","username":"Lujin"},"change_message_id":"850a23bb4877321bcaa87605933b9c1ba0d90fb5","unresolved":false,"context_lines":[{"line_number":94,"context_line":"        binding \u003d query.first()"},{"line_number":95,"context_line":"        if binding:"},{"line_number":96,"context_line":"            return cls._load_object(context, binding)"},{"line_number":97,"context_line":"        else:"},{"line_number":98,"context_line":"            return None"},{"line_number":99,"context_line":""},{"line_number":100,"context_line":""},{"line_number":101,"context_line":"@obj_base.VersionedObjectRegistry.register"}],"source_content_type":"text/x-python","patch_set":27,"id":"5a3905b3_886daf9a","line":98,"range":{"start_line":97,"start_character":8,"end_line":98,"end_character":23},"in_reply_to":"5a3905b3_b787310e","updated":"2017-01-20 02:47:01.000000000","message":"I insisted adding return None to make the logic explicit, since in neutron/plugins/ml2/db.py we call \n\nbinding \u003d port_obj.PortBinding.get_binding_with_lockmode(\n        context, port_id)","commit_id":"03238ffce6ea07e4b6e5b71d2e689b4cf6e63375"},{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"3a7a67db21a7e5b3cddd4f79f5153393c72da5a9","unresolved":false,"context_lines":[{"line_number":407,"context_line":"                 filter_by(id\u003dport_id)."},{"line_number":408,"context_line":"                 with_lockmode(\u0027update\u0027))"},{"line_number":409,"context_line":"        port \u003d query.first()"},{"line_number":410,"context_line":"        # TODO(korzen) return port as OVO, currently not integrated."},{"line_number":411,"context_line":"        return port"}],"source_content_type":"text/x-python","patch_set":27,"id":"7a3c09a3_036f27fc","line":410,"updated":"2017-01-18 17:21:29.000000000","message":"maybe it\u0027s not integrated everywhere, but can\u0027t we already instantiate it from the db record?","commit_id":"03238ffce6ea07e4b6e5b71d2e689b4cf6e63375"},{"author":{"_account_id":17491,"name":"Lujin Luo","email":"luo.lujin@jp.fujitsu.com","username":"Lujin"},"change_message_id":"850a23bb4877321bcaa87605933b9c1ba0d90fb5","unresolved":false,"context_lines":[{"line_number":407,"context_line":"                 filter_by(id\u003dport_id)."},{"line_number":408,"context_line":"                 with_lockmode(\u0027update\u0027))"},{"line_number":409,"context_line":"        port \u003d query.first()"},{"line_number":410,"context_line":"        # TODO(korzen) return port as OVO, currently not integrated."},{"line_number":411,"context_line":"        return port"}],"source_content_type":"text/x-python","patch_set":27,"id":"5a3905b3_c82c174d","line":410,"in_reply_to":"5a3905b3_771789a3","updated":"2017-01-20 02:47:01.000000000","message":"@Victor, this comes from the discussion here\nhttps://review.openstack.org/#/c/407868/24/neutron/plugins/ml2/db.py  Line 52","commit_id":"03238ffce6ea07e4b6e5b71d2e689b4cf6e63375"},{"author":{"_account_id":15518,"name":"Artur Korzeniewski","email":"artur.korzen@wp.pl","username":"akorzeni"},"change_message_id":"761eb2171e5020d231db8f38993aadcd1ca4d482","unresolved":false,"context_lines":[{"line_number":407,"context_line":"                 filter_by(id\u003dport_id)."},{"line_number":408,"context_line":"                 with_lockmode(\u0027update\u0027))"},{"line_number":409,"context_line":"        port \u003d query.first()"},{"line_number":410,"context_line":"        # TODO(korzen) return port as OVO, currently not integrated."},{"line_number":411,"context_line":"        return port"}],"source_content_type":"text/x-python","patch_set":27,"id":"7a3c09a3_abba9e6f","line":410,"in_reply_to":"7a3c09a3_036f27fc","updated":"2017-01-18 20:49:31.000000000","message":"I do not understand, you are suggesting to return OVO and integrate in this patch Port OVO in required places?","commit_id":"03238ffce6ea07e4b6e5b71d2e689b4cf6e63375"},{"author":{"_account_id":8726,"name":"Victor Morales","email":"chipahuac@hotmail.com","username":"electrocucaracha"},"change_message_id":"35c3e255a00143300938a0c344095ee62968f87d","unresolved":false,"context_lines":[{"line_number":407,"context_line":"                 filter_by(id\u003dport_id)."},{"line_number":408,"context_line":"                 with_lockmode(\u0027update\u0027))"},{"line_number":409,"context_line":"        port \u003d query.first()"},{"line_number":410,"context_line":"        # TODO(korzen) return port as OVO, currently not integrated."},{"line_number":411,"context_line":"        return port"}],"source_content_type":"text/x-python","patch_set":27,"id":"5a3905b3_771789a3","line":410,"in_reply_to":"7a3c09a3_6e19a422","updated":"2017-01-19 23:41:03.000000000","message":"If this is not returning an OVO so why we have bothered to move it here?","commit_id":"03238ffce6ea07e4b6e5b71d2e689b4cf6e63375"},{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"82e101dd91b833b74feb88394c4498984b9ed4b7","unresolved":false,"context_lines":[{"line_number":407,"context_line":"                 filter_by(id\u003dport_id)."},{"line_number":408,"context_line":"                 with_lockmode(\u0027update\u0027))"},{"line_number":409,"context_line":"        port \u003d query.first()"},{"line_number":410,"context_line":"        # TODO(korzen) return port as OVO, currently not integrated."},{"line_number":411,"context_line":"        return port"}],"source_content_type":"text/x-python","patch_set":27,"id":"7a3c09a3_6e19a422","line":410,"in_reply_to":"7a3c09a3_abba9e6f","updated":"2017-01-18 20:58:52.000000000","message":"OK nevermind, I guess it\u0027s some more work than I originally thought.","commit_id":"03238ffce6ea07e4b6e5b71d2e689b4cf6e63375"},{"author":{"_account_id":7787,"name":"Kevin Benton","email":"kevin@benton.pub","username":"blak111"},"change_message_id":"3da1d9aa6f809a74fb68012f92cd56abb6517d22","unresolved":false,"context_lines":[{"line_number":77,"context_line":"    primary_keys \u003d [\u0027port_id\u0027]"},{"line_number":78,"context_line":""},{"line_number":79,"context_line":"    @classmethod"},{"line_number":80,"context_line":"    def get_binding_with_lockmode(cls, context, port_id):"},{"line_number":81,"context_line":"        \"\"\""},{"line_number":82,"context_line":"        Get PortBinding object locked for update"},{"line_number":83,"context_line":""}],"source_content_type":"text/x-python","patch_set":28,"id":"5a3905b3_43bebdff","line":80,"updated":"2017-01-23 22:09:03.000000000","message":"I would prefer we didn\u0027t bring the lockmode stuff into OVO. I\u0027m getting rid of the use of it here: https://review.openstack.org/#/c/423581/\n\nCan you rebase this patch on top of mine?","commit_id":"c7bf051e5e6e223c1d585fd361779b91ea5f7647"},{"author":{"_account_id":15518,"name":"Artur Korzeniewski","email":"artur.korzen@wp.pl","username":"akorzeni"},"change_message_id":"083ea47f1d59c2d9a351cb5d2f517ef550f10786","unresolved":false,"context_lines":[{"line_number":77,"context_line":"    primary_keys \u003d [\u0027port_id\u0027]"},{"line_number":78,"context_line":""},{"line_number":79,"context_line":"    @classmethod"},{"line_number":80,"context_line":"    def get_binding_with_lockmode(cls, context, port_id):"},{"line_number":81,"context_line":"        \"\"\""},{"line_number":82,"context_line":"        Get PortBinding object locked for update"},{"line_number":83,"context_line":""}],"source_content_type":"text/x-python","patch_set":28,"id":"5a3905b3_56b661f9","line":80,"in_reply_to":"5a3905b3_43bebdff","updated":"2017-01-24 12:10:35.000000000","message":"Done","commit_id":"c7bf051e5e6e223c1d585fd361779b91ea5f7647"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"change_message_id":"660062a6821d5ca8413044e76f5ca2bab1cf7293","unresolved":false,"context_lines":[{"line_number":47,"context_line":"        :param new_host: new hostname"},{"line_number":48,"context_line":"        :return: None"},{"line_number":49,"context_line":"        \"\"\""},{"line_number":50,"context_line":"        self.delete()"},{"line_number":51,"context_line":"        self.host \u003d new_host"},{"line_number":52,"context_line":"        self._changed_fields \u003d set(self.fields.keys())"},{"line_number":53,"context_line":"        self.create()"}],"source_content_type":"text/x-python","patch_set":68,"id":"1f485f77_3d9ba366","line":50,"updated":"2017-11-16 11:36:46.000000000","message":"is there no way of doing an update?","commit_id":"39432f80f6f49d7558633dbb6e56997770f48802"},{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"231c4991ba00d62a2f26e754f3ec6b540186056a","unresolved":false,"context_lines":[{"line_number":37,"context_line":"        \u0027Port\u0027: {\u0027port_id\u0027: \u0027id\u0027},"},{"line_number":38,"context_line":"    }"},{"line_number":39,"context_line":""},{"line_number":40,"context_line":"    def update_host(self, new_host):"},{"line_number":41,"context_line":"        \"\"\""},{"line_number":42,"context_line":"        Delete old Port Binding entry, update the hostname and create new"},{"line_number":43,"context_line":"        Port Binding with all values saved in DB."}],"source_content_type":"text/x-python","patch_set":78,"id":"df87a7cf_b87edb68","line":40,"updated":"2017-12-06 19:48:49.000000000","message":"can\u0027t we just override \u0027def update(...)\u0027 and if host is in the list of changed fields, then go with delete/create, otherwise call to super().update(...)?\n\nI prefer if we avoid custom tailored methods where semantically we could implement it with existing ones.\n\nOf course, host is part of primary key so delete will fail if we just apply it using the new value of host field. But I think we can cache it in a instance attribute on object load for later use.","commit_id":"429eab719f78c3f48fa7a32c55332cce80cb0c68"},{"author":{"_account_id":17491,"name":"Lujin Luo","email":"luo.lujin@jp.fujitsu.com","username":"Lujin"},"change_message_id":"e52e819d3369fa22568eded9b9b598c6f41fdda9","unresolved":false,"context_lines":[{"line_number":37,"context_line":"        \u0027Port\u0027: {\u0027port_id\u0027: \u0027id\u0027},"},{"line_number":38,"context_line":"    }"},{"line_number":39,"context_line":""},{"line_number":40,"context_line":"    def update_host(self, new_host):"},{"line_number":41,"context_line":"        \"\"\""},{"line_number":42,"context_line":"        Delete old Port Binding entry, update the hostname and create new"},{"line_number":43,"context_line":"        Port Binding with all values saved in DB."}],"source_content_type":"text/x-python","patch_set":78,"id":"df87a7cf_c6597035","line":40,"in_reply_to":"df87a7cf_b87edb68","updated":"2017-12-07 08:50:15.000000000","message":"I think we can. I will override update() and use a new attribute at instance layer called [\u0027new_host\u0027] to cache new host.\n\nOne thing I want to mention here for record is that, after I override update(), I need to revise _detach_db_obj() in object/base.py, because we are now creating object inside update(), resulting detaching db_obj twice.","commit_id":"429eab719f78c3f48fa7a32c55332cce80cb0c68"},{"author":{"_account_id":11975,"name":"Slawek Kaplonski","email":"skaplons@redhat.com","username":"slaweq"},"change_message_id":"7d16c75d91ef3c33d86b13e5aa6a7f0a2195f64b","unresolved":false,"context_lines":[{"line_number":39,"context_line":""},{"line_number":40,"context_line":"    def update(self):"},{"line_number":41,"context_line":"        \"\"\""},{"line_number":42,"context_line":"        Overwrite to handle host update in Port Binding."},{"line_number":43,"context_line":"        Delete old Port Binding entry, update the hostname and create new"},{"line_number":44,"context_line":"        Port Binding with all values saved in DB."},{"line_number":45,"context_line":"        This is done due to host being a primary key, and OVO is not able"}],"source_content_type":"text/x-python","patch_set":80,"id":"df87a7cf_20fc763c","line":42,"updated":"2017-12-11 10:09:59.000000000","message":"nit: this first line should be moved to line above","commit_id":"ee3c52a60752586c7d0c261acf7fcfec9eeaff05"},{"author":{"_account_id":17491,"name":"Lujin Luo","email":"luo.lujin@jp.fujitsu.com","username":"Lujin"},"change_message_id":"ba2445effd4b3a08870417d258d5eba0e7fc1cba","unresolved":false,"context_lines":[{"line_number":39,"context_line":""},{"line_number":40,"context_line":"    def update(self):"},{"line_number":41,"context_line":"        \"\"\""},{"line_number":42,"context_line":"        Overwrite to handle host update in Port Binding."},{"line_number":43,"context_line":"        Delete old Port Binding entry, update the hostname and create new"},{"line_number":44,"context_line":"        Port Binding with all values saved in DB."},{"line_number":45,"context_line":"        This is done due to host being a primary key, and OVO is not able"}],"source_content_type":"text/x-python","patch_set":80,"id":"df87a7cf_64235ba8","line":42,"in_reply_to":"df87a7cf_20fc763c","updated":"2017-12-12 01:47:48.000000000","message":"Will do.","commit_id":"ee3c52a60752586c7d0c261acf7fcfec9eeaff05"},{"author":{"_account_id":11975,"name":"Slawek Kaplonski","email":"skaplons@redhat.com","username":"slaweq"},"change_message_id":"7d16c75d91ef3c33d86b13e5aa6a7f0a2195f64b","unresolved":false,"context_lines":[{"line_number":50,"context_line":"            self.host \u003d self[\u0027new_host\u0027]"},{"line_number":51,"context_line":"            self[\u0027new_host\u0027] \u003d None"},{"line_number":52,"context_line":"            self._changed_fields \u003d set(self.fields.keys())"},{"line_number":53,"context_line":"            self.create()"},{"line_number":54,"context_line":"        else:"},{"line_number":55,"context_line":"            super(PortBindingBase, self).update()"},{"line_number":56,"context_line":""}],"source_content_type":"text/x-python","patch_set":80,"id":"df87a7cf_40f73a5a","line":53,"updated":"2017-12-11 10:09:59.000000000","message":"Can\u0027t it cause some race condition here? It\u0027s not atomic operation and IMO it might cause some problems when e.g. two neutron-server instances will update port binding.","commit_id":"ee3c52a60752586c7d0c261acf7fcfec9eeaff05"},{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"802cbe4f3c03b44a93a822d2b9b4fce0e88dbc46","unresolved":false,"context_lines":[{"line_number":50,"context_line":"            self.host \u003d self[\u0027new_host\u0027]"},{"line_number":51,"context_line":"            self[\u0027new_host\u0027] \u003d None"},{"line_number":52,"context_line":"            self._changed_fields \u003d set(self.fields.keys())"},{"line_number":53,"context_line":"            self.create()"},{"line_number":54,"context_line":"        else:"},{"line_number":55,"context_line":"            super(PortBindingBase, self).update()"},{"line_number":56,"context_line":""}],"source_content_type":"text/x-python","patch_set":80,"id":"df87a7cf_c958ce57","line":53,"in_reply_to":"df87a7cf_1817f447","updated":"2017-12-15 19:01:27.000000000","message":"Should we then mark it as available for update?","commit_id":"ee3c52a60752586c7d0c261acf7fcfec9eeaff05"},{"author":{"_account_id":17491,"name":"Lujin Luo","email":"luo.lujin@jp.fujitsu.com","username":"Lujin"},"change_message_id":"ba2445effd4b3a08870417d258d5eba0e7fc1cba","unresolved":false,"context_lines":[{"line_number":50,"context_line":"            self.host \u003d self[\u0027new_host\u0027]"},{"line_number":51,"context_line":"            self[\u0027new_host\u0027] \u003d None"},{"line_number":52,"context_line":"            self._changed_fields \u003d set(self.fields.keys())"},{"line_number":53,"context_line":"            self.create()"},{"line_number":54,"context_line":"        else:"},{"line_number":55,"context_line":"            super(PortBindingBase, self).update()"},{"line_number":56,"context_line":""}],"source_content_type":"text/x-python","patch_set":80,"id":"df87a7cf_e443eb3d","line":53,"in_reply_to":"df87a7cf_40f73a5a","updated":"2017-12-12 01:47:48.000000000","message":"IMHO, I do not think we will have race condition here. self.create() is basically the same as we call ovo_obj.create() in [1], where you can see the creation is guarded by transaction. \n\n[1] https://github.com/openstack/neutron/blob/master/neutron/objects/base.py#L705","commit_id":"ee3c52a60752586c7d0c261acf7fcfec9eeaff05"},{"author":{"_account_id":17491,"name":"Lujin Luo","email":"luo.lujin@jp.fujitsu.com","username":"Lujin"},"change_message_id":"6848910e70df7f44a6dac30606881cc404d83cf9","unresolved":false,"context_lines":[{"line_number":50,"context_line":"            self.host \u003d self[\u0027new_host\u0027]"},{"line_number":51,"context_line":"            self[\u0027new_host\u0027] \u003d None"},{"line_number":52,"context_line":"            self._changed_fields \u003d set(self.fields.keys())"},{"line_number":53,"context_line":"            self.create()"},{"line_number":54,"context_line":"        else:"},{"line_number":55,"context_line":"            super(PortBindingBase, self).update()"},{"line_number":56,"context_line":""}],"source_content_type":"text/x-python","patch_set":80,"id":"df87a7cf_8f8d342c","line":53,"in_reply_to":"df87a7cf_470ad01f","updated":"2017-12-13 09:29:58.000000000","message":"I think this example makes sense. \n\n- If we can port_binding.get_object(), we need to pass both port_id and host, two primary keys. In this case, the get_object() fails, because current port_binding with \u0027host\u0027 is already deleted.\n\n- However, if we call port_binding.get_objects(), we only pass port_id. If before new port_binding is created, we will not receive any result. This is not the expected case. I will try to find a way to make this delete-and-create operation atomic.","commit_id":"ee3c52a60752586c7d0c261acf7fcfec9eeaff05"},{"author":{"_account_id":17491,"name":"Lujin Luo","email":"luo.lujin@jp.fujitsu.com","username":"Lujin"},"change_message_id":"4e2d01829eedd689ca65e89a4858b4fb693a8b9c","unresolved":false,"context_lines":[{"line_number":50,"context_line":"            self.host \u003d self[\u0027new_host\u0027]"},{"line_number":51,"context_line":"            self[\u0027new_host\u0027] \u003d None"},{"line_number":52,"context_line":"            self._changed_fields \u003d set(self.fields.keys())"},{"line_number":53,"context_line":"            self.create()"},{"line_number":54,"context_line":"        else:"},{"line_number":55,"context_line":"            super(PortBindingBase, self).update()"},{"line_number":56,"context_line":""}],"source_content_type":"text/x-python","patch_set":80,"id":"df87a7cf_1817f447","line":53,"in_reply_to":"df87a7cf_6009badb","updated":"2017-12-15 04:59:49.000000000","message":"Thanks Ihar. I have modified based on our discussion. One thing for record is that, I need to override test_update_single_transaction() in PortBinding and DistributedPortBinding, because \u0027host\u0027 is not valid for update, thus the original test_update_single_transaction() in test_base.py will not test host update.","commit_id":"ee3c52a60752586c7d0c261acf7fcfec9eeaff05"},{"author":{"_account_id":11975,"name":"Slawek Kaplonski","email":"skaplons@redhat.com","username":"slaweq"},"change_message_id":"022a621cf5586853dd16ab80a70d499ad5cdda7f","unresolved":false,"context_lines":[{"line_number":50,"context_line":"            self.host \u003d self[\u0027new_host\u0027]"},{"line_number":51,"context_line":"            self[\u0027new_host\u0027] \u003d None"},{"line_number":52,"context_line":"            self._changed_fields \u003d set(self.fields.keys())"},{"line_number":53,"context_line":"            self.create()"},{"line_number":54,"context_line":"        else:"},{"line_number":55,"context_line":"            super(PortBindingBase, self).update()"},{"line_number":56,"context_line":""}],"source_content_type":"text/x-python","patch_set":80,"id":"df87a7cf_470ad01f","line":53,"in_reply_to":"df87a7cf_7c2d2bfc","updated":"2017-12-12 10:41:20.000000000","message":"I don\u0027t know an exact example which can cause such issue.\nI\u0027m not even 100% sure that it can happen - maybe this code is safe.\nBut what was thinking of is e.g. something like:\n* process A starts this operation so it will call self.delete() for PortBindingBase\n* then process B want\u0027s to e.g. get PortBinding object - will it work fine or there will be and error that object can\u0027t be found?\n* then process A calls create() in L53 and PortBinding object again exists.\n\nIs it possible scenario or I am wrong here?","commit_id":"ee3c52a60752586c7d0c261acf7fcfec9eeaff05"},{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"31683c8221d267b55f119540892799945a725263","unresolved":false,"context_lines":[{"line_number":50,"context_line":"            self.host \u003d self[\u0027new_host\u0027]"},{"line_number":51,"context_line":"            self[\u0027new_host\u0027] \u003d None"},{"line_number":52,"context_line":"            self._changed_fields \u003d set(self.fields.keys())"},{"line_number":53,"context_line":"            self.create()"},{"line_number":54,"context_line":"        else:"},{"line_number":55,"context_line":"            super(PortBindingBase, self).update()"},{"line_number":56,"context_line":""}],"source_content_type":"text/x-python","patch_set":80,"id":"df87a7cf_6009badb","line":53,"in_reply_to":"df87a7cf_8f8d342c","updated":"2017-12-14 14:49:17.000000000","message":"We have a nice UT for that: https://github.com/openstack/neutron/blob/master/neutron/tests/unit/objects/test_base.py#L1652-L1665 but it doesn\u0027t fail because new_host is not a field. I think we should cache the field value on _load_object: setattr(obj, \u0027_cached_host\u0027, obj.host) then use the value when deleting the object (this will require constructing an object that would represent the old object with old value).","commit_id":"ee3c52a60752586c7d0c261acf7fcfec9eeaff05"},{"author":{"_account_id":17491,"name":"Lujin Luo","email":"luo.lujin@jp.fujitsu.com","username":"Lujin"},"change_message_id":"a677800ee4a0a607c49298ca6772e1d4b588167c","unresolved":false,"context_lines":[{"line_number":50,"context_line":"            self.host \u003d self[\u0027new_host\u0027]"},{"line_number":51,"context_line":"            self[\u0027new_host\u0027] \u003d None"},{"line_number":52,"context_line":"            self._changed_fields \u003d set(self.fields.keys())"},{"line_number":53,"context_line":"            self.create()"},{"line_number":54,"context_line":"        else:"},{"line_number":55,"context_line":"            super(PortBindingBase, self).update()"},{"line_number":56,"context_line":""}],"source_content_type":"text/x-python","patch_set":80,"id":"bf8cb3f7_8cee9d86","line":53,"in_reply_to":"df87a7cf_c958ce57","updated":"2017-12-21 07:59:58.000000000","message":"So I tried a couple of times and I figured that we do not need to store old host info in attribute layer. obj.db_obj would store the old host information while ovo layer can store the just-updated host information. \n\nIn this case, we do not need to check for additional attribute layer to decide if we want to override update() method, which adds extra pain points in testing, cause we need to add it before every binging update. \n\nPlease check the latest PS to see if there are any unseen issues with the current design.","commit_id":"ee3c52a60752586c7d0c261acf7fcfec9eeaff05"},{"author":{"_account_id":17491,"name":"Lujin Luo","email":"luo.lujin@jp.fujitsu.com","username":"Lujin"},"change_message_id":"dbae4e005e0cdc6a174d4521a66eab904e2c905f","unresolved":false,"context_lines":[{"line_number":50,"context_line":"            self.host \u003d self[\u0027new_host\u0027]"},{"line_number":51,"context_line":"            self[\u0027new_host\u0027] \u003d None"},{"line_number":52,"context_line":"            self._changed_fields \u003d set(self.fields.keys())"},{"line_number":53,"context_line":"            self.create()"},{"line_number":54,"context_line":"        else:"},{"line_number":55,"context_line":"            super(PortBindingBase, self).update()"},{"line_number":56,"context_line":""}],"source_content_type":"text/x-python","patch_set":80,"id":"df87a7cf_7c2d2bfc","line":53,"in_reply_to":"df87a7cf_d98a4962","updated":"2017-12-12 10:25:50.000000000","message":"Would you mind elaborating it a bit? I tried to write some sample test codes to see what will happen if we have 2 updates at almost the same time. \n\nIf originally we have port_binding(\u0027host\u0027). We have 2 concurrent updates to update host to \u0027host_1\u0027 and \u0027host_2\u0027. If update(\u0027host_1\u0027) is slightly faster than update(\u0027host_2\u0027). Then update(\u0027host_2\u0027) will fail at self.delete() because port_binding with \u0027host\u0027 is already deleted. \n\nDo you mean, if we have one update() which reaches Line 52 and at this time we issue a same create() manually? But then one of it will fail because self.create() is atomic. \n\nI am sorry but I feel difficult to come up with a case that we have race condition here.","commit_id":"ee3c52a60752586c7d0c261acf7fcfec9eeaff05"},{"author":{"_account_id":11975,"name":"Slawek Kaplonski","email":"skaplons@redhat.com","username":"slaweq"},"change_message_id":"6ca802aefa772f61b80799437412703f0e1a6337","unresolved":false,"context_lines":[{"line_number":50,"context_line":"            self.host \u003d self[\u0027new_host\u0027]"},{"line_number":51,"context_line":"            self[\u0027new_host\u0027] \u003d None"},{"line_number":52,"context_line":"            self._changed_fields \u003d set(self.fields.keys())"},{"line_number":53,"context_line":"            self.create()"},{"line_number":54,"context_line":"        else:"},{"line_number":55,"context_line":"            super(PortBindingBase, self).update()"},{"line_number":56,"context_line":""}],"source_content_type":"text/x-python","patch_set":80,"id":"df87a7cf_d98a4962","line":53,"in_reply_to":"df87a7cf_e443eb3d","updated":"2017-12-12 09:13:44.000000000","message":"But please not that You are first doing delete() in L49, than doing few other operations and then create new object. It is not inside one transaction, right?\nWhat if in same time someone else will create this object? IMHO it will raise exception here","commit_id":"ee3c52a60752586c7d0c261acf7fcfec9eeaff05"},{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"c8e7650b6978bedbc0a077daa78c12d807371377","unresolved":false,"context_lines":[{"line_number":45,"context_line":"        \"\"\""},{"line_number":46,"context_line":"        if self.db_obj and self.host !\u003d self.db_obj.host:"},{"line_number":47,"context_line":"            with self.obj_context.session.begin(subtransactions\u003dTrue):"},{"line_number":48,"context_line":"                old_obj \u003d self._load_object(self.obj_context, self.db_obj)"},{"line_number":49,"context_line":"                old_obj.delete()"},{"line_number":50,"context_line":"                self._changed_fields \u003d set(self.fields.keys())"},{"line_number":51,"context_line":"                self.create()"},{"line_number":52,"context_line":"        else:"}],"source_content_type":"text/x-python","patch_set":86,"id":"9f91af0f_95765da4","line":49,"range":{"start_line":48,"start_character":16,"end_line":49,"end_character":32},"updated":"2018-01-04 14:32:34.000000000","message":"you can do delete_objects without fetching the original state here.","commit_id":"febeaf5d4016157d0cca41023e64b91e550453e8"}],"neutron/plugins/ml2/db.py":[{"author":{"_account_id":17491,"name":"Lujin Luo","email":"luo.lujin@jp.fujitsu.com","username":"Lujin"},"change_message_id":"cf272b7d27ad78f5bfb679c973e7375d50a1f7f9","unresolved":false,"context_lines":[{"line_number":221,"context_line":"    return port_dict"},{"line_number":222,"context_line":""},{"line_number":223,"context_line":""},{"line_number":224,"context_line":"def get_port_binding_host(context, port_id):"},{"line_number":225,"context_line":"    try:"},{"line_number":226,"context_line":"        obj \u003d obj_port.PortBinding.get_object(context, port_id\u003dport_id)"},{"line_number":227,"context_line":"    except exc.NoResultFound:"}],"source_content_type":"text/x-python","patch_set":1,"id":"3a71b18c_f60aea77","line":224,"range":{"start_line":224,"start_character":35,"end_line":224,"end_character":42},"updated":"2016-12-07 07:42:44.000000000","message":"It seems this port_id is not a full port_id. Need to refactor this part","commit_id":"d93823aa0809fed0a86eaa439b2314d4b9bddce4"},{"author":{"_account_id":22776,"name":"Nakul Dahiwade","email":"nakul.dahiwade@intel.com","username":"nakul.dahiwade"},"change_message_id":"8cb9757d0119f3b072e556be77e98360376a4e28","unresolved":false,"context_lines":[{"line_number":59,"context_line":"                filter_by(id\u003dport_id)."},{"line_number":60,"context_line":"                with_lockmode(\u0027update\u0027)."},{"line_number":61,"context_line":"                one())"},{"line_number":62,"context_line":"        binding \u003d (session.query(models.PortBinding)."},{"line_number":63,"context_line":"                   enable_eagerloads(False)."},{"line_number":64,"context_line":"                   filter_by(port_id\u003dport_id)."},{"line_number":65,"context_line":"                   with_lockmode(\u0027update\u0027)."}],"source_content_type":"text/x-python","patch_set":7,"id":"1a6eadb0_526f1592","line":62,"updated":"2016-12-12 18:08:48.000000000","message":"Any reason why the idea of making this query as a class method was dropped from earlier PS?","commit_id":"1d93d879d898558821180c88a2f5dc2a9af70a86"},{"author":{"_account_id":17491,"name":"Lujin Luo","email":"luo.lujin@jp.fujitsu.com","username":"Lujin"},"change_message_id":"3a72b3e4e129d6fc2944a72bf47e5e7eb3b3dedd","unresolved":false,"context_lines":[{"line_number":59,"context_line":"                filter_by(id\u003dport_id)."},{"line_number":60,"context_line":"                with_lockmode(\u0027update\u0027)."},{"line_number":61,"context_line":"                one())"},{"line_number":62,"context_line":"        binding \u003d (session.query(models.PortBinding)."},{"line_number":63,"context_line":"                   enable_eagerloads(False)."},{"line_number":64,"context_line":"                   filter_by(port_id\u003dport_id)."},{"line_number":65,"context_line":"                   with_lockmode(\u0027update\u0027)."}],"source_content_type":"text/x-python","patch_set":7,"id":"1a6eadb0_3ac7b913","line":62,"in_reply_to":"1a6eadb0_526f1592","updated":"2016-12-13 08:45:01.000000000","message":"I am not sure whether it is working. Then I asked Ihar here https://review.openstack.org/#/c/406407/5/neutron/plugins/ml2/db.py, as he says we do not have ready solutions for locks yet. So I removed it.","commit_id":"1d93d879d898558821180c88a2f5dc2a9af70a86"},{"author":{"_account_id":17120,"name":"Manjeet Singh Bhatia","email":"manjeet.s.bhatia@intel.com","username":"manjeets"},"change_message_id":"fcfad6ffa5f0fddfb0d2b51bbff29138605cf8a5","unresolved":false,"context_lines":[{"line_number":54,"context_line":"        # to both be added to the session and locked for update. A"},{"line_number":55,"context_line":"        # single joined query should work, but the combination of left"},{"line_number":56,"context_line":"        # outer joins and postgresql doesn\u0027t seem to work."},{"line_number":57,"context_line":"        port \u003d (context.session.query(models_v2.Port)."},{"line_number":58,"context_line":"                enable_eagerloads(False)."},{"line_number":59,"context_line":"                filter_by(id\u003dport_id)."},{"line_number":60,"context_line":"                with_lockmode(\u0027update\u0027)."},{"line_number":61,"context_line":"                one())"},{"line_number":62,"context_line":"        binding \u003d port_obj.PortBinding.get_binding_with_lockmode("},{"line_number":63,"context_line":"            context, port_id)"},{"line_number":64,"context_line":"        return port, binding"}],"source_content_type":"text/x-python","patch_set":12,"id":"1a6eadb0_bd08112a","line":61,"range":{"start_line":57,"start_character":7,"end_line":61,"end_character":22},"updated":"2016-12-19 18:36:43.000000000","message":"if we can do that way I commented in https://review.openstack.org/#/c/407868/12/neutron/objects/ports.py L118 then we can use such api in these type of cases as well","commit_id":"eb606cefc90a7d2f7232d3f084d93f6c86183566"},{"author":{"_account_id":17120,"name":"Manjeet Singh Bhatia","email":"manjeet.s.bhatia@intel.com","username":"manjeets"},"change_message_id":"fcfad6ffa5f0fddfb0d2b51bbff29138605cf8a5","unresolved":false,"context_lines":[{"line_number":122,"context_line":"        return record_obj"},{"line_number":123,"context_line":"    except exceptions.NeutronDbObjectDuplicateEntry:"},{"line_number":124,"context_line":"        LOG.debug(\"Distributed Port %s already bound\", port_id)"},{"line_number":125,"context_line":"        return port_obj.DistributedPortBinding.get_object(context,"},{"line_number":126,"context_line":"                port_id\u003dport_id, host\u003dhost)"},{"line_number":127,"context_line":""},{"line_number":128,"context_line":""},{"line_number":129,"context_line":"def delete_distributed_port_binding_if_stale(context, binding):"}],"source_content_type":"text/x-python","patch_set":12,"id":"1a6eadb0_7db919ec","line":126,"range":{"start_line":125,"start_character":15,"end_line":126,"end_character":43},"updated":"2016-12-19 18:36:43.000000000","message":"you need to be bit careful here as one() will return exactly one or raise exception when multiple or none, and get_object will return query.first() or None, so in case of None and multiple rows exception need to be raised,","commit_id":"eb606cefc90a7d2f7232d3f084d93f6c86183566"},{"author":{"_account_id":17491,"name":"Lujin Luo","email":"luo.lujin@jp.fujitsu.com","username":"Lujin"},"change_message_id":"b1b5c7283eaaa71513f2cfd762852c4235aa35e7","unresolved":false,"context_lines":[{"line_number":122,"context_line":"        return record_obj"},{"line_number":123,"context_line":"    except exceptions.NeutronDbObjectDuplicateEntry:"},{"line_number":124,"context_line":"        LOG.debug(\"Distributed Port %s already bound\", port_id)"},{"line_number":125,"context_line":"        return port_obj.DistributedPortBinding.get_object(context,"},{"line_number":126,"context_line":"                port_id\u003dport_id, host\u003dhost)"},{"line_number":127,"context_line":""},{"line_number":128,"context_line":""},{"line_number":129,"context_line":"def delete_distributed_port_binding_if_stale(context, binding):"}],"source_content_type":"text/x-python","patch_set":12,"id":"1a6eadb0_2183f2cd","line":126,"range":{"start_line":125,"start_character":15,"end_line":126,"end_character":43},"in_reply_to":"1a6eadb0_7db919ec","updated":"2016-12-20 05:30:41.000000000","message":"we have DuplicateEntry constraint when adding same port_id and host combination to the table, thus I do not think we will query multiple rows. But i will add the exception if the result is None.","commit_id":"eb606cefc90a7d2f7232d3f084d93f6c86183566"},{"author":{"_account_id":17120,"name":"Manjeet Singh Bhatia","email":"manjeet.s.bhatia@intel.com","username":"manjeets"},"change_message_id":"fcfad6ffa5f0fddfb0d2b51bbff29138605cf8a5","unresolved":false,"context_lines":[{"line_number":220,"context_line":""},{"line_number":221,"context_line":""},{"line_number":222,"context_line":"def get_port_binding_host(context, port_id):"},{"line_number":223,"context_line":"    objs \u003d port_obj.PortBinding.get_ids_startswith(context, port_id)"},{"line_number":224,"context_line":"    if not objs:"},{"line_number":225,"context_line":"        LOG.debug(\"No binding found for port %(port_id)s\","},{"line_number":226,"context_line":"                  {\u0027port_id\u0027: port_id})"}],"source_content_type":"text/x-python","patch_set":12,"id":"1a6eadb0_9dba75bf","line":223,"range":{"start_line":223,"start_character":32,"end_line":223,"end_character":68},"updated":"2016-12-19 18:36:43.000000000","message":"I am little doubtful to this, with objects port_id will not be string anymore, it must be uuid, each uuid is unique then what would be point of having startswith case ?","commit_id":"eb606cefc90a7d2f7232d3f084d93f6c86183566"},{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"17434b504a168180449f3633874eeb1a272215a3","unresolved":false,"context_lines":[{"line_number":47,"context_line":""},{"line_number":48,"context_line":""},{"line_number":49,"context_line":"def get_locked_port_and_binding(context, port_id):"},{"line_number":50,"context_line":"    \"\"\"Get port and port binding records for update within transaction.\"\"\""},{"line_number":51,"context_line":""},{"line_number":52,"context_line":"    try:"},{"line_number":53,"context_line":"        # REVISIT(rkukura): We need the Port and PortBinding records"}],"source_content_type":"text/x-python","patch_set":23,"id":"ba5201f7_fb42313d","line":50,"range":{"start_line":50,"start_character":11,"end_line":50,"end_character":40},"updated":"2017-01-11 20:16:58.000000000","message":"port record and port binding object","commit_id":"6ce05e18eede9f9799e8e67d7421f17d653ba5bc"},{"author":{"_account_id":17491,"name":"Lujin Luo","email":"luo.lujin@jp.fujitsu.com","username":"Lujin"},"change_message_id":"620a9c8d74f02d757b82a51c51e1225d94d3f9e9","unresolved":false,"context_lines":[{"line_number":47,"context_line":""},{"line_number":48,"context_line":""},{"line_number":49,"context_line":"def get_locked_port_and_binding(context, port_id):"},{"line_number":50,"context_line":"    \"\"\"Get port and port binding records for update within transaction.\"\"\""},{"line_number":51,"context_line":""},{"line_number":52,"context_line":"    try:"},{"line_number":53,"context_line":"        # REVISIT(rkukura): We need the Port and PortBinding records"}],"source_content_type":"text/x-python","patch_set":23,"id":"7a3c09a3_45b03ef5","line":50,"range":{"start_line":50,"start_character":11,"end_line":50,"end_character":40},"in_reply_to":"ba5201f7_fb42313d","updated":"2017-01-17 09:45:32.000000000","message":"This line will exceed 79 characters, so I change \"port binding\" to \"portbinding\"","commit_id":"6ce05e18eede9f9799e8e67d7421f17d653ba5bc"},{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"17434b504a168180449f3633874eeb1a272215a3","unresolved":false,"context_lines":[{"line_number":105,"context_line":""},{"line_number":106,"context_line":""},{"line_number":107,"context_line":"def ensure_distributed_port_binding(context, port_id, host, router_id\u003dNone):"},{"line_number":108,"context_line":"    record_obj \u003d port_obj.DistributedPortBinding.get_object("},{"line_number":109,"context_line":"        context, port_id\u003dport_id, host\u003dhost)"},{"line_number":110,"context_line":"    if record_obj:"},{"line_number":111,"context_line":"        return record_obj"}],"source_content_type":"text/x-python","patch_set":23,"id":"ba5201f7_dba72d09","line":108,"range":{"start_line":108,"start_character":4,"end_line":108,"end_character":14},"updated":"2017-01-11 20:16:58.000000000","message":"-\u003e binding_obj","commit_id":"6ce05e18eede9f9799e8e67d7421f17d653ba5bc"},{"author":{"_account_id":17491,"name":"Lujin Luo","email":"luo.lujin@jp.fujitsu.com","username":"Lujin"},"change_message_id":"620a9c8d74f02d757b82a51c51e1225d94d3f9e9","unresolved":false,"context_lines":[{"line_number":105,"context_line":""},{"line_number":106,"context_line":""},{"line_number":107,"context_line":"def ensure_distributed_port_binding(context, port_id, host, router_id\u003dNone):"},{"line_number":108,"context_line":"    record_obj \u003d port_obj.DistributedPortBinding.get_object("},{"line_number":109,"context_line":"        context, port_id\u003dport_id, host\u003dhost)"},{"line_number":110,"context_line":"    if record_obj:"},{"line_number":111,"context_line":"        return record_obj"}],"source_content_type":"text/x-python","patch_set":23,"id":"7a3c09a3_fa3aaee6","line":108,"range":{"start_line":108,"start_character":4,"end_line":108,"end_character":14},"in_reply_to":"ba5201f7_dba72d09","updated":"2017-01-17 09:45:32.000000000","message":"Done","commit_id":"6ce05e18eede9f9799e8e67d7421f17d653ba5bc"},{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"17434b504a168180449f3633874eeb1a272215a3","unresolved":false,"context_lines":[{"line_number":111,"context_line":"        return record_obj"},{"line_number":112,"context_line":""},{"line_number":113,"context_line":"    try:"},{"line_number":114,"context_line":"        record_obj \u003d port_obj.DistributedPortBinding("},{"line_number":115,"context_line":"            context,"},{"line_number":116,"context_line":"            port_id\u003dport_id,"},{"line_number":117,"context_line":"            host\u003dhost,"}],"source_content_type":"text/x-python","patch_set":23,"id":"ba5201f7_3b8e7979","line":114,"range":{"start_line":114,"start_character":8,"end_line":114,"end_character":18},"updated":"2017-01-11 20:16:58.000000000","message":"-\u003e binding_obj","commit_id":"6ce05e18eede9f9799e8e67d7421f17d653ba5bc"},{"author":{"_account_id":17491,"name":"Lujin Luo","email":"luo.lujin@jp.fujitsu.com","username":"Lujin"},"change_message_id":"620a9c8d74f02d757b82a51c51e1225d94d3f9e9","unresolved":false,"context_lines":[{"line_number":111,"context_line":"        return record_obj"},{"line_number":112,"context_line":""},{"line_number":113,"context_line":"    try:"},{"line_number":114,"context_line":"        record_obj \u003d port_obj.DistributedPortBinding("},{"line_number":115,"context_line":"            context,"},{"line_number":116,"context_line":"            port_id\u003dport_id,"},{"line_number":117,"context_line":"            host\u003dhost,"}],"source_content_type":"text/x-python","patch_set":23,"id":"7a3c09a3_da35f2f7","line":114,"range":{"start_line":114,"start_character":8,"end_line":114,"end_character":18},"in_reply_to":"ba5201f7_3b8e7979","updated":"2017-01-17 09:45:32.000000000","message":"Done","commit_id":"6ce05e18eede9f9799e8e67d7421f17d653ba5bc"},{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"17434b504a168180449f3633874eeb1a272215a3","unresolved":false,"context_lines":[{"line_number":226,"context_line":"        LOG.debug(\"No binding found for port %(port_id)s\","},{"line_number":227,"context_line":"                  {\u0027port_id\u0027: port_id})"},{"line_number":228,"context_line":"        return"},{"line_number":229,"context_line":"    if len(objs) \u003e 1:"},{"line_number":230,"context_line":"        LOG.error(_LE(\"Multiple ports have port_id starting with %s\"),"},{"line_number":231,"context_line":"                  port_id)"},{"line_number":232,"context_line":"        return"}],"source_content_type":"text/x-python","patch_set":23,"id":"ba5201f7_5bec1df3","line":229,"updated":"2017-01-11 20:16:58.000000000","message":"I can\u0027t even see how it\u0027s possible in real life outside of testing environment since it\u0027s the only primary key. I suggest we scrap the code for good, including get_ids_startswith, and replace the body of the function with a simple get_object() call. There is no reason to keep that complexity for tests sake.","commit_id":"6ce05e18eede9f9799e8e67d7421f17d653ba5bc"},{"author":{"_account_id":17491,"name":"Lujin Luo","email":"luo.lujin@jp.fujitsu.com","username":"Lujin"},"change_message_id":"620a9c8d74f02d757b82a51c51e1225d94d3f9e9","unresolved":false,"context_lines":[{"line_number":226,"context_line":"        LOG.debug(\"No binding found for port %(port_id)s\","},{"line_number":227,"context_line":"                  {\u0027port_id\u0027: port_id})"},{"line_number":228,"context_line":"        return"},{"line_number":229,"context_line":"    if len(objs) \u003e 1:"},{"line_number":230,"context_line":"        LOG.error(_LE(\"Multiple ports have port_id starting with %s\"),"},{"line_number":231,"context_line":"                  port_id)"},{"line_number":232,"context_line":"        return"}],"source_content_type":"text/x-python","patch_set":23,"id":"7a3c09a3_da16d2a6","line":229,"in_reply_to":"ba5201f7_5bec1df3","updated":"2017-01-17 09:45:32.000000000","message":"I would be very much like to! Those codes bothered me a lot when I wrote this PS.","commit_id":"6ce05e18eede9f9799e8e67d7421f17d653ba5bc"},{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"17434b504a168180449f3633874eeb1a272215a3","unresolved":false,"context_lines":[{"line_number":237,"context_line":"    # an OR\u0027ed value of status assigned to parent port from the"},{"line_number":238,"context_line":"    # distributedportbinding bucket"},{"line_number":239,"context_line":"    final_status \u003d n_const.PORT_STATUS_BUILD"},{"line_number":240,"context_line":"    query_objs \u003d port_obj.DistributedPortBinding.get_objects(context,"},{"line_number":241,"context_line":"                                                             port_id\u003dport_id)"},{"line_number":242,"context_line":"    for bind_obj in query_objs:"},{"line_number":243,"context_line":"        if bind_obj.status \u003d\u003d n_const.PORT_STATUS_ACTIVE:"}],"source_content_type":"text/x-python","patch_set":23,"id":"ba5201f7_3b74b934","line":240,"range":{"start_line":240,"start_character":4,"end_line":240,"end_character":14},"updated":"2017-01-11 20:16:58.000000000","message":"-\u003e bindings?","commit_id":"6ce05e18eede9f9799e8e67d7421f17d653ba5bc"},{"author":{"_account_id":17491,"name":"Lujin Luo","email":"luo.lujin@jp.fujitsu.com","username":"Lujin"},"change_message_id":"620a9c8d74f02d757b82a51c51e1225d94d3f9e9","unresolved":false,"context_lines":[{"line_number":237,"context_line":"    # an OR\u0027ed value of status assigned to parent port from the"},{"line_number":238,"context_line":"    # distributedportbinding bucket"},{"line_number":239,"context_line":"    final_status \u003d n_const.PORT_STATUS_BUILD"},{"line_number":240,"context_line":"    query_objs \u003d port_obj.DistributedPortBinding.get_objects(context,"},{"line_number":241,"context_line":"                                                             port_id\u003dport_id)"},{"line_number":242,"context_line":"    for bind_obj in query_objs:"},{"line_number":243,"context_line":"        if bind_obj.status \u003d\u003d n_const.PORT_STATUS_ACTIVE:"}],"source_content_type":"text/x-python","patch_set":23,"id":"7a3c09a3_1a3a1a37","line":240,"range":{"start_line":240,"start_character":4,"end_line":240,"end_character":14},"in_reply_to":"ba5201f7_3b74b934","updated":"2017-01-17 09:45:32.000000000","message":"Done","commit_id":"6ce05e18eede9f9799e8e67d7421f17d653ba5bc"},{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"17434b504a168180449f3633874eeb1a272215a3","unresolved":false,"context_lines":[{"line_number":239,"context_line":"    final_status \u003d n_const.PORT_STATUS_BUILD"},{"line_number":240,"context_line":"    query_objs \u003d port_obj.DistributedPortBinding.get_objects(context,"},{"line_number":241,"context_line":"                                                             port_id\u003dport_id)"},{"line_number":242,"context_line":"    for bind_obj in query_objs:"},{"line_number":243,"context_line":"        if bind_obj.status \u003d\u003d n_const.PORT_STATUS_ACTIVE:"},{"line_number":244,"context_line":"            return bind_obj.status"},{"line_number":245,"context_line":"        elif bind_obj.status \u003d\u003d n_const.PORT_STATUS_DOWN:"}],"source_content_type":"text/x-python","patch_set":23,"id":"ba5201f7_bbad0986","line":242,"range":{"start_line":242,"start_character":8,"end_line":242,"end_character":16},"updated":"2017-01-11 20:16:58.000000000","message":"-\u003e bind\n\nto avoid some unrelated changes","commit_id":"6ce05e18eede9f9799e8e67d7421f17d653ba5bc"},{"author":{"_account_id":17491,"name":"Lujin Luo","email":"luo.lujin@jp.fujitsu.com","username":"Lujin"},"change_message_id":"620a9c8d74f02d757b82a51c51e1225d94d3f9e9","unresolved":false,"context_lines":[{"line_number":239,"context_line":"    final_status \u003d n_const.PORT_STATUS_BUILD"},{"line_number":240,"context_line":"    query_objs \u003d port_obj.DistributedPortBinding.get_objects(context,"},{"line_number":241,"context_line":"                                                             port_id\u003dport_id)"},{"line_number":242,"context_line":"    for bind_obj in query_objs:"},{"line_number":243,"context_line":"        if bind_obj.status \u003d\u003d n_const.PORT_STATUS_ACTIVE:"},{"line_number":244,"context_line":"            return bind_obj.status"},{"line_number":245,"context_line":"        elif bind_obj.status \u003d\u003d n_const.PORT_STATUS_DOWN:"}],"source_content_type":"text/x-python","patch_set":23,"id":"7a3c09a3_fa346e4b","line":242,"range":{"start_line":242,"start_character":8,"end_line":242,"end_character":16},"in_reply_to":"ba5201f7_bbad0986","updated":"2017-01-17 09:45:32.000000000","message":"Done","commit_id":"6ce05e18eede9f9799e8e67d7421f17d653ba5bc"},{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"17434b504a168180449f3633874eeb1a272215a3","unresolved":false,"context_lines":[{"line_number":248,"context_line":""},{"line_number":249,"context_line":""},{"line_number":250,"context_line":"def get_distributed_port_binding_by_host(context, port_id, host):"},{"line_number":251,"context_line":"    bindings \u003d port_obj.DistributedPortBinding.get_ids_startswith("},{"line_number":252,"context_line":"        context, port_id, host)"},{"line_number":253,"context_line":"    binding \u003d bindings.pop() if bindings else None"},{"line_number":254,"context_line":""}],"source_content_type":"text/x-python","patch_set":23,"id":"ba5201f7_bbe429e0","line":251,"updated":"2017-01-11 20:16:58.000000000","message":"same comment here: we can easily live with simple get_object call here.","commit_id":"6ce05e18eede9f9799e8e67d7421f17d653ba5bc"},{"author":{"_account_id":17491,"name":"Lujin Luo","email":"luo.lujin@jp.fujitsu.com","username":"Lujin"},"change_message_id":"620a9c8d74f02d757b82a51c51e1225d94d3f9e9","unresolved":false,"context_lines":[{"line_number":248,"context_line":""},{"line_number":249,"context_line":""},{"line_number":250,"context_line":"def get_distributed_port_binding_by_host(context, port_id, host):"},{"line_number":251,"context_line":"    bindings \u003d port_obj.DistributedPortBinding.get_ids_startswith("},{"line_number":252,"context_line":"        context, port_id, host)"},{"line_number":253,"context_line":"    binding \u003d bindings.pop() if bindings else None"},{"line_number":254,"context_line":""}],"source_content_type":"text/x-python","patch_set":23,"id":"7a3c09a3_da2fb2f4","line":251,"in_reply_to":"ba5201f7_bbe429e0","updated":"2017-01-17 09:45:32.000000000","message":"Done","commit_id":"6ce05e18eede9f9799e8e67d7421f17d653ba5bc"},{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"17434b504a168180449f3633874eeb1a272215a3","unresolved":false,"context_lines":[{"line_number":259,"context_line":""},{"line_number":260,"context_line":""},{"line_number":261,"context_line":"def get_distributed_port_bindings(context, port_id):"},{"line_number":262,"context_line":"    bindings \u003d port_obj.DistributedPortBinding.get_ids_startswith("},{"line_number":263,"context_line":"        context, port_id)"},{"line_number":264,"context_line":""},{"line_number":265,"context_line":"    if not bindings:"}],"source_content_type":"text/x-python","patch_set":23,"id":"ba5201f7_bbfb497a","line":262,"updated":"2017-01-11 20:16:58.000000000","message":"ditto, we can use get_objects","commit_id":"6ce05e18eede9f9799e8e67d7421f17d653ba5bc"},{"author":{"_account_id":17491,"name":"Lujin Luo","email":"luo.lujin@jp.fujitsu.com","username":"Lujin"},"change_message_id":"620a9c8d74f02d757b82a51c51e1225d94d3f9e9","unresolved":false,"context_lines":[{"line_number":259,"context_line":""},{"line_number":260,"context_line":""},{"line_number":261,"context_line":"def get_distributed_port_bindings(context, port_id):"},{"line_number":262,"context_line":"    bindings \u003d port_obj.DistributedPortBinding.get_ids_startswith("},{"line_number":263,"context_line":"        context, port_id)"},{"line_number":264,"context_line":""},{"line_number":265,"context_line":"    if not bindings:"}],"source_content_type":"text/x-python","patch_set":23,"id":"7a3c09a3_ba2ae6e5","line":262,"in_reply_to":"ba5201f7_bbfb497a","updated":"2017-01-17 09:45:32.000000000","message":"Done","commit_id":"6ce05e18eede9f9799e8e67d7421f17d653ba5bc"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"change_message_id":"b99eb05fb9dbc9f0a8f7b7efa6259b2f230a4293","unresolved":false,"context_lines":[{"line_number":40,"context_line":""},{"line_number":41,"context_line":""},{"line_number":42,"context_line":"def add_port_binding(context, port_id):"},{"line_number":43,"context_line":"    obj \u003d port_obj.PortBinding("},{"line_number":44,"context_line":"        context, port_id\u003dport_id, vif_type\u003dportbindings.VIF_TYPE_UNBOUND)"},{"line_number":45,"context_line":"    obj.create()"},{"line_number":46,"context_line":"    return obj"}],"source_content_type":"text/x-python","patch_set":24,"id":"7a3c09a3_47ac3b8c","line":43,"updated":"2017-01-17 09:59:57.000000000","message":"consider calling obj here binding","commit_id":"75c749045282e376b9bb129a8c1f66a4e1af1ab9"},{"author":{"_account_id":17491,"name":"Lujin Luo","email":"luo.lujin@jp.fujitsu.com","username":"Lujin"},"change_message_id":"90d86c43599ec40284383c555bba28acb9cc5233","unresolved":false,"context_lines":[{"line_number":40,"context_line":""},{"line_number":41,"context_line":""},{"line_number":42,"context_line":"def add_port_binding(context, port_id):"},{"line_number":43,"context_line":"    obj \u003d port_obj.PortBinding("},{"line_number":44,"context_line":"        context, port_id\u003dport_id, vif_type\u003dportbindings.VIF_TYPE_UNBOUND)"},{"line_number":45,"context_line":"    obj.create()"},{"line_number":46,"context_line":"    return obj"}],"source_content_type":"text/x-python","patch_set":24,"id":"7a3c09a3_1dc243e9","line":43,"in_reply_to":"7a3c09a3_47ac3b8c","updated":"2017-01-18 11:57:53.000000000","message":"Done","commit_id":"75c749045282e376b9bb129a8c1f66a4e1af1ab9"},{"author":{"_account_id":17491,"name":"Lujin Luo","email":"luo.lujin@jp.fujitsu.com","username":"Lujin"},"change_message_id":"0b6cc00e8ab0c1f84fbe60f007d9215f668e9a18","unresolved":false,"context_lines":[{"line_number":49,"context_line":"def get_locked_port_and_binding(context, port_id):"},{"line_number":50,"context_line":"    \"\"\"Get port record and portbinding object for update within transaction.\"\"\""},{"line_number":51,"context_line":""},{"line_number":52,"context_line":"    try:"},{"line_number":53,"context_line":"        # REVISIT(rkukura): We need the Port and PortBinding records"},{"line_number":54,"context_line":"        # to both be added to the session and locked for update. A"},{"line_number":55,"context_line":"        # single joined query should work, but the combination of left"}],"source_content_type":"text/x-python","patch_set":24,"id":"7a3c09a3_c71e6b5e","line":52,"range":{"start_line":52,"start_character":4,"end_line":52,"end_character":8},"updated":"2017-01-17 09:50:36.000000000","message":"I would like to move port lockmode to object in this PS too because I think the original logic here shows if either port or binding returns exception, we should return both port and binding as None. My concerns is if we only move binding lockmode in this PS and leaves port lockmode in later PS, we may overlook this constraint and resulting in a case where if port does not raise exception, port is returned and if binding does not raise exception, binding is returned. Just my two cents here","commit_id":"75c749045282e376b9bb129a8c1f66a4e1af1ab9"},{"author":{"_account_id":17491,"name":"Lujin Luo","email":"luo.lujin@jp.fujitsu.com","username":"Lujin"},"change_message_id":"90d86c43599ec40284383c555bba28acb9cc5233","unresolved":false,"context_lines":[{"line_number":49,"context_line":"def get_locked_port_and_binding(context, port_id):"},{"line_number":50,"context_line":"    \"\"\"Get port record and portbinding object for update within transaction.\"\"\""},{"line_number":51,"context_line":""},{"line_number":52,"context_line":"    try:"},{"line_number":53,"context_line":"        # REVISIT(rkukura): We need the Port and PortBinding records"},{"line_number":54,"context_line":"        # to both be added to the session and locked for update. A"},{"line_number":55,"context_line":"        # single joined query should work, but the combination of left"}],"source_content_type":"text/x-python","patch_set":24,"id":"7a3c09a3_7ddee7dd","line":52,"range":{"start_line":52,"start_character":4,"end_line":52,"end_character":8},"in_reply_to":"7a3c09a3_17bde9b6","updated":"2017-01-18 11:57:53.000000000","message":"Actually I think that patch overlooked the constraint I explained. My understanding of the original logic is if either port or port binding raises exception, both of them return as None. I think we need to add something as follows \n\nif port and binding:\n    return port, binding\nelse:\n    return None, None","commit_id":"75c749045282e376b9bb129a8c1f66a4e1af1ab9"},{"author":{"_account_id":15518,"name":"Artur Korzeniewski","email":"artur.korzen@wp.pl","username":"akorzeni"},"change_message_id":"387c99b87ba8d0ca9aff9bb25836e6fdf30c0a71","unresolved":false,"context_lines":[{"line_number":49,"context_line":"def get_locked_port_and_binding(context, port_id):"},{"line_number":50,"context_line":"    \"\"\"Get port record and portbinding object for update within transaction.\"\"\""},{"line_number":51,"context_line":""},{"line_number":52,"context_line":"    try:"},{"line_number":53,"context_line":"        # REVISIT(rkukura): We need the Port and PortBinding records"},{"line_number":54,"context_line":"        # to both be added to the session and locked for update. A"},{"line_number":55,"context_line":"        # single joined query should work, but the combination of left"}],"source_content_type":"text/x-python","patch_set":24,"id":"7a3c09a3_17bde9b6","line":52,"range":{"start_line":52,"start_character":4,"end_line":52,"end_character":8},"in_reply_to":"7a3c09a3_c71e6b5e","updated":"2017-01-17 18:10:43.000000000","message":"This patch [1] is doing what you described. We can incorporate that changes in this PS, or rebase this PS on top of [1]. \n\n[1] https://review.openstack.org/#/c/413815","commit_id":"75c749045282e376b9bb129a8c1f66a4e1af1ab9"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"change_message_id":"b99eb05fb9dbc9f0a8f7b7efa6259b2f230a4293","unresolved":false,"context_lines":[{"line_number":121,"context_line":"            status\u003dn_const.PORT_STATUS_DOWN)"},{"line_number":122,"context_line":"        binding_obj.create()"},{"line_number":123,"context_line":"        return binding_obj"},{"line_number":124,"context_line":"    except exceptions.NeutronDbObjectDuplicateEntry:"},{"line_number":125,"context_line":"        LOG.debug(\"Distributed Port %s already bound\", port_id)"},{"line_number":126,"context_line":"        return port_obj.DistributedPortBinding.get_object("},{"line_number":127,"context_line":"            context, port_id\u003dport_id, host\u003dhost)"}],"source_content_type":"text/x-python","patch_set":24,"id":"7a3c09a3_c733cb60","line":124,"updated":"2017-01-17 09:59:57.000000000","message":"this is really odd - you check that it exists above - unless its one of those ways that we try and protect against duplicates and races. You might as well try and create instead of reading at 108","commit_id":"75c749045282e376b9bb129a8c1f66a4e1af1ab9"},{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"e11d2446308ff191f1dfe5c72331778b99a5bc10","unresolved":false,"context_lines":[{"line_number":121,"context_line":"            status\u003dn_const.PORT_STATUS_DOWN)"},{"line_number":122,"context_line":"        binding_obj.create()"},{"line_number":123,"context_line":"        return binding_obj"},{"line_number":124,"context_line":"    except exceptions.NeutronDbObjectDuplicateEntry:"},{"line_number":125,"context_line":"        LOG.debug(\"Distributed Port %s already bound\", port_id)"},{"line_number":126,"context_line":"        return port_obj.DistributedPortBinding.get_object("},{"line_number":127,"context_line":"            context, port_id\u003dport_id, host\u003dhost)"}],"source_content_type":"text/x-python","patch_set":24,"id":"7a3c09a3_d3561c29","line":124,"in_reply_to":"7a3c09a3_c733cb60","updated":"2017-01-17 16:21:38.000000000","message":"I think this code exists for race handling, and the logic was present in the old side.","commit_id":"75c749045282e376b9bb129a8c1f66a4e1af1ab9"},{"author":{"_account_id":15518,"name":"Artur Korzeniewski","email":"artur.korzen@wp.pl","username":"akorzeni"},"change_message_id":"387c99b87ba8d0ca9aff9bb25836e6fdf30c0a71","unresolved":false,"context_lines":[{"line_number":121,"context_line":"            status\u003dn_const.PORT_STATUS_DOWN)"},{"line_number":122,"context_line":"        binding_obj.create()"},{"line_number":123,"context_line":"        return binding_obj"},{"line_number":124,"context_line":"    except exceptions.NeutronDbObjectDuplicateEntry:"},{"line_number":125,"context_line":"        LOG.debug(\"Distributed Port %s already bound\", port_id)"},{"line_number":126,"context_line":"        return port_obj.DistributedPortBinding.get_object("},{"line_number":127,"context_line":"            context, port_id\u003dport_id, host\u003dhost)"}],"source_content_type":"text/x-python","patch_set":24,"id":"7a3c09a3_4da8c0db","line":124,"in_reply_to":"7a3c09a3_d3561c29","updated":"2017-01-17 18:10:43.000000000","message":"Yes, it looks like race handling.","commit_id":"75c749045282e376b9bb129a8c1f66a4e1af1ab9"},{"author":{"_account_id":15518,"name":"Artur Korzeniewski","email":"artur.korzen@wp.pl","username":"akorzeni"},"change_message_id":"387c99b87ba8d0ca9aff9bb25836e6fdf30c0a71","unresolved":false,"context_lines":[{"line_number":220,"context_line":""},{"line_number":221,"context_line":""},{"line_number":222,"context_line":"def get_port_binding_host(context, port_id):"},{"line_number":223,"context_line":"    obj \u003d port_obj.PortBinding.get_object(context, port_id\u003dport_id)"},{"line_number":224,"context_line":"    if not obj:"},{"line_number":225,"context_line":"        LOG.debug(\"No binding found for port %(port_id)s\","},{"line_number":226,"context_line":"                  {\u0027port_id\u0027: port_id})"}],"source_content_type":"text/x-python","patch_set":24,"id":"7a3c09a3_cdb91017","line":223,"updated":"2017-01-17 18:10:43.000000000","message":"When we merge extending PK for binding to port_id and host, this line should be changed.","commit_id":"75c749045282e376b9bb129a8c1f66a4e1af1ab9"},{"author":{"_account_id":17491,"name":"Lujin Luo","email":"luo.lujin@jp.fujitsu.com","username":"Lujin"},"change_message_id":"90d86c43599ec40284383c555bba28acb9cc5233","unresolved":false,"context_lines":[{"line_number":220,"context_line":""},{"line_number":221,"context_line":""},{"line_number":222,"context_line":"def get_port_binding_host(context, port_id):"},{"line_number":223,"context_line":"    obj \u003d port_obj.PortBinding.get_object(context, port_id\u003dport_id)"},{"line_number":224,"context_line":"    if not obj:"},{"line_number":225,"context_line":"        LOG.debug(\"No binding found for port %(port_id)s\","},{"line_number":226,"context_line":"                  {\u0027port_id\u0027: port_id})"}],"source_content_type":"text/x-python","patch_set":24,"id":"7a3c09a3_fd65771d","line":223,"in_reply_to":"7a3c09a3_cdb91017","updated":"2017-01-18 11:57:53.000000000","message":"I will add a TODO here.","commit_id":"75c749045282e376b9bb129a8c1f66a4e1af1ab9"},{"author":{"_account_id":15518,"name":"Artur Korzeniewski","email":"artur.korzen@wp.pl","username":"akorzeni"},"change_message_id":"3f9f4999b09caa4780d7558d0883d256fba06b63","unresolved":false,"context_lines":[{"line_number":49,"context_line":"def get_locked_port_and_binding(context, port_id):"},{"line_number":50,"context_line":"    \"\"\"Get port record and portbinding object for update within transaction.\"\"\""},{"line_number":51,"context_line":""},{"line_number":52,"context_line":"    port \u003d port_obj.Port.get_port_with_lockmode(context, port_id)"},{"line_number":53,"context_line":"    binding \u003d port_obj.PortBinding.get_binding_with_lockmode("},{"line_number":54,"context_line":"        context, port_id)"},{"line_number":55,"context_line":"    if port and binding:"}],"source_content_type":"text/x-python","patch_set":26,"id":"7a3c09a3_e6015706","line":52,"updated":"2017-01-18 14:40:04.000000000","message":"I see that returning Port OVO is not supported yet, because UT are failing. I would return db object from Port.get_port_with_lockmode.","commit_id":"ac780ec6b5f5faf611682715b670ccdc10d4328c"},{"author":{"_account_id":8726,"name":"Victor Morales","email":"chipahuac@hotmail.com","username":"electrocucaracha"},"change_message_id":"35c3e255a00143300938a0c344095ee62968f87d","unresolved":false,"context_lines":[{"line_number":114,"context_line":"        return binding_obj"},{"line_number":115,"context_line":"    except exceptions.NeutronDbObjectDuplicateEntry:"},{"line_number":116,"context_line":"        LOG.debug(\"Distributed Port %s already bound\", port_id)"},{"line_number":117,"context_line":"        return port_obj.DistributedPortBinding.get_object("},{"line_number":118,"context_line":"            context, port_id\u003dport_id, host\u003dhost)"},{"line_number":119,"context_line":""},{"line_number":120,"context_line":""}],"source_content_type":"text/x-python","patch_set":27,"id":"5a3905b3_f78619b8","line":117,"range":{"start_line":117,"start_character":47,"end_line":117,"end_character":57},"updated":"2017-01-19 23:41:03.000000000","message":"Interesting the previous implementation seems like it\u0027s returning a boolean value but makes more sense to return an object","commit_id":"03238ffce6ea07e4b6e5b71d2e689b4cf6e63375"},{"author":{"_account_id":7787,"name":"Kevin Benton","email":"kevin@benton.pub","username":"blak111"},"change_message_id":"3da1d9aa6f809a74fb68012f92cd56abb6517d22","unresolved":false,"context_lines":[{"line_number":46,"context_line":"    return binding"},{"line_number":47,"context_line":""},{"line_number":48,"context_line":""},{"line_number":49,"context_line":"def get_locked_port_and_binding(context, port_id):"},{"line_number":50,"context_line":"    \"\"\"Get port record and portbinding object for update within transaction.\"\"\""},{"line_number":51,"context_line":""},{"line_number":52,"context_line":"    port \u003d port_obj.Port.get_port_with_lockmode(context, port_id)"}],"source_content_type":"text/x-python","patch_set":28,"id":"5a3905b3_03c835a5","line":49,"updated":"2017-01-23 22:09:03.000000000","message":"leave this function as it is, i\u0027m trying to get rid of it here: https://review.openstack.org/#/c/423581/","commit_id":"c7bf051e5e6e223c1d585fd361779b91ea5f7647"},{"author":{"_account_id":15518,"name":"Artur Korzeniewski","email":"artur.korzen@wp.pl","username":"akorzeni"},"change_message_id":"613f9fb88a727c73fa9b30f8113f0c600fc4665e","unresolved":false,"context_lines":[{"line_number":238,"context_line":"    return bindings"},{"line_number":239,"context_line":""},{"line_number":240,"context_line":""},{"line_number":241,"context_line":"def get_port_binding_host(context, port_id):"},{"line_number":242,"context_line":"    # TODO(lujinluo): change get_object() to get_objects() after"},{"line_number":243,"context_line":"    # we merge extending PK for port binding to port_id and host"},{"line_number":244,"context_line":"    obj \u003d port_obj.PortBinding.get_object(context, port_id\u003dport_id)"}],"source_content_type":"text/x-python","patch_set":35,"id":"3a461143_bf066d83","line":241,"updated":"2017-02-01 08:31:25.000000000","message":"I have added this method, since it would be better to rework it then add the \u0027get_port_bindings\u0027 method above.\nIt should look like:\n\n    objs \u003d port_obj.PortBinding.get_objects(context, \n        port_id\u003dport_id, status\u003d\u0027ACTIVE\u0027)\n    if not objs:\n        LOG.debug(\"No binding found for port %(port_id)s\",\n                  {\u0027port_id\u0027: port_id})\n        return\n    return obj.pop().host","commit_id":"b4d209a2d4710c3567a23daaa5ab8bd143fcf52b"},{"author":{"_account_id":15518,"name":"Artur Korzeniewski","email":"artur.korzen@wp.pl","username":"akorzeni"},"change_message_id":"ce53d19ef62e4255b57b9b57c78b97197d5050b2","unresolved":false,"context_lines":[{"line_number":238,"context_line":"    return bindings"},{"line_number":239,"context_line":""},{"line_number":240,"context_line":""},{"line_number":241,"context_line":"def get_port_binding_host(context, port_id):"},{"line_number":242,"context_line":"    # TODO(lujinluo): change get_object() to get_objects() after"},{"line_number":243,"context_line":"    # we merge extending PK for port binding to port_id and host"},{"line_number":244,"context_line":"    obj \u003d port_obj.PortBinding.get_object(context, port_id\u003dport_id)"}],"source_content_type":"text/x-python","patch_set":35,"id":"3a461143_e755cbf9","line":241,"in_reply_to":"3a461143_bf066d83","updated":"2017-02-01 09:47:40.000000000","message":"After second look at usage scenario, my above comment is invalid. We should return all port binding, as it is done for distributed port binding in:\nhttps://review.openstack.org/#/c/407868/35/neutron/plugins/ml2/plugin.py@1849","commit_id":"b4d209a2d4710c3567a23daaa5ab8bd143fcf52b"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"change_message_id":"660062a6821d5ca8413044e76f5ca2bab1cf7293","unresolved":false,"context_lines":[{"line_number":43,"context_line":""},{"line_number":44,"context_line":"@db_api.context_manager.writer"},{"line_number":45,"context_line":"def add_port_binding(context, port_id, host\u003d\u0027\u0027):"},{"line_number":46,"context_line":"    binding \u003d port_obj.PortBinding("},{"line_number":47,"context_line":"        context, port_id\u003dport_id, host\u003dhost,"},{"line_number":48,"context_line":"        vif_type\u003dportbindings.VIF_TYPE_UNBOUND)"},{"line_number":49,"context_line":"    binding.create()"}],"source_content_type":"text/x-python","patch_set":68,"id":"1f485f77_fdc98b58","line":46,"range":{"start_line":46,"start_character":4,"end_line":46,"end_character":11},"updated":"2017-11-16 11:36:46.000000000","message":"can we call things binding_obj?","commit_id":"39432f80f6f49d7558633dbb6e56997770f48802"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"change_message_id":"660062a6821d5ca8413044e76f5ca2bab1cf7293","unresolved":false,"context_lines":[{"line_number":109,"context_line":"        binding_obj.create()"},{"line_number":110,"context_line":"        return binding_obj"},{"line_number":111,"context_line":"    except exceptions.NeutronDbObjectDuplicateEntry:"},{"line_number":112,"context_line":"        LOG.debug(\"Distributed Port %s already bound\", port_id)"},{"line_number":113,"context_line":"        return port_obj.DistributedPortBinding.get_object("},{"line_number":114,"context_line":"            context, port_id\u003dport_id, host\u003dhost)"},{"line_number":115,"context_line":""}],"source_content_type":"text/x-python","patch_set":68,"id":"1f485f77_dd45afb5","line":112,"updated":"2017-11-16 11:36:46.000000000","message":"this is pretty dodgy - and unrelated to this patch - if this is due to a race then why do we just not try and create and if there is a dup then the object exists. saves a read","commit_id":"39432f80f6f49d7558633dbb6e56997770f48802"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"change_message_id":"660062a6821d5ca8413044e76f5ca2bab1cf7293","unresolved":false,"context_lines":[{"line_number":210,"context_line":""},{"line_number":211,"context_line":""},{"line_number":212,"context_line":"def get_port_binding_host(context, port_id):"},{"line_number":213,"context_line":"    binding \u003d port_obj.PortBinding.get_objects("},{"line_number":214,"context_line":"        context, port_id\u003dobj_utils.StringStarts(port_id))"},{"line_number":215,"context_line":"    if not binding:"},{"line_number":216,"context_line":"        LOG.debug(\"No binding found for port %(port_id)s\","}],"source_content_type":"text/x-python","patch_set":68,"id":"1f485f77_7d1a3bcc","line":213,"range":{"start_line":213,"start_character":4,"end_line":213,"end_character":11},"updated":"2017-11-16 11:36:46.000000000","message":"bindings?","commit_id":"39432f80f6f49d7558633dbb6e56997770f48802"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"change_message_id":"660062a6821d5ca8413044e76f5ca2bab1cf7293","unresolved":false,"context_lines":[{"line_number":246,"context_line":"        LOG.debug(\"No binding for distributed port %(port_id)s with host \""},{"line_number":247,"context_line":"                  \"%(host)s\", {\u0027port_id\u0027: port_id, \u0027host\u0027: host})"},{"line_number":248,"context_line":"    else:"},{"line_number":249,"context_line":"        binding_obj \u003d port_obj.DistributedPortBinding._load_object("},{"line_number":250,"context_line":"            context, binding)"},{"line_number":251,"context_line":"    return binding_obj if binding else None"},{"line_number":252,"context_line":""}],"source_content_type":"text/x-python","patch_set":68,"id":"1f485f77_3d85e3cf","line":249,"range":{"start_line":249,"start_character":54,"end_line":249,"end_character":66},"updated":"2017-11-16 11:36:46.000000000","message":"we also should be using private methods","commit_id":"39432f80f6f49d7558633dbb6e56997770f48802"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"change_message_id":"660062a6821d5ca8413044e76f5ca2bab1cf7293","unresolved":false,"context_lines":[{"line_number":246,"context_line":"        LOG.debug(\"No binding for distributed port %(port_id)s with host \""},{"line_number":247,"context_line":"                  \"%(host)s\", {\u0027port_id\u0027: port_id, \u0027host\u0027: host})"},{"line_number":248,"context_line":"    else:"},{"line_number":249,"context_line":"        binding_obj \u003d port_obj.DistributedPortBinding._load_object("},{"line_number":250,"context_line":"            context, binding)"},{"line_number":251,"context_line":"    return binding_obj if binding else None"},{"line_number":252,"context_line":""}],"source_content_type":"text/x-python","patch_set":68,"id":"1f485f77_fd250b0a","line":249,"updated":"2017-11-16 11:36:46.000000000","message":"why are we using the dn code above?","commit_id":"39432f80f6f49d7558633dbb6e56997770f48802"},{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"231c4991ba00d62a2f26e754f3ec6b540186056a","unresolved":false,"context_lines":[{"line_number":42,"context_line":""},{"line_number":43,"context_line":""},{"line_number":44,"context_line":"@db_api.context_manager.writer"},{"line_number":45,"context_line":"def add_port_binding(context, port_id, host\u003d\u0027\u0027):"},{"line_number":46,"context_line":"    binding \u003d port_obj.PortBinding("},{"line_number":47,"context_line":"        context, port_id\u003dport_id, host\u003dhost,"},{"line_number":48,"context_line":"        vif_type\u003dportbindings.VIF_TYPE_UNBOUND)"}],"source_content_type":"text/x-python","patch_set":78,"id":"df87a7cf_58e22f31","line":45,"range":{"start_line":45,"start_character":37,"end_line":45,"end_character":46},"updated":"2017-12-06 19:48:49.000000000","message":"we should instead make \u0027\u0027 the default value for host field in OVO. then you don\u0027t need to pass it explicitly here.","commit_id":"429eab719f78c3f48fa7a32c55332cce80cb0c68"},{"author":{"_account_id":17491,"name":"Lujin Luo","email":"luo.lujin@jp.fujitsu.com","username":"Lujin"},"change_message_id":"e52e819d3369fa22568eded9b9b598c6f41fdda9","unresolved":false,"context_lines":[{"line_number":42,"context_line":""},{"line_number":43,"context_line":""},{"line_number":44,"context_line":"@db_api.context_manager.writer"},{"line_number":45,"context_line":"def add_port_binding(context, port_id, host\u003d\u0027\u0027):"},{"line_number":46,"context_line":"    binding \u003d port_obj.PortBinding("},{"line_number":47,"context_line":"        context, port_id\u003dport_id, host\u003dhost,"},{"line_number":48,"context_line":"        vif_type\u003dportbindings.VIF_TYPE_UNBOUND)"}],"source_content_type":"text/x-python","patch_set":78,"id":"df87a7cf_ba8565d1","line":45,"range":{"start_line":45,"start_character":37,"end_line":45,"end_character":46},"in_reply_to":"df87a7cf_58e22f31","updated":"2017-12-07 08:50:15.000000000","message":"OK, I will move it to OVO, and remove \u0027host\u0027 parameter here. If later on others need to pass host as a parameter, they can modify it accordingly.","commit_id":"429eab719f78c3f48fa7a32c55332cce80cb0c68"},{"author":{"_account_id":11975,"name":"Slawek Kaplonski","email":"skaplons@redhat.com","username":"slaweq"},"change_message_id":"7d16c75d91ef3c33d86b13e5aa6a7f0a2195f64b","unresolved":false,"context_lines":[{"line_number":94,"context_line":"    binding_obj \u003d port_obj.DistributedPortBinding.get_object("},{"line_number":95,"context_line":"        context, port_id\u003dport_id, host\u003dhost)"},{"line_number":96,"context_line":"    if binding_obj:"},{"line_number":97,"context_line":"        return binding_obj"},{"line_number":98,"context_line":""},{"line_number":99,"context_line":"    try:"},{"line_number":100,"context_line":"        binding_obj \u003d port_obj.DistributedPortBinding("}],"source_content_type":"text/x-python","patch_set":80,"id":"df87a7cf_009b7217","line":97,"updated":"2017-12-11 10:09:59.000000000","message":"nit: it could be written in one line:\n\n    return binding_obj or None","commit_id":"ee3c52a60752586c7d0c261acf7fcfec9eeaff05"},{"author":{"_account_id":17491,"name":"Lujin Luo","email":"luo.lujin@jp.fujitsu.com","username":"Lujin"},"change_message_id":"ba2445effd4b3a08870417d258d5eba0e7fc1cba","unresolved":false,"context_lines":[{"line_number":94,"context_line":"    binding_obj \u003d port_obj.DistributedPortBinding.get_object("},{"line_number":95,"context_line":"        context, port_id\u003dport_id, host\u003dhost)"},{"line_number":96,"context_line":"    if binding_obj:"},{"line_number":97,"context_line":"        return binding_obj"},{"line_number":98,"context_line":""},{"line_number":99,"context_line":"    try:"},{"line_number":100,"context_line":"        binding_obj \u003d port_obj.DistributedPortBinding("}],"source_content_type":"text/x-python","patch_set":80,"id":"df87a7cf_84869f65","line":97,"in_reply_to":"df87a7cf_009b7217","updated":"2017-12-12 01:47:48.000000000","message":"Hmm, IMHO, we cannot do that. This code is a bit doggy as it first checks if DistributedPortBinding exist. If it does, return it. If it does not, create one.\n\nIf we use \n        return binding_obj or None\n\nwe shall never enter the following creation part.","commit_id":"ee3c52a60752586c7d0c261acf7fcfec9eeaff05"}],"neutron/plugins/ml2/driver_context.py":[{"author":{"_account_id":15518,"name":"Artur Korzeniewski","email":"artur.korzen@wp.pl","username":"akorzeni"},"change_message_id":"5492ebfd7e7abbcdd81b468d962a8c459c2775c7","unresolved":false,"context_lines":[{"line_number":247,"context_line":"        self._new_bound_segment \u003d segment_id"},{"line_number":248,"context_line":"        self._binding.vif_type \u003d vif_type"},{"line_number":249,"context_line":"        self._binding.vif_details \u003d vif_details"},{"line_number":250,"context_line":"        # self._binding.update()"},{"line_number":251,"context_line":"        self._new_port_status \u003d status"},{"line_number":252,"context_line":""},{"line_number":253,"context_line":"    def continue_binding(self, segment_id, next_segments_to_bind):"}],"source_content_type":"text/x-python","patch_set":12,"id":"1a6eadb0_e9d573b9","line":250,"range":{"start_line":250,"start_character":7,"end_line":250,"end_character":32},"updated":"2016-12-19 16:50:47.000000000","message":"I\u0027m not sure if this should stay or be removed. The attributes set in set_binding are \u0027committed\u0027 ml2 plugin, but maybe it can be updated here, we will see.","commit_id":"eb606cefc90a7d2f7232d3f084d93f6c86183566"},{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"17434b504a168180449f3633874eeb1a272215a3","unresolved":false,"context_lines":[{"line_number":247,"context_line":"        self._new_bound_segment \u003d segment_id"},{"line_number":248,"context_line":"        self._binding.vif_type \u003d vif_type"},{"line_number":249,"context_line":"        self._binding.vif_details \u003d vif_details"},{"line_number":250,"context_line":"        # self._binding.update()"},{"line_number":251,"context_line":"        self._new_port_status \u003d status"},{"line_number":252,"context_line":""},{"line_number":253,"context_line":"    def continue_binding(self, segment_id, next_segments_to_bind):"}],"source_content_type":"text/x-python","patch_set":23,"id":"ba5201f7_1bf7f58b","line":250,"updated":"2017-01-11 20:16:58.000000000","message":"remove?","commit_id":"6ce05e18eede9f9799e8e67d7421f17d653ba5bc"},{"author":{"_account_id":17491,"name":"Lujin Luo","email":"luo.lujin@jp.fujitsu.com","username":"Lujin"},"change_message_id":"620a9c8d74f02d757b82a51c51e1225d94d3f9e9","unresolved":false,"context_lines":[{"line_number":247,"context_line":"        self._new_bound_segment \u003d segment_id"},{"line_number":248,"context_line":"        self._binding.vif_type \u003d vif_type"},{"line_number":249,"context_line":"        self._binding.vif_details \u003d vif_details"},{"line_number":250,"context_line":"        # self._binding.update()"},{"line_number":251,"context_line":"        self._new_port_status \u003d status"},{"line_number":252,"context_line":""},{"line_number":253,"context_line":"    def continue_binding(self, segment_id, next_segments_to_bind):"}],"source_content_type":"text/x-python","patch_set":23,"id":"7a3c09a3_9a2c4aad","line":250,"in_reply_to":"ba5201f7_1bf7f58b","updated":"2017-01-17 09:45:32.000000000","message":"Done","commit_id":"6ce05e18eede9f9799e8e67d7421f17d653ba5bc"},{"author":{"_account_id":16688,"name":"Rodolfo Alonso","email":"ralonsoh@redhat.com","username":"rodolfo-alonso-hernandez"},"change_message_id":"ffa68917b3dcd84e0b9632b7eae7668a62603db2","unresolved":false,"context_lines":[{"line_number":269,"context_line":"        # TODO(rkukura) Verify binding allowed, segment in network"},{"line_number":270,"context_line":"        self._new_bound_segment \u003d segment_id"},{"line_number":271,"context_line":"        self._binding.vif_type \u003d vif_type"},{"line_number":272,"context_line":"        self._binding.vif_details \u003d vif_details"},{"line_number":273,"context_line":"        self._new_port_status \u003d status"},{"line_number":274,"context_line":""},{"line_number":275,"context_line":"    def continue_binding(self, segment_id, next_segments_to_bind):"}],"source_content_type":"text/x-python","patch_set":55,"id":"1f013ff3_b324d50e","line":272,"range":{"start_line":272,"start_character":36,"end_line":272,"end_character":47},"updated":"2017-05-16 10:23:04.000000000","message":"This change should have been done in https://review.openstack.org/#/c/411830/. IMO, this is out of scope in this patch and should be in it\u0027s own patch.","commit_id":"cd8a99d95429b89295d421d0bac170509baa24ce"},{"author":{"_account_id":16688,"name":"Rodolfo Alonso","email":"ralonsoh@redhat.com","username":"rodolfo-alonso-hernandez"},"change_message_id":"8de040d1a9f97aeffa06b75783ada9f50152209f","unresolved":false,"context_lines":[{"line_number":269,"context_line":"        # TODO(rkukura) Verify binding allowed, segment in network"},{"line_number":270,"context_line":"        self._new_bound_segment \u003d segment_id"},{"line_number":271,"context_line":"        self._binding.vif_type \u003d vif_type"},{"line_number":272,"context_line":"        self._binding.vif_details \u003d vif_details"},{"line_number":273,"context_line":"        self._new_port_status \u003d status"},{"line_number":274,"context_line":""},{"line_number":275,"context_line":"    def continue_binding(self, segment_id, next_segments_to_bind):"}],"source_content_type":"text/x-python","patch_set":55,"id":"3f1d235d_d14011a8","line":272,"range":{"start_line":272,"start_character":36,"end_line":272,"end_character":47},"in_reply_to":"1f013ff3_b324d50e","updated":"2017-07-05 07:58:21.000000000","message":"Hi Lujin. No reply to this comment?","commit_id":"cd8a99d95429b89295d421d0bac170509baa24ce"},{"author":{"_account_id":17491,"name":"Lujin Luo","email":"luo.lujin@jp.fujitsu.com","username":"Lujin"},"change_message_id":"5c48be1881f2d10a0a74bd42c9e2112ed6ae170c","unresolved":false,"context_lines":[{"line_number":269,"context_line":"        # TODO(rkukura) Verify binding allowed, segment in network"},{"line_number":270,"context_line":"        self._new_bound_segment \u003d segment_id"},{"line_number":271,"context_line":"        self._binding.vif_type \u003d vif_type"},{"line_number":272,"context_line":"        self._binding.vif_details \u003d vif_details"},{"line_number":273,"context_line":"        self._new_port_status \u003d status"},{"line_number":274,"context_line":""},{"line_number":275,"context_line":"    def continue_binding(self, segment_id, next_segments_to_bind):"}],"source_content_type":"text/x-python","patch_set":55,"id":"1f1a1f67_4dcf5d29","line":272,"range":{"start_line":272,"start_character":36,"end_line":272,"end_character":47},"in_reply_to":"1f1a1f67_42091a2a","updated":"2017-07-20 08:37:48.000000000","message":"Cleanup patch is here now: \u003chttps://review.openstack.org/#/c/485490/\u003e.","commit_id":"cd8a99d95429b89295d421d0bac170509baa24ce"},{"author":{"_account_id":17491,"name":"Lujin Luo","email":"luo.lujin@jp.fujitsu.com","username":"Lujin"},"change_message_id":"2848d9a14ea1f2db784050762094ad2af675bd29","unresolved":false,"context_lines":[{"line_number":269,"context_line":"        # TODO(rkukura) Verify binding allowed, segment in network"},{"line_number":270,"context_line":"        self._new_bound_segment \u003d segment_id"},{"line_number":271,"context_line":"        self._binding.vif_type \u003d vif_type"},{"line_number":272,"context_line":"        self._binding.vif_details \u003d vif_details"},{"line_number":273,"context_line":"        self._new_port_status \u003d status"},{"line_number":274,"context_line":""},{"line_number":275,"context_line":"    def continue_binding(self, segment_id, next_segments_to_bind):"}],"source_content_type":"text/x-python","patch_set":55,"id":"1f1a1f67_42091a2a","line":272,"range":{"start_line":272,"start_character":36,"end_line":272,"end_character":47},"in_reply_to":"3f1d235d_d14011a8","updated":"2017-07-14 06:38:03.000000000","message":"Hi, I am sorry for my late reply. I was trying to get this patch pass all the tempests first. \n\nThis changes indeed is a leftover of the patch you linked to, but I kinda feel unnecessary to split it from here. But if you think it is better, I can push another patch to clean it up.","commit_id":"cd8a99d95429b89295d421d0bac170509baa24ce"},{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"231c4991ba00d62a2f26e754f3ec6b540186056a","unresolved":false,"context_lines":[{"line_number":123,"context_line":"        else:"},{"line_number":124,"context_line":"            self._network_context \u003d NetworkContext("},{"line_number":125,"context_line":"                plugin, plugin_context, network) if network else None"},{"line_number":126,"context_line":"        # NOTE(kevinbenton): InstanceSnapshot can go away once we are working"},{"line_number":127,"context_line":"        # with OVO objects instead of native SQLA objects."},{"line_number":128,"context_line":"        self._binding \u003d binding"},{"line_number":129,"context_line":"        self._binding_levels \u003d [InstanceSnapshot(l)"}],"source_content_type":"text/x-python","patch_set":78,"id":"df87a7cf_782853e1","line":126,"updated":"2017-12-06 19:48:49.000000000","message":"this NOTE should be removed now","commit_id":"429eab719f78c3f48fa7a32c55332cce80cb0c68"},{"author":{"_account_id":17491,"name":"Lujin Luo","email":"luo.lujin@jp.fujitsu.com","username":"Lujin"},"change_message_id":"e52e819d3369fa22568eded9b9b598c6f41fdda9","unresolved":false,"context_lines":[{"line_number":123,"context_line":"        else:"},{"line_number":124,"context_line":"            self._network_context \u003d NetworkContext("},{"line_number":125,"context_line":"                plugin, plugin_context, network) if network else None"},{"line_number":126,"context_line":"        # NOTE(kevinbenton): InstanceSnapshot can go away once we are working"},{"line_number":127,"context_line":"        # with OVO objects instead of native SQLA objects."},{"line_number":128,"context_line":"        self._binding \u003d binding"},{"line_number":129,"context_line":"        self._binding_levels \u003d [InstanceSnapshot(l)"}],"source_content_type":"text/x-python","patch_set":78,"id":"df87a7cf_5a6e992f","line":126,"in_reply_to":"df87a7cf_782853e1","updated":"2017-12-07 08:50:15.000000000","message":"Done","commit_id":"429eab719f78c3f48fa7a32c55332cce80cb0c68"}],"neutron/plugins/ml2/models.py":[{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"231c4991ba00d62a2f26e754f3ec6b540186056a","unresolved":false,"context_lines":[{"line_number":125,"context_line":"        models_v2.Port,"},{"line_number":126,"context_line":"        load_on_pending\u003dTrue,"},{"line_number":127,"context_line":"        backref\u003dorm.backref(\"distributed_port_binding\","},{"line_number":128,"context_line":"                            lazy\u003d\u0027joined\u0027,"},{"line_number":129,"context_line":"                            cascade\u003d\u0027delete\u0027))"},{"line_number":130,"context_line":"    revises_on_change \u003d (\u0027port\u0027, )"}],"source_content_type":"text/x-python","patch_set":78,"id":"df87a7cf_029f51b4","line":128,"updated":"2017-12-06 19:48:49.000000000","message":"there seems to be a reason why we use subquery here: I6952c48236153a8e2f2f155375b70573ddc2cf0f though I don\u0027t have immediate grasp of the intent there. I think we need to consult with Armando/Anna and maybe Kevin about the change before proceeding.\n\nCould you please explain here why you think it\u0027s needed, what breaks without it, so that we can follow up with persons listed above?","commit_id":"429eab719f78c3f48fa7a32c55332cce80cb0c68"},{"author":{"_account_id":17491,"name":"Lujin Luo","email":"luo.lujin@jp.fujitsu.com","username":"Lujin"},"change_message_id":"e52e819d3369fa22568eded9b9b598c6f41fdda9","unresolved":false,"context_lines":[{"line_number":125,"context_line":"        models_v2.Port,"},{"line_number":126,"context_line":"        load_on_pending\u003dTrue,"},{"line_number":127,"context_line":"        backref\u003dorm.backref(\"distributed_port_binding\","},{"line_number":128,"context_line":"                            lazy\u003d\u0027joined\u0027,"},{"line_number":129,"context_line":"                            cascade\u003d\u0027delete\u0027))"},{"line_number":130,"context_line":"    revises_on_change \u003d (\u0027port\u0027, )"}],"source_content_type":"text/x-python","patch_set":78,"id":"df87a7cf_7a3d98c2","line":128,"in_reply_to":"df87a7cf_029f51b4","updated":"2017-12-07 08:50:15.000000000","message":"[1] is the latest version without this change. You can find more details there. \n\nFrom my understanding is that subquery triggers one more select query than joined, and this caused that not only distributedportbinding SQLA object but also OVO object. \n\nBut I have 2 concerns of making this change. \n\n1) I am wondering why this only happens in Tempest tests, not UTs. Maybe it is caused by some race conditions?\n\n2) As you root to the cause of where ths error is triggered, it is when we are deleting port. Thus, I am wondering if we switch to Port OVO, will we still have these failure?","commit_id":"429eab719f78c3f48fa7a32c55332cce80cb0c68"},{"author":{"_account_id":17491,"name":"Lujin Luo","email":"luo.lujin@jp.fujitsu.com","username":"Lujin"},"change_message_id":"15937aa47cb38a8f948d64227cc8f487ddf480e4","unresolved":false,"context_lines":[{"line_number":125,"context_line":"        models_v2.Port,"},{"line_number":126,"context_line":"        load_on_pending\u003dTrue,"},{"line_number":127,"context_line":"        backref\u003dorm.backref(\"distributed_port_binding\","},{"line_number":128,"context_line":"                            lazy\u003d\u0027joined\u0027,"},{"line_number":129,"context_line":"                            cascade\u003d\u0027delete\u0027))"},{"line_number":130,"context_line":"    revises_on_change \u003d (\u0027port\u0027, )"}],"source_content_type":"text/x-python","patch_set":78,"id":"df87a7cf_ba5480ff","line":128,"in_reply_to":"df87a7cf_7a3d98c2","updated":"2017-12-07 08:51:20.000000000","message":"[1] http://logs.openstack.org/68/407868/75/check/legacy-tempest-dsvm-neutron-dvr/3b5f642/","commit_id":"429eab719f78c3f48fa7a32c55332cce80cb0c68"},{"author":{"_account_id":11975,"name":"Slawek Kaplonski","email":"skaplons@redhat.com","username":"slaweq"},"change_message_id":"7d16c75d91ef3c33d86b13e5aa6a7f0a2195f64b","unresolved":false,"context_lines":[{"line_number":125,"context_line":"        models_v2.Port,"},{"line_number":126,"context_line":"        load_on_pending\u003dTrue,"},{"line_number":127,"context_line":"        backref\u003dorm.backref(\"distributed_port_binding\","},{"line_number":128,"context_line":"                            lazy\u003d\u0027joined\u0027,"},{"line_number":129,"context_line":"                            cascade\u003d\u0027delete\u0027))"},{"line_number":130,"context_line":"    revises_on_change \u003d (\u0027port\u0027, )"}],"source_content_type":"text/x-python","patch_set":80,"id":"df87a7cf_a09de60a","line":128,"updated":"2017-12-11 10:09:59.000000000","message":"why You are changing technique of relationship loading?","commit_id":"ee3c52a60752586c7d0c261acf7fcfec9eeaff05"},{"author":{"_account_id":17491,"name":"Lujin Luo","email":"luo.lujin@jp.fujitsu.com","username":"Lujin"},"change_message_id":"ba2445effd4b3a08870417d258d5eba0e7fc1cba","unresolved":false,"context_lines":[{"line_number":125,"context_line":"        models_v2.Port,"},{"line_number":126,"context_line":"        load_on_pending\u003dTrue,"},{"line_number":127,"context_line":"        backref\u003dorm.backref(\"distributed_port_binding\","},{"line_number":128,"context_line":"                            lazy\u003d\u0027joined\u0027,"},{"line_number":129,"context_line":"                            cascade\u003d\u0027delete\u0027))"},{"line_number":130,"context_line":"    revises_on_change \u003d (\u0027port\u0027, )"}],"source_content_type":"text/x-python","patch_set":80,"id":"df87a7cf_04fb6fc0","line":128,"in_reply_to":"df87a7cf_a09de60a","updated":"2017-12-12 01:47:48.000000000","message":"This is what I want to discuss with db experts. Before I made this change, I was facing this kind of failure [1]. As you can see the root cause is [2], when we are trying to delete port, it cascades the deletion of DistributedPortBinding. From the error msg, not only DistributedPortBinding OVO is queried but also DistributedPortBinding db object, which results in the cannot attach session agian failure. \n\nYou can find some more details I explained in previous PS [3].\n\n[1] http://logs.openstack.org/68/407868/75/check/legacy-tempest-dsvm-neutron-dvr/3b5f642/logs/screen-q-svc.txt.gz?level\u003dERROR\n[2] File \"/opt/stack/new/neutron/neutron/db/ipam_pluggable_backend.py\", line 423, in delete_port\n[3] https://review.openstack.org/#/c/407868/78/neutron/plugins/ml2/models.py","commit_id":"ee3c52a60752586c7d0c261acf7fcfec9eeaff05"}],"neutron/plugins/ml2/plugin.py":[{"author":{"_account_id":17491,"name":"Lujin Luo","email":"luo.lujin@jp.fujitsu.com","username":"Lujin"},"change_message_id":"ff62ec735a3af04eac6abb940c6240afbee1f4d0","unresolved":false,"context_lines":[{"line_number":341,"context_line":""},{"line_number":342,"context_line":"        if port[\u0027device_owner\u0027] \u003d\u003d const.DEVICE_OWNER_DVR_INTERFACE:"},{"line_number":343,"context_line":"            binding.vif_type \u003d portbindings.VIF_TYPE_UNBOUND"},{"line_number":344,"context_line":"            binding.vif_details \u003d \u0027\u0027"},{"line_number":345,"context_line":"            db.clear_binding_levels(session, port_id, original_host)"},{"line_number":346,"context_line":"            mech_context._clear_binding_levels()"},{"line_number":347,"context_line":"            binding.host \u003d \u0027\u0027"}],"source_content_type":"text/x-python","patch_set":9,"id":"1a6eadb0_741e0671","line":344,"range":{"start_line":344,"start_character":12,"end_line":344,"end_character":36},"updated":"2016-12-16 00:47:31.000000000","message":"This is where I found something interesting. I was also reviewing the ongoing DistributedPortBinding patch [1]. That patch did not make any changes to this line and it is not encountering the type mismatch error. vif_details is aslo stored as DictOfString in DistributedPortBinding.\n\n[1] https://review.openstack.org/#/c/382567/","commit_id":"fb27b72fd5c1b4632e8f71156e4b1ddd0ad24701"},{"author":{"_account_id":17491,"name":"Lujin Luo","email":"luo.lujin@jp.fujitsu.com","username":"Lujin"},"change_message_id":"ff62ec735a3af04eac6abb940c6240afbee1f4d0","unresolved":false,"context_lines":[{"line_number":413,"context_line":"        # transaction."},{"line_number":414,"context_line":"        port \u003d orig_context.current"},{"line_number":415,"context_line":"        orig_binding \u003d orig_context._binding"},{"line_number":416,"context_line":"        # missing port-id when creating new object"},{"line_number":417,"context_line":"        new_binding \u003d obj_port.PortBinding("},{"line_number":418,"context_line":"            orig_context._plugin_context,"},{"line_number":419,"context_line":"            port_id\u003dorig_binding.port_id,"}],"source_content_type":"text/x-python","patch_set":9,"id":"1a6eadb0_3f46274f","line":416,"range":{"start_line":416,"start_character":8,"end_line":416,"end_character":50},"updated":"2016-12-16 00:47:31.000000000","message":"ouch good catch!","commit_id":"fb27b72fd5c1b4632e8f71156e4b1ddd0ad24701"},{"author":{"_account_id":17491,"name":"Lujin Luo","email":"luo.lujin@jp.fujitsu.com","username":"Lujin"},"change_message_id":"ff62ec735a3af04eac6abb940c6240afbee1f4d0","unresolved":false,"context_lines":[{"line_number":421,"context_line":"            vnic_type\u003dorig_binding.vnic_type,"},{"line_number":422,"context_line":"            profile\u003dorig_binding.profile,"},{"line_number":423,"context_line":"            vif_type\u003dportbindings.VIF_TYPE_UNBOUND,"},{"line_number":424,"context_line":"            vif_details\u003dNone"},{"line_number":425,"context_line":"        )"},{"line_number":426,"context_line":"        self._update_port_dict_binding(port, new_binding)"},{"line_number":427,"context_line":"        new_context \u003d driver_context.PortContext("}],"source_content_type":"text/x-python","patch_set":9,"id":"1a6eadb0_1f4b2b5a","line":424,"range":{"start_line":424,"start_character":24,"end_line":424,"end_character":28},"updated":"2016-12-16 00:47:31.000000000","message":"Just for reference, I have tried \"{}\" and \"dict(\u0027\u0027)\" here, and the error I saw was \"AttributeError: \u0027CoercedDict\u0027 object has no attribute \u0027translate\u0027\"","commit_id":"fb27b72fd5c1b4632e8f71156e4b1ddd0ad24701"},{"author":{"_account_id":17491,"name":"Lujin Luo","email":"luo.lujin@jp.fujitsu.com","username":"Lujin"},"change_message_id":"ff62ec735a3af04eac6abb940c6240afbee1f4d0","unresolved":false,"context_lines":[{"line_number":1524,"context_line":"        port_id \u003d port[\u0027id\u0027]"},{"line_number":1525,"context_line":""},{"line_number":1526,"context_line":"        if binding.vif_type !\u003d portbindings.VIF_TYPE_UNBOUND:"},{"line_number":1527,"context_line":"            binding.vif_details \u003d \u0027\u0027"},{"line_number":1528,"context_line":"            binding.vif_type \u003d portbindings.VIF_TYPE_UNBOUND"},{"line_number":1529,"context_line":"            if binding.host:"},{"line_number":1530,"context_line":"                db.clear_binding_levels(session, port_id, binding.host)"}],"source_content_type":"text/x-python","patch_set":9,"id":"1a6eadb0_9f0e5be3","line":1527,"range":{"start_line":1527,"start_character":12,"end_line":1527,"end_character":36},"updated":"2016-12-16 00:47:31.000000000","message":"ditto Line 344","commit_id":"fb27b72fd5c1b4632e8f71156e4b1ddd0ad24701"},{"author":{"_account_id":17491,"name":"Lujin Luo","email":"luo.lujin@jp.fujitsu.com","username":"Lujin"},"change_message_id":"b1b5c7283eaaa71513f2cfd762852c4235aa35e7","unresolved":false,"context_lines":[{"line_number":414,"context_line":"        # transaction."},{"line_number":415,"context_line":"        port \u003d orig_context.current"},{"line_number":416,"context_line":"        orig_binding \u003d orig_context._binding"},{"line_number":417,"context_line":"        # missing port-id when creating new object"},{"line_number":418,"context_line":"        new_binding \u003d obj_port.PortBinding("},{"line_number":419,"context_line":"            orig_context._plugin_context,"},{"line_number":420,"context_line":"            port_id\u003dorig_binding.port_id,"}],"source_content_type":"text/x-python","patch_set":12,"id":"1a6eadb0_5e3fe924","line":417,"range":{"start_line":417,"start_character":0,"end_line":417,"end_character":50},"updated":"2016-12-20 05:30:41.000000000","message":"lol, let\u0027s remove this!","commit_id":"eb606cefc90a7d2f7232d3f084d93f6c86183566"},{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"17434b504a168180449f3633874eeb1a272215a3","unresolved":false,"context_lines":[{"line_number":362,"context_line":""},{"line_number":363,"context_line":"            bind_context, need_notify, try_again \u003d self._attempt_binding("},{"line_number":364,"context_line":"                context, need_notify)"},{"line_number":365,"context_line":""},{"line_number":366,"context_line":"            if count \u003d\u003d MAX_BIND_TRIES or not try_again:"},{"line_number":367,"context_line":"                if self._should_bind_port(context):"},{"line_number":368,"context_line":"                    # At this point, we attempted to bind a port and reached"}],"source_content_type":"text/x-python","patch_set":23,"id":"ba5201f7_5b8eddd0","side":"PARENT","line":365,"updated":"2017-01-11 20:16:58.000000000","message":"unrelated change","commit_id":"cc27af1044e80af8027fcf93be4ed5ba10174154"},{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"17434b504a168180449f3633874eeb1a272215a3","unresolved":false,"context_lines":[{"line_number":322,"context_line":"        if profile not in (None, const.ATTR_NOT_SPECIFIED,"},{"line_number":323,"context_line":"                           self._get_profile(binding)):"},{"line_number":324,"context_line":"            binding.profile \u003d profile"},{"line_number":325,"context_line":"            if (len(jsonutils.dumps(binding.profile)) \u003e"},{"line_number":326,"context_line":"                    models.BINDING_PROFILE_LEN):"},{"line_number":327,"context_line":"                msg \u003d _(\"binding:profile value too large\")"},{"line_number":328,"context_line":"                raise exc.InvalidInput(error_message\u003dmsg)"}],"source_content_type":"text/x-python","patch_set":23,"id":"ba5201f7_5be09d96","line":325,"range":{"start_line":325,"start_character":16,"end_line":325,"end_character":52},"updated":"2017-01-11 20:16:58.000000000","message":"here we leak some storage format details about the object field. I think a slightly better way would be to use stringify() method of relevant OVO type class.","commit_id":"6ce05e18eede9f9799e8e67d7421f17d653ba5bc"},{"author":{"_account_id":17491,"name":"Lujin Luo","email":"luo.lujin@jp.fujitsu.com","username":"Lujin"},"change_message_id":"620a9c8d74f02d757b82a51c51e1225d94d3f9e9","unresolved":false,"context_lines":[{"line_number":322,"context_line":"        if profile not in (None, const.ATTR_NOT_SPECIFIED,"},{"line_number":323,"context_line":"                           self._get_profile(binding)):"},{"line_number":324,"context_line":"            binding.profile \u003d profile"},{"line_number":325,"context_line":"            if (len(jsonutils.dumps(binding.profile)) \u003e"},{"line_number":326,"context_line":"                    models.BINDING_PROFILE_LEN):"},{"line_number":327,"context_line":"                msg \u003d _(\"binding:profile value too large\")"},{"line_number":328,"context_line":"                raise exc.InvalidInput(error_message\u003dmsg)"}],"source_content_type":"text/x-python","patch_set":23,"id":"7a3c09a3_0ccdfa65","line":325,"range":{"start_line":325,"start_character":16,"end_line":325,"end_character":52},"in_reply_to":"ba5201f7_5be09d96","updated":"2017-01-17 09:45:32.000000000","message":"I believe this is my lack of knowledge. Would you mind elaborating this more? It seems to me the stringify() method in port binding OVO type also calls jsonutils.dumps(). I do not see any benefit of using it here.","commit_id":"6ce05e18eede9f9799e8e67d7421f17d653ba5bc"},{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"17434b504a168180449f3633874eeb1a272215a3","unresolved":false,"context_lines":[{"line_number":559,"context_line":"    def _get_vif_details(self, binding):"},{"line_number":560,"context_line":"        if binding.vif_details:"},{"line_number":561,"context_line":"            try:"},{"line_number":562,"context_line":"                if isinstance(binding.vif_details, dict):"},{"line_number":563,"context_line":"                    return binding.vif_details"},{"line_number":564,"context_line":"                return jsonutils.loads(binding.vif_details)"},{"line_number":565,"context_line":"            except Exception:"}],"source_content_type":"text/x-python","patch_set":23,"id":"ba5201f7_fb26b1cc","line":562,"updated":"2017-01-11 20:16:58.000000000","message":"that, I assume, is a temporary hack that will eventually go away once we switch to objects for all operations. Correct? If so, please mark it for eventual removal with TODO.","commit_id":"6ce05e18eede9f9799e8e67d7421f17d653ba5bc"},{"author":{"_account_id":17491,"name":"Lujin Luo","email":"luo.lujin@jp.fujitsu.com","username":"Lujin"},"change_message_id":"620a9c8d74f02d757b82a51c51e1225d94d3f9e9","unresolved":false,"context_lines":[{"line_number":559,"context_line":"    def _get_vif_details(self, binding):"},{"line_number":560,"context_line":"        if binding.vif_details:"},{"line_number":561,"context_line":"            try:"},{"line_number":562,"context_line":"                if isinstance(binding.vif_details, dict):"},{"line_number":563,"context_line":"                    return binding.vif_details"},{"line_number":564,"context_line":"                return jsonutils.loads(binding.vif_details)"},{"line_number":565,"context_line":"            except Exception:"}],"source_content_type":"text/x-python","patch_set":23,"id":"7a3c09a3_cf3e8fd9","line":562,"in_reply_to":"ba5201f7_fb26b1cc","updated":"2017-01-17 09:45:32.000000000","message":"Done","commit_id":"6ce05e18eede9f9799e8e67d7421f17d653ba5bc"},{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"17434b504a168180449f3633874eeb1a272215a3","unresolved":false,"context_lines":[{"line_number":572,"context_line":"    def _get_profile(self, binding):"},{"line_number":573,"context_line":"        if binding.profile:"},{"line_number":574,"context_line":"            try:"},{"line_number":575,"context_line":"                if isinstance(binding.profile, dict):"},{"line_number":576,"context_line":"                    return binding.profile"},{"line_number":577,"context_line":"                return jsonutils.loads(binding.profile)"},{"line_number":578,"context_line":"            except Exception:"}],"source_content_type":"text/x-python","patch_set":23,"id":"ba5201f7_1b2455c3","line":575,"updated":"2017-01-11 20:16:58.000000000","message":"same here","commit_id":"6ce05e18eede9f9799e8e67d7421f17d653ba5bc"},{"author":{"_account_id":17491,"name":"Lujin Luo","email":"luo.lujin@jp.fujitsu.com","username":"Lujin"},"change_message_id":"620a9c8d74f02d757b82a51c51e1225d94d3f9e9","unresolved":false,"context_lines":[{"line_number":572,"context_line":"    def _get_profile(self, binding):"},{"line_number":573,"context_line":"        if binding.profile:"},{"line_number":574,"context_line":"            try:"},{"line_number":575,"context_line":"                if isinstance(binding.profile, dict):"},{"line_number":576,"context_line":"                    return binding.profile"},{"line_number":577,"context_line":"                return jsonutils.loads(binding.profile)"},{"line_number":578,"context_line":"            except Exception:"}],"source_content_type":"text/x-python","patch_set":23,"id":"7a3c09a3_ef27cbc7","line":575,"in_reply_to":"ba5201f7_1b2455c3","updated":"2017-01-17 09:45:32.000000000","message":"Done","commit_id":"6ce05e18eede9f9799e8e67d7421f17d653ba5bc"},{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"17434b504a168180449f3633874eeb1a272215a3","unresolved":false,"context_lines":[{"line_number":1400,"context_line":"        need_port_update_notify \u003d False"},{"line_number":1401,"context_line":"        bound_mech_contexts \u003d []"},{"line_number":1402,"context_line":""},{"line_number":1403,"context_line":"        with context.session.begin(subtransactions\u003dTrue):"},{"line_number":1404,"context_line":"            port_db, binding \u003d db.get_locked_port_and_binding(context, id)"},{"line_number":1405,"context_line":"            if not port_db:"},{"line_number":1406,"context_line":"                raise exc.PortNotFound(port_id\u003did)"}],"source_content_type":"text/x-python","patch_set":23,"id":"ba5201f7_bb0fc937","line":1403,"updated":"2017-01-11 20:16:58.000000000","message":"changes in the method are unrelated","commit_id":"6ce05e18eede9f9799e8e67d7421f17d653ba5bc"},{"author":{"_account_id":17491,"name":"Lujin Luo","email":"luo.lujin@jp.fujitsu.com","username":"Lujin"},"change_message_id":"620a9c8d74f02d757b82a51c51e1225d94d3f9e9","unresolved":false,"context_lines":[{"line_number":1400,"context_line":"        need_port_update_notify \u003d False"},{"line_number":1401,"context_line":"        bound_mech_contexts \u003d []"},{"line_number":1402,"context_line":""},{"line_number":1403,"context_line":"        with context.session.begin(subtransactions\u003dTrue):"},{"line_number":1404,"context_line":"            port_db, binding \u003d db.get_locked_port_and_binding(context, id)"},{"line_number":1405,"context_line":"            if not port_db:"},{"line_number":1406,"context_line":"                raise exc.PortNotFound(port_id\u003did)"}],"source_content_type":"text/x-python","patch_set":23,"id":"7a3c09a3_a5ad628a","line":1403,"in_reply_to":"ba5201f7_bb0fc937","updated":"2017-01-17 09:45:32.000000000","message":"well, this is the change of using session to context.","commit_id":"6ce05e18eede9f9799e8e67d7421f17d653ba5bc"},{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"17434b504a168180449f3633874eeb1a272215a3","unresolved":false,"context_lines":[{"line_number":1605,"context_line":"        router_ids \u003d []"},{"line_number":1606,"context_line":"        l3plugin \u003d directory.get_plugin(const.L3)"},{"line_number":1607,"context_line":""},{"line_number":1608,"context_line":"        with context.session.begin(subtransactions\u003dTrue):"},{"line_number":1609,"context_line":"            port_db, binding \u003d db.get_locked_port_and_binding(context, id)"},{"line_number":1610,"context_line":"            if not port_db:"},{"line_number":1611,"context_line":"                LOG.debug(\"The port \u0027%s\u0027 was deleted\", id)"}],"source_content_type":"text/x-python","patch_set":23,"id":"ba5201f7_66006802","line":1608,"updated":"2017-01-11 20:16:58.000000000","message":"change unrelated","commit_id":"6ce05e18eede9f9799e8e67d7421f17d653ba5bc"},{"author":{"_account_id":17491,"name":"Lujin Luo","email":"luo.lujin@jp.fujitsu.com","username":"Lujin"},"change_message_id":"620a9c8d74f02d757b82a51c51e1225d94d3f9e9","unresolved":false,"context_lines":[{"line_number":1605,"context_line":"        router_ids \u003d []"},{"line_number":1606,"context_line":"        l3plugin \u003d directory.get_plugin(const.L3)"},{"line_number":1607,"context_line":""},{"line_number":1608,"context_line":"        with context.session.begin(subtransactions\u003dTrue):"},{"line_number":1609,"context_line":"            port_db, binding \u003d db.get_locked_port_and_binding(context, id)"},{"line_number":1610,"context_line":"            if not port_db:"},{"line_number":1611,"context_line":"                LOG.debug(\"The port \u0027%s\u0027 was deleted\", id)"}],"source_content_type":"text/x-python","patch_set":23,"id":"7a3c09a3_45ecbec7","line":1608,"in_reply_to":"ba5201f7_66006802","updated":"2017-01-17 09:45:32.000000000","message":"ditto","commit_id":"6ce05e18eede9f9799e8e67d7421f17d653ba5bc"},{"author":{"_account_id":8726,"name":"Victor Morales","email":"chipahuac@hotmail.com","username":"electrocucaracha"},"change_message_id":"35c3e255a00143300938a0c344095ee62968f87d","unresolved":false,"context_lines":[{"line_number":362,"context_line":""},{"line_number":363,"context_line":"            bind_context, need_notify, try_again \u003d self._attempt_binding("},{"line_number":364,"context_line":"                context, need_notify)"},{"line_number":365,"context_line":""},{"line_number":366,"context_line":"            if count \u003d\u003d MAX_BIND_TRIES or not try_again:"},{"line_number":367,"context_line":"                if self._should_bind_port(context):"},{"line_number":368,"context_line":"                    # At this point, we attempted to bind a port and reached"}],"source_content_type":"text/x-python","patch_set":27,"id":"5a3905b3_17300501","side":"PARENT","line":365,"updated":"2017-01-19 23:41:03.000000000","message":"meh","commit_id":"eb27f0be526f9bd4b97ee1f4e70d80a8a1b229e5"},{"author":{"_account_id":17491,"name":"Lujin Luo","email":"luo.lujin@jp.fujitsu.com","username":"Lujin"},"change_message_id":"850a23bb4877321bcaa87605933b9c1ba0d90fb5","unresolved":false,"context_lines":[{"line_number":362,"context_line":""},{"line_number":363,"context_line":"            bind_context, need_notify, try_again \u003d self._attempt_binding("},{"line_number":364,"context_line":"                context, need_notify)"},{"line_number":365,"context_line":""},{"line_number":366,"context_line":"            if count \u003d\u003d MAX_BIND_TRIES or not try_again:"},{"line_number":367,"context_line":"                if self._should_bind_port(context):"},{"line_number":368,"context_line":"                    # At this point, we attempted to bind a port and reached"}],"source_content_type":"text/x-python","patch_set":27,"id":"5a3905b3_c8889725","side":"PARENT","line":365,"in_reply_to":"5a3905b3_17300501","updated":"2017-01-20 02:47:01.000000000","message":"lol","commit_id":"eb27f0be526f9bd4b97ee1f4e70d80a8a1b229e5"},{"author":{"_account_id":8726,"name":"Victor Morales","email":"chipahuac@hotmail.com","username":"electrocucaracha"},"change_message_id":"35c3e255a00143300938a0c344095ee62968f87d","unresolved":false,"context_lines":[{"line_number":1405,"context_line":"        need_port_update_notify \u003d False"},{"line_number":1406,"context_line":"        bound_mech_contexts \u003d []"},{"line_number":1407,"context_line":""},{"line_number":1408,"context_line":"        with context.session.begin(subtransactions\u003dTrue):"},{"line_number":1409,"context_line":"            port_db, binding \u003d db.get_locked_port_and_binding(context, id)"},{"line_number":1410,"context_line":"            if not port_db:"},{"line_number":1411,"context_line":"                raise exc.PortNotFound(port_id\u003did)"}],"source_content_type":"text/x-python","patch_set":27,"id":"5a3905b3_72879761","line":1408,"range":{"start_line":1408,"start_character":13,"end_line":1408,"end_character":57},"updated":"2017-01-19 23:41:03.000000000","message":"shouldn\u0027t be better to use oslo writer here?\n\ndb_api.context_manager.writer.using(ctx):","commit_id":"03238ffce6ea07e4b6e5b71d2e689b4cf6e63375"},{"author":{"_account_id":17491,"name":"Lujin Luo","email":"luo.lujin@jp.fujitsu.com","username":"Lujin"},"change_message_id":"850a23bb4877321bcaa87605933b9c1ba0d90fb5","unresolved":false,"context_lines":[{"line_number":1405,"context_line":"        need_port_update_notify \u003d False"},{"line_number":1406,"context_line":"        bound_mech_contexts \u003d []"},{"line_number":1407,"context_line":""},{"line_number":1408,"context_line":"        with context.session.begin(subtransactions\u003dTrue):"},{"line_number":1409,"context_line":"            port_db, binding \u003d db.get_locked_port_and_binding(context, id)"},{"line_number":1410,"context_line":"            if not port_db:"},{"line_number":1411,"context_line":"                raise exc.PortNotFound(port_id\u003did)"}],"source_content_type":"text/x-python","patch_set":27,"id":"5a3905b3_089a9f63","line":1408,"range":{"start_line":1408,"start_character":13,"end_line":1408,"end_character":57},"in_reply_to":"5a3905b3_72879761","updated":"2017-01-20 02:47:01.000000000","message":"this line is in update_port() method, I am not sure if it is a good idea to make the change here in a port binding patch","commit_id":"03238ffce6ea07e4b6e5b71d2e689b4cf6e63375"},{"author":{"_account_id":8726,"name":"Victor Morales","email":"chipahuac@hotmail.com","username":"electrocucaracha"},"change_message_id":"35c3e255a00143300938a0c344095ee62968f87d","unresolved":false,"context_lines":[{"line_number":1610,"context_line":"        router_ids \u003d []"},{"line_number":1611,"context_line":"        l3plugin \u003d directory.get_plugin(const.L3)"},{"line_number":1612,"context_line":""},{"line_number":1613,"context_line":"        with context.session.begin(subtransactions\u003dTrue):"},{"line_number":1614,"context_line":"            port_db, binding \u003d db.get_locked_port_and_binding(context, id)"},{"line_number":1615,"context_line":"            if not port_db:"},{"line_number":1616,"context_line":"                LOG.debug(\"The port \u0027%s\u0027 was deleted\", id)"}],"source_content_type":"text/x-python","patch_set":27,"id":"5a3905b3_f29387a1","line":1613,"updated":"2017-01-19 23:41:03.000000000","message":"ditto: line 1408","commit_id":"03238ffce6ea07e4b6e5b71d2e689b4cf6e63375"},{"author":{"_account_id":15518,"name":"Artur Korzeniewski","email":"artur.korzen@wp.pl","username":"akorzeni"},"change_message_id":"613f9fb88a727c73fa9b30f8113f0c600fc4665e","unresolved":false,"context_lines":[{"line_number":237,"context_line":"                return"},{"line_number":238,"context_line":"        self.update_port_status(context, port_id, const.PORT_STATUS_ACTIVE)"},{"line_number":239,"context_line":""},{"line_number":240,"context_line":"    @property"},{"line_number":241,"context_line":"    def supported_qos_rule_types(self):"},{"line_number":242,"context_line":"        return self.mechanism_manager.supported_qos_rule_types"},{"line_number":243,"context_line":""}],"source_content_type":"text/x-python","patch_set":35,"id":"3a461143_3ffb5d7a","line":240,"updated":"2017-02-01 08:31:25.000000000","message":"This is extra, not relevant to this PS.","commit_id":"b4d209a2d4710c3567a23daaa5ab8bd143fcf52b"},{"author":{"_account_id":15518,"name":"Artur Korzeniewski","email":"artur.korzen@wp.pl","username":"akorzeni"},"change_message_id":"613f9fb88a727c73fa9b30f8113f0c600fc4665e","unresolved":false,"context_lines":[{"line_number":455,"context_line":"            # reflecting this state as original state for subsequent"},{"line_number":456,"context_line":"            # mechanism driver update_port_*commit() calls."},{"line_number":457,"context_line":"            try:"},{"line_number":458,"context_line":"                # NOTE(korzen) port_db is having old state of Port Binding..."},{"line_number":459,"context_line":"                port_db \u003d self._get_port(plugin_context, port_id)"},{"line_number":460,"context_line":"                # TODO(korzen) replace get_objects with port_obj.binding when"},{"line_number":461,"context_line":"                # Port OVO is integrated in _get_port"}],"source_content_type":"text/x-python","patch_set":35,"id":"3a461143_5f3d8929","line":458,"updated":"2017-02-01 08:31:25.000000000","message":"We need to address this before merging.","commit_id":"b4d209a2d4710c3567a23daaa5ab8bd143fcf52b"},{"author":{"_account_id":15471,"name":"Nguyen Phuong An","email":"annp.cs51@gmail.com","username":"An-FVL"},"change_message_id":"2cef59048375dfc2aeef9dd45df44225b099b965","unresolved":false,"context_lines":[{"line_number":252,"context_line":"                return"},{"line_number":253,"context_line":"        self.update_port_status(context, port_id, const.PORT_STATUS_ACTIVE)"},{"line_number":254,"context_line":""},{"line_number":255,"context_line":"    @property"},{"line_number":256,"context_line":"    def supported_qos_rule_types(self):"},{"line_number":257,"context_line":"        return self.mechanism_manager.supported_qos_rule_types"},{"line_number":258,"context_line":""},{"line_number":259,"context_line":"    @log_helpers.log_method_call"},{"line_number":260,"context_line":"    def _start_rpc_notifiers(self):"}],"source_content_type":"text/x-python","patch_set":54,"id":"1f013ff3_6bd2db5e","line":257,"range":{"start_line":255,"start_character":1,"end_line":257,"end_character":62},"updated":"2017-05-16 06:47:56.000000000","message":"Please remove it!","commit_id":"3fd82e6028e6436f7c59363a3ec2443167cc50cb"},{"author":{"_account_id":15471,"name":"Nguyen Phuong An","email":"annp.cs51@gmail.com","username":"An-FVL"},"change_message_id":"2cef59048375dfc2aeef9dd45df44225b099b965","unresolved":false,"context_lines":[{"line_number":1345,"context_line":"        registry.notify(resources.PORT, events.AFTER_UPDATE, self, **kwargs)"},{"line_number":1346,"context_line":""},{"line_number":1347,"context_line":"        # expire the session to let port loads up-to-date port_binding"},{"line_number":1348,"context_line":"        #context.session.refresh(port_db)"},{"line_number":1349,"context_line":""},{"line_number":1350,"context_line":"        # Note that DVR Interface ports will have bindings on"},{"line_number":1351,"context_line":"        # multiple hosts, and so will have multiple mech_contexts,"}],"source_content_type":"text/x-python","patch_set":54,"id":"1f013ff3_eb4a6b25","line":1348,"range":{"start_line":1348,"start_character":9,"end_line":1348,"end_character":41},"updated":"2017-05-16 06:47:56.000000000","message":"Please remove it if it not need.","commit_id":"3fd82e6028e6436f7c59363a3ec2443167cc50cb"},{"author":{"_account_id":16688,"name":"Rodolfo Alonso","email":"ralonsoh@redhat.com","username":"rodolfo-alonso-hernandez"},"change_message_id":"ffa68917b3dcd84e0b9632b7eae7668a62603db2","unresolved":false,"context_lines":[{"line_number":353,"context_line":"            if host_changes:"},{"line_number":354,"context_line":"                binding.update_host(host)"},{"line_number":355,"context_line":"            else:"},{"line_number":356,"context_line":"                binding.update()"},{"line_number":357,"context_line":"            db.clear_binding_levels(plugin_context, port_id, original_host)"},{"line_number":358,"context_line":"            mech_context._clear_binding_levels()"},{"line_number":359,"context_line":"            port[\u0027status\u0027] \u003d const.PORT_STATUS_DOWN"}],"source_content_type":"text/x-python","patch_set":55,"id":"1f013ff3_ae3d8cbc","line":356,"range":{"start_line":356,"start_character":16,"end_line":356,"end_character":32},"updated":"2017-05-16 10:23:04.000000000","message":"In L376 you are updating again the object. Is this necessary?","commit_id":"cd8a99d95429b89295d421d0bac170509baa24ce"},{"author":{"_account_id":16688,"name":"Rodolfo Alonso","email":"ralonsoh@redhat.com","username":"rodolfo-alonso-hernandez"},"change_message_id":"8de040d1a9f97aeffa06b75783ada9f50152209f","unresolved":false,"context_lines":[{"line_number":353,"context_line":"            if host_changes:"},{"line_number":354,"context_line":"                binding.update_host(host)"},{"line_number":355,"context_line":"            else:"},{"line_number":356,"context_line":"                binding.update()"},{"line_number":357,"context_line":"            db.clear_binding_levels(plugin_context, port_id, original_host)"},{"line_number":358,"context_line":"            mech_context._clear_binding_levels()"},{"line_number":359,"context_line":"            port[\u0027status\u0027] \u003d const.PORT_STATUS_DOWN"}],"source_content_type":"text/x-python","patch_set":55,"id":"3f1d235d_3132a560","line":356,"range":{"start_line":356,"start_character":16,"end_line":356,"end_character":32},"in_reply_to":"1f013ff3_ae3d8cbc","updated":"2017-07-05 07:58:21.000000000","message":"Hi Lujin. No reply to this comment?","commit_id":"cd8a99d95429b89295d421d0bac170509baa24ce"},{"author":{"_account_id":17491,"name":"Lujin Luo","email":"luo.lujin@jp.fujitsu.com","username":"Lujin"},"change_message_id":"2848d9a14ea1f2db784050762094ad2af675bd29","unresolved":false,"context_lines":[{"line_number":353,"context_line":"            if host_changes:"},{"line_number":354,"context_line":"                binding.update_host(host)"},{"line_number":355,"context_line":"            else:"},{"line_number":356,"context_line":"                binding.update()"},{"line_number":357,"context_line":"            db.clear_binding_levels(plugin_context, port_id, original_host)"},{"line_number":358,"context_line":"            mech_context._clear_binding_levels()"},{"line_number":359,"context_line":"            port[\u0027status\u0027] \u003d const.PORT_STATUS_DOWN"}],"source_content_type":"text/x-python","patch_set":55,"id":"1f1a1f67_026a02b2","line":356,"range":{"start_line":356,"start_character":16,"end_line":356,"end_character":32},"in_reply_to":"3f1d235d_3132a560","updated":"2017-07-14 06:38:03.000000000","message":"Again, sorry for the late reply. I was planning to reply to you after I run some tests to confirm both of them are necessary. But anyway, the reason we need to update it twice is that some methods between them require updated binding information and are likely to make changes to the binding info.","commit_id":"cd8a99d95429b89295d421d0bac170509baa24ce"},{"author":{"_account_id":16688,"name":"Rodolfo Alonso","email":"ralonsoh@redhat.com","username":"rodolfo-alonso-hernandez"},"change_message_id":"ffa68917b3dcd84e0b9632b7eae7668a62603db2","unresolved":false,"context_lines":[{"line_number":372,"context_line":"        # merging here brings binding changes into the session so they can be"},{"line_number":373,"context_line":"        # committed since the binding attached to the context is detached from"},{"line_number":374,"context_line":"        # the session"},{"line_number":375,"context_line":"        #plugin_context.session.merge(binding)"},{"line_number":376,"context_line":"        binding.update()"},{"line_number":377,"context_line":""},{"line_number":378,"context_line":"        return changes"}],"source_content_type":"text/x-python","patch_set":55,"id":"1f013ff3_138389ce","line":375,"range":{"start_line":375,"start_character":8,"end_line":375,"end_character":46},"updated":"2017-05-16 10:23:04.000000000","message":"This should be removed.","commit_id":"cd8a99d95429b89295d421d0bac170509baa24ce"},{"author":{"_account_id":16688,"name":"Rodolfo Alonso","email":"ralonsoh@redhat.com","username":"rodolfo-alonso-hernandez"},"change_message_id":"ffa68917b3dcd84e0b9632b7eae7668a62603db2","unresolved":false,"context_lines":[{"line_number":1357,"context_line":"        registry.notify(resources.PORT, events.AFTER_UPDATE, self, **kwargs)"},{"line_number":1358,"context_line":""},{"line_number":1359,"context_line":"        # expire the session to let port loads up-to-date port_binding"},{"line_number":1360,"context_line":"        #context.session.refresh(port_db)"},{"line_number":1361,"context_line":""},{"line_number":1362,"context_line":"        # Note that DVR Interface ports will have bindings on"},{"line_number":1363,"context_line":"        # multiple hosts, and so will have multiple mech_contexts,"}],"source_content_type":"text/x-python","patch_set":55,"id":"1f013ff3_4ed2885e","line":1360,"range":{"start_line":1360,"start_character":8,"end_line":1360,"end_character":41},"updated":"2017-05-16 10:23:04.000000000","message":"is this needed?","commit_id":"cd8a99d95429b89295d421d0bac170509baa24ce"},{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"231c4991ba00d62a2f26e754f3ec6b540186056a","unresolved":false,"context_lines":[{"line_number":350,"context_line":"        if changes:"},{"line_number":351,"context_line":"            binding.vif_type \u003d portbindings.VIF_TYPE_UNBOUND"},{"line_number":352,"context_line":"            binding.vif_details \u003d None"},{"line_number":353,"context_line":"            if host_changes:"},{"line_number":354,"context_line":"                binding.update_host(host)"},{"line_number":355,"context_line":"            else:"},{"line_number":356,"context_line":"                binding.update()"}],"source_content_type":"text/x-python","patch_set":78,"id":"df87a7cf_f862233e","line":353,"updated":"2017-12-06 19:48:49.000000000","message":"I believe the determination of what to do on field update should belong to the object, in update(...) If we do that, we should be able to get rid of host_changes variable and just call .update() for all code paths.","commit_id":"429eab719f78c3f48fa7a32c55332cce80cb0c68"},{"author":{"_account_id":17491,"name":"Lujin Luo","email":"luo.lujin@jp.fujitsu.com","username":"Lujin"},"change_message_id":"e52e819d3369fa22568eded9b9b598c6f41fdda9","unresolved":false,"context_lines":[{"line_number":350,"context_line":"        if changes:"},{"line_number":351,"context_line":"            binding.vif_type \u003d portbindings.VIF_TYPE_UNBOUND"},{"line_number":352,"context_line":"            binding.vif_details \u003d None"},{"line_number":353,"context_line":"            if host_changes:"},{"line_number":354,"context_line":"                binding.update_host(host)"},{"line_number":355,"context_line":"            else:"},{"line_number":356,"context_line":"                binding.update()"}],"source_content_type":"text/x-python","patch_set":78,"id":"df87a7cf_8b75b1cd","line":353,"in_reply_to":"df87a7cf_f862233e","updated":"2017-12-07 08:50:15.000000000","message":"OK, I have modified accordingly.","commit_id":"429eab719f78c3f48fa7a32c55332cce80cb0c68"},{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"231c4991ba00d62a2f26e754f3ec6b540186056a","unresolved":false,"context_lines":[{"line_number":449,"context_line":"            vnic_type\u003dorig_binding.vnic_type,"},{"line_number":450,"context_line":"            profile\u003dprofile,"},{"line_number":451,"context_line":"            vif_type\u003dportbindings.VIF_TYPE_UNBOUND,"},{"line_number":452,"context_line":"            vif_details\u003dNone"},{"line_number":453,"context_line":"        )"},{"line_number":454,"context_line":"        self._update_port_dict_binding(port, new_binding)"},{"line_number":455,"context_line":"        new_context \u003d driver_context.PortContext("}],"source_content_type":"text/x-python","patch_set":78,"id":"df87a7cf_f84c639f","line":452,"updated":"2017-12-06 19:48:49.000000000","message":"(no action required) it\u0027s the default behavior of the object it seems","commit_id":"429eab719f78c3f48fa7a32c55332cce80cb0c68"},{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"231c4991ba00d62a2f26e754f3ec6b540186056a","unresolved":false,"context_lines":[{"line_number":559,"context_line":"                                        cur_binding.host)"},{"line_number":560,"context_line":"                db.set_binding_levels(plugin_context,"},{"line_number":561,"context_line":"                                      bind_context._binding_levels)"},{"line_number":562,"context_line":"                # refresh context with a snapshot of updated state"},{"line_number":563,"context_line":"                cur_context._binding \u003d cur_binding"},{"line_number":564,"context_line":"                cur_context._binding_levels \u003d bind_context._binding_levels"},{"line_number":565,"context_line":"                cur_binding.update()"}],"source_content_type":"text/x-python","patch_set":78,"id":"df87a7cf_ef281687","line":562,"updated":"2017-12-06 19:48:49.000000000","message":"this comment no longer applies. at least it\u0027s no longer a \u0027snapshot\u0027.","commit_id":"429eab719f78c3f48fa7a32c55332cce80cb0c68"},{"author":{"_account_id":17491,"name":"Lujin Luo","email":"luo.lujin@jp.fujitsu.com","username":"Lujin"},"change_message_id":"e52e819d3369fa22568eded9b9b598c6f41fdda9","unresolved":false,"context_lines":[{"line_number":559,"context_line":"                                        cur_binding.host)"},{"line_number":560,"context_line":"                db.set_binding_levels(plugin_context,"},{"line_number":561,"context_line":"                                      bind_context._binding_levels)"},{"line_number":562,"context_line":"                # refresh context with a snapshot of updated state"},{"line_number":563,"context_line":"                cur_context._binding \u003d cur_binding"},{"line_number":564,"context_line":"                cur_context._binding_levels \u003d bind_context._binding_levels"},{"line_number":565,"context_line":"                cur_binding.update()"}],"source_content_type":"text/x-python","patch_set":78,"id":"df87a7cf_666bc4b6","line":562,"in_reply_to":"df87a7cf_ef281687","updated":"2017-12-07 08:50:15.000000000","message":"Done","commit_id":"429eab719f78c3f48fa7a32c55332cce80cb0c68"},{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"231c4991ba00d62a2f26e754f3ec6b540186056a","unresolved":false,"context_lines":[{"line_number":1321,"context_line":"            # Port OVO is integrated in _get_port"},{"line_number":1322,"context_line":"            bindings \u003d obj_port.PortBinding.get_objects("},{"line_number":1323,"context_line":"                context, port_id\u003dport_db.id,"},{"line_number":1324,"context_line":"                status\u003dconst.ACTIVE)"},{"line_number":1325,"context_line":"            binding \u003d bindings.pop() if bindings else None"},{"line_number":1326,"context_line":"            if not binding:"},{"line_number":1327,"context_line":"                raise exc.PortNotFound(port_id\u003did)"}],"source_content_type":"text/x-python","patch_set":78,"id":"df87a7cf_af70cea6","line":1324,"updated":"2017-12-06 19:48:49.000000000","message":"why do we need to specify it\u0027s ACTIVE? can\u0027t it be in a different state? We don\u0027t specify it in the current version.","commit_id":"429eab719f78c3f48fa7a32c55332cce80cb0c68"},{"author":{"_account_id":17491,"name":"Lujin Luo","email":"luo.lujin@jp.fujitsu.com","username":"Lujin"},"change_message_id":"e52e819d3369fa22568eded9b9b598c6f41fdda9","unresolved":false,"context_lines":[{"line_number":1321,"context_line":"            # Port OVO is integrated in _get_port"},{"line_number":1322,"context_line":"            bindings \u003d obj_port.PortBinding.get_objects("},{"line_number":1323,"context_line":"                context, port_id\u003dport_db.id,"},{"line_number":1324,"context_line":"                status\u003dconst.ACTIVE)"},{"line_number":1325,"context_line":"            binding \u003d bindings.pop() if bindings else None"},{"line_number":1326,"context_line":"            if not binding:"},{"line_number":1327,"context_line":"                raise exc.PortNotFound(port_id\u003did)"}],"source_content_type":"text/x-python","patch_set":78,"id":"df87a7cf_465ec012","line":1324,"in_reply_to":"df87a7cf_af70cea6","updated":"2017-12-07 08:50:15.000000000","message":"Let me double check, but I think this is not necessary.","commit_id":"429eab719f78c3f48fa7a32c55332cce80cb0c68"},{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"231c4991ba00d62a2f26e754f3ec6b540186056a","unresolved":false,"context_lines":[{"line_number":1473,"context_line":"        self._update_port_dict_binding(port, binding)"},{"line_number":1474,"context_line":"        new_host \u003d attrs and attrs.get(portbindings.HOST_ID) or clear_host"},{"line_number":1475,"context_line":"        binding.router_id \u003d attrs and attrs.get(\u0027device_id\u0027)"},{"line_number":1476,"context_line":"        if new_host:"},{"line_number":1477,"context_line":"            binding.update_host(new_host)"},{"line_number":1478,"context_line":"        else:"},{"line_number":1479,"context_line":"            binding.update()"}],"source_content_type":"text/x-python","patch_set":78,"id":"df87a7cf_cfa8b2dc","line":1476,"updated":"2017-12-06 19:48:49.000000000","message":"same comment about hiding the need to delete/create for host inside update(...) of the binding OVO class","commit_id":"429eab719f78c3f48fa7a32c55332cce80cb0c68"},{"author":{"_account_id":17491,"name":"Lujin Luo","email":"luo.lujin@jp.fujitsu.com","username":"Lujin"},"change_message_id":"e52e819d3369fa22568eded9b9b598c6f41fdda9","unresolved":false,"context_lines":[{"line_number":1473,"context_line":"        self._update_port_dict_binding(port, binding)"},{"line_number":1474,"context_line":"        new_host \u003d attrs and attrs.get(portbindings.HOST_ID) or clear_host"},{"line_number":1475,"context_line":"        binding.router_id \u003d attrs and attrs.get(\u0027device_id\u0027)"},{"line_number":1476,"context_line":"        if new_host:"},{"line_number":1477,"context_line":"            binding.update_host(new_host)"},{"line_number":1478,"context_line":"        else:"},{"line_number":1479,"context_line":"            binding.update()"}],"source_content_type":"text/x-python","patch_set":78,"id":"df87a7cf_a6a22cfb","line":1476,"in_reply_to":"df87a7cf_cfa8b2dc","updated":"2017-12-07 08:50:15.000000000","message":"Done","commit_id":"429eab719f78c3f48fa7a32c55332cce80cb0c68"},{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"231c4991ba00d62a2f26e754f3ec6b540186056a","unresolved":false,"context_lines":[{"line_number":1551,"context_line":"                # Port OVO is integrated in _get_port"},{"line_number":1552,"context_line":"                bindings \u003d obj_port.PortBinding.get_objects("},{"line_number":1553,"context_line":"                    context, port_id\u003dport_db.id,"},{"line_number":1554,"context_line":"                    status\u003dconst.ACTIVE)"},{"line_number":1555,"context_line":"                binding \u003d bindings.pop() if bindings else None"},{"line_number":1556,"context_line":"            except exc.PortNotFound:"},{"line_number":1557,"context_line":"                LOG.debug(\"The port \u0027%s\u0027 was deleted\", id)"}],"source_content_type":"text/x-python","patch_set":78,"id":"df87a7cf_efe9f619","line":1554,"updated":"2017-12-06 19:48:49.000000000","message":"and what if it\u0027s not ACTIVE?","commit_id":"429eab719f78c3f48fa7a32c55332cce80cb0c68"},{"author":{"_account_id":17491,"name":"Lujin Luo","email":"luo.lujin@jp.fujitsu.com","username":"Lujin"},"change_message_id":"e52e819d3369fa22568eded9b9b598c6f41fdda9","unresolved":false,"context_lines":[{"line_number":1551,"context_line":"                # Port OVO is integrated in _get_port"},{"line_number":1552,"context_line":"                bindings \u003d obj_port.PortBinding.get_objects("},{"line_number":1553,"context_line":"                    context, port_id\u003dport_db.id,"},{"line_number":1554,"context_line":"                    status\u003dconst.ACTIVE)"},{"line_number":1555,"context_line":"                binding \u003d bindings.pop() if bindings else None"},{"line_number":1556,"context_line":"            except exc.PortNotFound:"},{"line_number":1557,"context_line":"                LOG.debug(\"The port \u0027%s\u0027 was deleted\", id)"}],"source_content_type":"text/x-python","patch_set":78,"id":"df87a7cf_66b0a444","line":1554,"in_reply_to":"df87a7cf_efe9f619","updated":"2017-12-07 08:50:15.000000000","message":"I will double check it.","commit_id":"429eab719f78c3f48fa7a32c55332cce80cb0c68"},{"author":{"_account_id":11975,"name":"Slawek Kaplonski","email":"skaplons@redhat.com","username":"slaweq"},"change_message_id":"7d16c75d91ef3c33d86b13e5aa6a7f0a2195f64b","unresolved":false,"context_lines":[{"line_number":1564,"context_line":"                    mech_context \u003d driver_context.PortContext("},{"line_number":1565,"context_line":"                        self, context, port, network, bind, levels)"},{"line_number":1566,"context_line":"                    self.mechanism_manager.delete_port_precommit("},{"line_number":1567,"context_line":"                        mech_context)"},{"line_number":1568,"context_line":"                    bound_mech_contexts.append(mech_context)"},{"line_number":1569,"context_line":"            else:"},{"line_number":1570,"context_line":"                levels \u003d db.get_binding_levels(context, id,"}],"source_content_type":"text/x-python","patch_set":80,"id":"df87a7cf_e0976eeb","line":1567,"updated":"2017-12-11 10:09:59.000000000","message":"is this change necessary?","commit_id":"ee3c52a60752586c7d0c261acf7fcfec9eeaff05"},{"author":{"_account_id":17491,"name":"Lujin Luo","email":"luo.lujin@jp.fujitsu.com","username":"Lujin"},"change_message_id":"ba2445effd4b3a08870417d258d5eba0e7fc1cba","unresolved":false,"context_lines":[{"line_number":1564,"context_line":"                    mech_context \u003d driver_context.PortContext("},{"line_number":1565,"context_line":"                        self, context, port, network, bind, levels)"},{"line_number":1566,"context_line":"                    self.mechanism_manager.delete_port_precommit("},{"line_number":1567,"context_line":"                        mech_context)"},{"line_number":1568,"context_line":"                    bound_mech_contexts.append(mech_context)"},{"line_number":1569,"context_line":"            else:"},{"line_number":1570,"context_line":"                levels \u003d db.get_binding_levels(context, id,"}],"source_content_type":"text/x-python","patch_set":80,"id":"df87a7cf_c40027ae","line":1567,"in_reply_to":"df87a7cf_e0976eeb","updated":"2017-12-12 01:47:48.000000000","message":"No.. I will revise it back.","commit_id":"ee3c52a60752586c7d0c261acf7fcfec9eeaff05"},{"author":{"_account_id":4694,"name":"Miguel Lavalle","email":"miguel@mlavalle.com","username":"minsel"},"change_message_id":"5d0a18fdd56cbc40d79656c427172ce7a530808c","unresolved":false,"context_lines":[{"line_number":349,"context_line":"        if changes:"},{"line_number":350,"context_line":"            binding.vif_type \u003d portbindings.VIF_TYPE_UNBOUND"},{"line_number":351,"context_line":"            binding.vif_details \u003d None"},{"line_number":352,"context_line":"            binding.update()"},{"line_number":353,"context_line":"            db.clear_binding_levels(plugin_context, port_id, original_host)"},{"line_number":354,"context_line":"            mech_context._clear_binding_levels()"},{"line_number":355,"context_line":"            port[\u0027status\u0027] \u003d const.PORT_STATUS_DOWN"}],"source_content_type":"text/x-python","patch_set":86,"id":"7f96bb07_98bb3471","line":352,"updated":"2018-01-21 00:56:30.000000000","message":"This update() call is taking place inside the writer transaction (new engine facade) started in L1192 or L1313 below","commit_id":"febeaf5d4016157d0cca41023e64b91e550453e8"},{"author":{"_account_id":4694,"name":"Miguel Lavalle","email":"miguel@mlavalle.com","username":"minsel"},"change_message_id":"5d0a18fdd56cbc40d79656c427172ce7a530808c","unresolved":false,"context_lines":[{"line_number":363,"context_line":"            db.clear_binding_levels(plugin_context, port_id, original_host)"},{"line_number":364,"context_line":"            mech_context._clear_binding_levels()"},{"line_number":365,"context_line":"            binding.host \u003d \u0027\u0027"},{"line_number":366,"context_line":"            binding.update()"},{"line_number":367,"context_line":""},{"line_number":368,"context_line":"        self._update_port_dict_binding(port, binding)"},{"line_number":369,"context_line":"        binding.update()"}],"source_content_type":"text/x-python","patch_set":86,"id":"7f96bb07_18a72452","line":366,"updated":"2018-01-21 00:56:30.000000000","message":"This update() call is taking place inside the writer transaction (new engine facade) started in L1192 or L1313 below","commit_id":"febeaf5d4016157d0cca41023e64b91e550453e8"},{"author":{"_account_id":11975,"name":"Slawek Kaplonski","email":"skaplons@redhat.com","username":"slaweq"},"change_message_id":"d0161899d202558892dfe46a6a5d55e1f415acbf","unresolved":false,"context_lines":[{"line_number":366,"context_line":"            binding.update()"},{"line_number":367,"context_line":""},{"line_number":368,"context_line":"        self._update_port_dict_binding(port, binding)"},{"line_number":369,"context_line":"        binding.update()"},{"line_number":370,"context_line":"        return changes"},{"line_number":371,"context_line":""},{"line_number":372,"context_line":"    @db_api.retry_db_errors"}],"source_content_type":"text/x-python","patch_set":86,"id":"7f96bb07_cb3788e3","line":369,"updated":"2018-01-22 15:45:12.000000000","message":"@Miguel: so this one is also inside the writer transaction","commit_id":"febeaf5d4016157d0cca41023e64b91e550453e8"},{"author":{"_account_id":4694,"name":"Miguel Lavalle","email":"miguel@mlavalle.com","username":"minsel"},"change_message_id":"42831e4d81c5ba6ebdaab04d0aa0f3a1abaced98","unresolved":false,"context_lines":[{"line_number":366,"context_line":"            binding.update()"},{"line_number":367,"context_line":""},{"line_number":368,"context_line":"        self._update_port_dict_binding(port, binding)"},{"line_number":369,"context_line":"        binding.update()"},{"line_number":370,"context_line":"        return changes"},{"line_number":371,"context_line":""},{"line_number":372,"context_line":"    @db_api.retry_db_errors"}],"source_content_type":"text/x-python","patch_set":86,"id":"7f96bb07_0b9d7058","line":369,"in_reply_to":"7f96bb07_cb3788e3","updated":"2018-01-22 15:51:37.000000000","message":"Yeah, I didn\u0027t mean to point to all the cases. I just wanted to illustrate some examples","commit_id":"febeaf5d4016157d0cca41023e64b91e550453e8"},{"author":{"_account_id":4694,"name":"Miguel Lavalle","email":"miguel@mlavalle.com","username":"minsel"},"change_message_id":"5d0a18fdd56cbc40d79656c427172ce7a530808c","unresolved":false,"context_lines":[{"line_number":558,"context_line":"                                      bind_context._binding_levels)"},{"line_number":559,"context_line":"                cur_context._binding \u003d cur_binding"},{"line_number":560,"context_line":"                cur_context._binding_levels \u003d bind_context._binding_levels"},{"line_number":561,"context_line":"                cur_binding.update()"},{"line_number":562,"context_line":"                plugin_context.session.refresh(port_db)"},{"line_number":563,"context_line":""},{"line_number":564,"context_line":"                # Update PortContext\u0027s port dictionary to reflect the"}],"source_content_type":"text/x-python","patch_set":86,"id":"7f96bb07_387540cd","line":561,"updated":"2018-01-21 00:56:30.000000000","message":"This update() call is inside the writer transaction (new engine facade) started in L480 above","commit_id":"febeaf5d4016157d0cca41023e64b91e550453e8"}],"neutron/tests/unit/objects/test_ports.py":[{"author":{"_account_id":11975,"name":"Slawek Kaplonski","email":"skaplons@redhat.com","username":"slaweq"},"change_message_id":"e739f5c9c46cac1997c903d32da68bfd796021bb","unresolved":false,"context_lines":[{"line_number":24,"context_line":"from neutron.tests.unit import testlib_api"},{"line_number":25,"context_line":""},{"line_number":26,"context_line":""},{"line_number":27,"context_line":"SQLALCHEMY_COMMIT \u003d \u0027sqlalchemy.engine.Connection._commit_impl\u0027"},{"line_number":28,"context_line":""},{"line_number":29,"context_line":""},{"line_number":30,"context_line":"class BasePortBindingDbObjectTestCase(obj_test_base._BaseObjectTestCase,"}],"source_content_type":"text/x-python","patch_set":85,"id":"df87a7cf_727dabb0","line":27,"updated":"2017-12-19 08:49:54.000000000","message":"is this related to Your patch somehow?","commit_id":"90241416a7cef70ac9e250dc5d145659d83e7c12"},{"author":{"_account_id":17491,"name":"Lujin Luo","email":"luo.lujin@jp.fujitsu.com","username":"Lujin"},"change_message_id":"a677800ee4a0a607c49298ca6772e1d4b588167c","unresolved":false,"context_lines":[{"line_number":24,"context_line":"from neutron.tests.unit import testlib_api"},{"line_number":25,"context_line":""},{"line_number":26,"context_line":""},{"line_number":27,"context_line":"SQLALCHEMY_COMMIT \u003d \u0027sqlalchemy.engine.Connection._commit_impl\u0027"},{"line_number":28,"context_line":""},{"line_number":29,"context_line":""},{"line_number":30,"context_line":"class BasePortBindingDbObjectTestCase(obj_test_base._BaseObjectTestCase,"}],"source_content_type":"text/x-python","patch_set":85,"id":"bf8cb3f7_6c5b1987","line":27,"in_reply_to":"df87a7cf_727dabb0","updated":"2017-12-21 07:59:58.000000000","message":"Oops, I forgot to remove it!","commit_id":"90241416a7cef70ac9e250dc5d145659d83e7c12"}],"neutron/tests/unit/plugins/ml2/test_db.py":[{"author":{"_account_id":22776,"name":"Nakul Dahiwade","email":"nakul.dahiwade@intel.com","username":"nakul.dahiwade"},"change_message_id":"8cb9757d0119f3b072e556be77e98360376a4e28","unresolved":false,"context_lines":[{"line_number":59,"context_line":"    def _setup_neutron_portbinding(self, port_id, vif_type, host):"},{"line_number":60,"context_line":"        obj \u003d obj_port.PortBinding("},{"line_number":61,"context_line":"            self.ctx, port_id\u003dport_id, vif_type\u003dvif_type, host\u003dhost)"},{"line_number":62,"context_line":"        obj.create()"},{"line_number":63,"context_line":""},{"line_number":64,"context_line":"    @staticmethod"},{"line_number":65,"context_line":"    def _sort_segments(segments):"}],"source_content_type":"text/x-python","patch_set":7,"id":"1a6eadb0_1f404656","line":62,"updated":"2016-12-12 18:08:48.000000000","message":"Not sure if a reference is needed here, could be replaced with obj_port.PortBinding(\n            self.ctx, port_id\u003dport_id, vif_type\u003dvif_type, host\u003dhost).create()","commit_id":"1d93d879d898558821180c88a2f5dc2a9af70a86"},{"author":{"_account_id":17491,"name":"Lujin Luo","email":"luo.lujin@jp.fujitsu.com","username":"Lujin"},"change_message_id":"3a72b3e4e129d6fc2944a72bf47e5e7eb3b3dedd","unresolved":false,"context_lines":[{"line_number":59,"context_line":"    def _setup_neutron_portbinding(self, port_id, vif_type, host):"},{"line_number":60,"context_line":"        obj \u003d obj_port.PortBinding("},{"line_number":61,"context_line":"            self.ctx, port_id\u003dport_id, vif_type\u003dvif_type, host\u003dhost)"},{"line_number":62,"context_line":"        obj.create()"},{"line_number":63,"context_line":""},{"line_number":64,"context_line":"    @staticmethod"},{"line_number":65,"context_line":"    def _sort_segments(segments):"}],"source_content_type":"text/x-python","patch_set":7,"id":"1a6eadb0_badbc9ec","line":62,"in_reply_to":"1a6eadb0_1f404656","updated":"2016-12-13 08:45:01.000000000","message":"will fix in next PS","commit_id":"1d93d879d898558821180c88a2f5dc2a9af70a86"},{"author":{"_account_id":17120,"name":"Manjeet Singh Bhatia","email":"manjeet.s.bhatia@intel.com","username":"manjeets"},"change_message_id":"fcfad6ffa5f0fddfb0d2b51bbff29138605cf8a5","unresolved":false,"context_lines":[{"line_number":188,"context_line":"    def test_get_port_binding_host_multiple_results_found(self):"},{"line_number":189,"context_line":"        network_id \u003d \u0027foo-network-id\u0027"},{"line_number":190,"context_line":"        # port_id should be prefix of both port_id_one and port_id_two"},{"line_number":191,"context_line":"        port_id \u003d uuidutils.generate_uuid()"},{"line_number":192,"context_line":"        port_id_one \u003d uuidutils.generate_uuid()"},{"line_number":193,"context_line":"        port_id_two \u003d uuidutils.generate_uuid()"},{"line_number":194,"context_line":"        host \u003d \u0027fake_host\u0027"},{"line_number":195,"context_line":"        vif_type \u003d portbindings.VIF_TYPE_UNBOUND"},{"line_number":196,"context_line":"        self._setup_neutron_network(network_id)"}],"source_content_type":"text/x-python","patch_set":12,"id":"1a6eadb0_b8349f4a","line":193,"range":{"start_line":191,"start_character":8,"end_line":193,"end_character":47},"updated":"2016-12-19 18:36:43.000000000","message":"uuidutils will give you unique id, it will not be prefix,\n\nI had same issue see https://review.openstack.org/#/c/406407/10/neutron/tests/unit/plugins/ml2/test_db.py@193, I guess your patch can be rebased on top of it","commit_id":"eb606cefc90a7d2f7232d3f084d93f6c86183566"},{"author":{"_account_id":17491,"name":"Lujin Luo","email":"luo.lujin@jp.fujitsu.com","username":"Lujin"},"change_message_id":"b1b5c7283eaaa71513f2cfd762852c4235aa35e7","unresolved":false,"context_lines":[{"line_number":188,"context_line":"    def test_get_port_binding_host_multiple_results_found(self):"},{"line_number":189,"context_line":"        network_id \u003d \u0027foo-network-id\u0027"},{"line_number":190,"context_line":"        # port_id should be prefix of both port_id_one and port_id_two"},{"line_number":191,"context_line":"        port_id \u003d uuidutils.generate_uuid()"},{"line_number":192,"context_line":"        port_id_one \u003d uuidutils.generate_uuid()"},{"line_number":193,"context_line":"        port_id_two \u003d uuidutils.generate_uuid()"},{"line_number":194,"context_line":"        host \u003d \u0027fake_host\u0027"},{"line_number":195,"context_line":"        vif_type \u003d portbindings.VIF_TYPE_UNBOUND"},{"line_number":196,"context_line":"        self._setup_neutron_network(network_id)"}],"source_content_type":"text/x-python","patch_set":12,"id":"1a6eadb0_47b6398b","line":193,"range":{"start_line":191,"start_character":8,"end_line":193,"end_character":47},"in_reply_to":"1a6eadb0_b8349f4a","updated":"2016-12-20 05:30:41.000000000","message":"Thanks! I dittoed this to Line 389 in next PS. But I would like to propose that we remove these prefix_port_id UTs, as the passed-in prefix port_id is not full UUID and thus we cannot query anything from it.","commit_id":"eb606cefc90a7d2f7232d3f084d93f6c86183566"},{"author":{"_account_id":17120,"name":"Manjeet Singh Bhatia","email":"manjeet.s.bhatia@intel.com","username":"manjeets"},"change_message_id":"fcfad6ffa5f0fddfb0d2b51bbff29138605cf8a5","unresolved":false,"context_lines":[{"line_number":335,"context_line":"            self.ctx, port_id, \u0027foo_host\u0027, router.id)"},{"line_number":336,"context_line":"        expected_objs \u003d obj_port.DistributedPortBinding.get_objects("},{"line_number":337,"context_line":"            self.ctx, port_id\u003dport_id)"},{"line_number":338,"context_line":"        exp_obj \u003d expected_objs.pop()"},{"line_number":339,"context_line":"        self.assertEqual(port_id, exp_obj.port_id)"},{"line_number":340,"context_line":""},{"line_number":341,"context_line":"    def test_ensure_distributed_port_binding_multiple_bindings(self):"}],"source_content_type":"text/x-python","patch_set":12,"id":"1a6eadb0_38fc0f3e","line":338,"range":{"start_line":338,"start_character":8,"end_line":338,"end_character":37},"updated":"2016-12-19 18:36:43.000000000","message":"as it is expected exactly one row this code will not cover if we get multiple records, and pop will still work()","commit_id":"eb606cefc90a7d2f7232d3f084d93f6c86183566"},{"author":{"_account_id":17491,"name":"Lujin Luo","email":"luo.lujin@jp.fujitsu.com","username":"Lujin"},"change_message_id":"b1b5c7283eaaa71513f2cfd762852c4235aa35e7","unresolved":false,"context_lines":[{"line_number":335,"context_line":"            self.ctx, port_id, \u0027foo_host\u0027, router.id)"},{"line_number":336,"context_line":"        expected_objs \u003d obj_port.DistributedPortBinding.get_objects("},{"line_number":337,"context_line":"            self.ctx, port_id\u003dport_id)"},{"line_number":338,"context_line":"        exp_obj \u003d expected_objs.pop()"},{"line_number":339,"context_line":"        self.assertEqual(port_id, exp_obj.port_id)"},{"line_number":340,"context_line":""},{"line_number":341,"context_line":"    def test_ensure_distributed_port_binding_multiple_bindings(self):"}],"source_content_type":"text/x-python","patch_set":12,"id":"1a6eadb0_c79329f9","line":338,"range":{"start_line":338,"start_character":8,"end_line":338,"end_character":37},"in_reply_to":"1a6eadb0_38fc0f3e","updated":"2016-12-20 05:30:41.000000000","message":"Done","commit_id":"eb606cefc90a7d2f7232d3f084d93f6c86183566"},{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"17434b504a168180449f3633874eeb1a272215a3","unresolved":false,"context_lines":[{"line_number":183,"context_line":"        port_host \u003d ml2_db.get_port_binding_host(self.ctx, port_id)"},{"line_number":184,"context_line":"        self.assertEqual(host, port_host)"},{"line_number":185,"context_line":""},{"line_number":186,"context_line":"    def test_get_port_binding_host_multiple_results_found(self):"},{"line_number":187,"context_line":"        network_id \u003d uuidutils.generate_uuid()"},{"line_number":188,"context_line":"        port_id \u003d uuidutils.generate_uuid()"},{"line_number":189,"context_line":"        port_id_one \u003d uuidutils.generate_uuid()"}],"source_content_type":"text/x-python","patch_set":23,"id":"ba5201f7_e63b78cf","line":186,"updated":"2017-01-11 20:16:58.000000000","message":"this test doesn\u0027t really make much sense and covers non-production use case. Why not just killing it instead of trying to fix it?","commit_id":"6ce05e18eede9f9799e8e67d7421f17d653ba5bc"},{"author":{"_account_id":17491,"name":"Lujin Luo","email":"luo.lujin@jp.fujitsu.com","username":"Lujin"},"change_message_id":"620a9c8d74f02d757b82a51c51e1225d94d3f9e9","unresolved":false,"context_lines":[{"line_number":183,"context_line":"        port_host \u003d ml2_db.get_port_binding_host(self.ctx, port_id)"},{"line_number":184,"context_line":"        self.assertEqual(host, port_host)"},{"line_number":185,"context_line":""},{"line_number":186,"context_line":"    def test_get_port_binding_host_multiple_results_found(self):"},{"line_number":187,"context_line":"        network_id \u003d uuidutils.generate_uuid()"},{"line_number":188,"context_line":"        port_id \u003d uuidutils.generate_uuid()"},{"line_number":189,"context_line":"        port_id_one \u003d uuidutils.generate_uuid()"}],"source_content_type":"text/x-python","patch_set":23,"id":"7a3c09a3_1ff3e90b","line":186,"in_reply_to":"ba5201f7_e63b78cf","updated":"2017-01-17 09:45:32.000000000","message":"Done","commit_id":"6ce05e18eede9f9799e8e67d7421f17d653ba5bc"},{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"17434b504a168180449f3633874eeb1a272215a3","unresolved":false,"context_lines":[{"line_number":254,"context_line":"        self._setup_neutron_port(network_id, port_id)"},{"line_number":255,"context_line":"        self._setup_neutron_portbinding(port_id, vif_type, host)"},{"line_number":256,"context_line":""},{"line_number":257,"context_line":"        port, binding \u003d ml2_db.get_locked_port_and_binding(self.ctx, port_id)"},{"line_number":258,"context_line":"        self.assertEqual(port_id, port.id)"},{"line_number":259,"context_line":"        self.assertEqual(port_id, binding.port_id)"},{"line_number":260,"context_line":""}],"source_content_type":"text/x-python","patch_set":23,"id":"ba5201f7_664ea870","line":257,"updated":"2017-01-11 20:16:58.000000000","message":"unrelated change?","commit_id":"6ce05e18eede9f9799e8e67d7421f17d653ba5bc"},{"author":{"_account_id":17491,"name":"Lujin Luo","email":"luo.lujin@jp.fujitsu.com","username":"Lujin"},"change_message_id":"620a9c8d74f02d757b82a51c51e1225d94d3f9e9","unresolved":false,"context_lines":[{"line_number":254,"context_line":"        self._setup_neutron_port(network_id, port_id)"},{"line_number":255,"context_line":"        self._setup_neutron_portbinding(port_id, vif_type, host)"},{"line_number":256,"context_line":""},{"line_number":257,"context_line":"        port, binding \u003d ml2_db.get_locked_port_and_binding(self.ctx, port_id)"},{"line_number":258,"context_line":"        self.assertEqual(port_id, port.id)"},{"line_number":259,"context_line":"        self.assertEqual(port_id, binding.port_id)"},{"line_number":260,"context_line":""}],"source_content_type":"text/x-python","patch_set":23,"id":"7a3c09a3_df5de1ed","line":257,"in_reply_to":"ba5201f7_664ea870","updated":"2017-01-17 09:45:32.000000000","message":"I have no idea why I changed this... Done!","commit_id":"6ce05e18eede9f9799e8e67d7421f17d653ba5bc"},{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"17434b504a168180449f3633874eeb1a272215a3","unresolved":false,"context_lines":[{"line_number":261,"context_line":"    def test_get_locked_port_and_binding_result_not_found(self):"},{"line_number":262,"context_line":"        port_id \u003d uuidutils.generate_uuid()"},{"line_number":263,"context_line":""},{"line_number":264,"context_line":"        port, binding \u003d ml2_db.get_locked_port_and_binding(self.ctx, port_id)"},{"line_number":265,"context_line":"        self.assertIsNone(port)"},{"line_number":266,"context_line":"        self.assertIsNone(binding)"},{"line_number":267,"context_line":""}],"source_content_type":"text/x-python","patch_set":23,"id":"ba5201f7_a65410fe","line":264,"updated":"2017-01-11 20:16:58.000000000","message":"unrelated change?","commit_id":"6ce05e18eede9f9799e8e67d7421f17d653ba5bc"},{"author":{"_account_id":17491,"name":"Lujin Luo","email":"luo.lujin@jp.fujitsu.com","username":"Lujin"},"change_message_id":"620a9c8d74f02d757b82a51c51e1225d94d3f9e9","unresolved":false,"context_lines":[{"line_number":261,"context_line":"    def test_get_locked_port_and_binding_result_not_found(self):"},{"line_number":262,"context_line":"        port_id \u003d uuidutils.generate_uuid()"},{"line_number":263,"context_line":""},{"line_number":264,"context_line":"        port, binding \u003d ml2_db.get_locked_port_and_binding(self.ctx, port_id)"},{"line_number":265,"context_line":"        self.assertIsNone(port)"},{"line_number":266,"context_line":"        self.assertIsNone(binding)"},{"line_number":267,"context_line":""}],"source_content_type":"text/x-python","patch_set":23,"id":"7a3c09a3_1f5849fa","line":264,"in_reply_to":"ba5201f7_a65410fe","updated":"2017-01-17 09:45:32.000000000","message":"Done","commit_id":"6ce05e18eede9f9799e8e67d7421f17d653ba5bc"},{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"17434b504a168180449f3633874eeb1a272215a3","unresolved":false,"context_lines":[{"line_number":300,"context_line":""},{"line_number":301,"context_line":"    def _setup_distributed_binding(self, network_id,"},{"line_number":302,"context_line":"                                   port_id, router_id, host_id):"},{"line_number":303,"context_line":"        record_obj \u003d obj_port.DistributedPortBinding("},{"line_number":304,"context_line":"            self.ctx,"},{"line_number":305,"context_line":"            port_id\u003dport_id,"},{"line_number":306,"context_line":"            host\u003dhost_id,"}],"source_content_type":"text/x-python","patch_set":23,"id":"ba5201f7_26490061","line":303,"range":{"start_line":303,"start_character":8,"end_line":303,"end_character":18},"updated":"2017-01-11 20:16:58.000000000","message":"-\u003e binding_obj","commit_id":"6ce05e18eede9f9799e8e67d7421f17d653ba5bc"},{"author":{"_account_id":17491,"name":"Lujin Luo","email":"luo.lujin@jp.fujitsu.com","username":"Lujin"},"change_message_id":"620a9c8d74f02d757b82a51c51e1225d94d3f9e9","unresolved":false,"context_lines":[{"line_number":300,"context_line":""},{"line_number":301,"context_line":"    def _setup_distributed_binding(self, network_id,"},{"line_number":302,"context_line":"                                   port_id, router_id, host_id):"},{"line_number":303,"context_line":"        record_obj \u003d obj_port.DistributedPortBinding("},{"line_number":304,"context_line":"            self.ctx,"},{"line_number":305,"context_line":"            port_id\u003dport_id,"},{"line_number":306,"context_line":"            host\u003dhost_id,"}],"source_content_type":"text/x-python","patch_set":23,"id":"7a3c09a3_82221cb8","line":303,"range":{"start_line":303,"start_character":8,"end_line":303,"end_character":18},"in_reply_to":"ba5201f7_26490061","updated":"2017-01-17 09:45:32.000000000","message":"Done","commit_id":"6ce05e18eede9f9799e8e67d7421f17d653ba5bc"},{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"17434b504a168180449f3633874eeb1a272215a3","unresolved":false,"context_lines":[{"line_number":325,"context_line":"            with mock.patch.object(ml2_db.LOG, \u0027debug\u0027) as log_trace:"},{"line_number":326,"context_line":"                binding \u003d ml2_db.ensure_distributed_port_binding("},{"line_number":327,"context_line":"                    self.ctx, port_id, host_id, router_id)"},{"line_number":328,"context_line":"        self.assertEqual(2, get_object.call_count)"},{"line_number":329,"context_line":"        self.assertTrue(log_trace.called)"},{"line_number":330,"context_line":"        self.assertEqual(port_id, binding.port_id)"},{"line_number":331,"context_line":""},{"line_number":332,"context_line":"    def test_ensure_distributed_port_binding(self):"}],"source_content_type":"text/x-python","patch_set":23,"id":"ba5201f7_e697f88d","line":329,"range":{"start_line":328,"start_character":8,"end_line":329,"end_character":41},"updated":"2017-01-11 20:16:58.000000000","message":"I believe those checks are worthless since they validate internal details, and so instead of fixing them for the new code, we should kill them.","commit_id":"6ce05e18eede9f9799e8e67d7421f17d653ba5bc"},{"author":{"_account_id":17491,"name":"Lujin Luo","email":"luo.lujin@jp.fujitsu.com","username":"Lujin"},"change_message_id":"620a9c8d74f02d757b82a51c51e1225d94d3f9e9","unresolved":false,"context_lines":[{"line_number":325,"context_line":"            with mock.patch.object(ml2_db.LOG, \u0027debug\u0027) as log_trace:"},{"line_number":326,"context_line":"                binding \u003d ml2_db.ensure_distributed_port_binding("},{"line_number":327,"context_line":"                    self.ctx, port_id, host_id, router_id)"},{"line_number":328,"context_line":"        self.assertEqual(2, get_object.call_count)"},{"line_number":329,"context_line":"        self.assertTrue(log_trace.called)"},{"line_number":330,"context_line":"        self.assertEqual(port_id, binding.port_id)"},{"line_number":331,"context_line":""},{"line_number":332,"context_line":"    def test_ensure_distributed_port_binding(self):"}],"source_content_type":"text/x-python","patch_set":23,"id":"7a3c09a3_6973d015","line":329,"range":{"start_line":328,"start_character":8,"end_line":329,"end_character":41},"in_reply_to":"ba5201f7_e697f88d","updated":"2017-01-17 09:45:32.000000000","message":"Done","commit_id":"6ce05e18eede9f9799e8e67d7421f17d653ba5bc"},{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"17434b504a168180449f3633874eeb1a272215a3","unresolved":false,"context_lines":[{"line_number":338,"context_line":"            self.ctx, port_id, \u0027foo_host\u0027, router.id)"},{"line_number":339,"context_line":"        expected_objs \u003d obj_port.DistributedPortBinding.get_objects("},{"line_number":340,"context_line":"            self.ctx, port_id\u003dport_id)"},{"line_number":341,"context_line":"        count_objs \u003d obj_port.DistributedPortBinding.count("},{"line_number":342,"context_line":"            self.ctx, port_id\u003dport_id)"},{"line_number":343,"context_line":"        exp_obj \u003d expected_objs.pop()"},{"line_number":344,"context_line":"        self.assertEqual(1, count_objs)"},{"line_number":345,"context_line":"        self.assertEqual(port_id, exp_obj.port_id)"}],"source_content_type":"text/x-python","patch_set":23,"id":"ba5201f7_26e58037","line":342,"range":{"start_line":341,"start_character":8,"end_line":342,"end_character":38},"updated":"2017-01-11 20:16:58.000000000","message":"we do we call count() here if we already have expected_objs and hence can just call len() on it?","commit_id":"6ce05e18eede9f9799e8e67d7421f17d653ba5bc"},{"author":{"_account_id":17491,"name":"Lujin Luo","email":"luo.lujin@jp.fujitsu.com","username":"Lujin"},"change_message_id":"620a9c8d74f02d757b82a51c51e1225d94d3f9e9","unresolved":false,"context_lines":[{"line_number":338,"context_line":"            self.ctx, port_id, \u0027foo_host\u0027, router.id)"},{"line_number":339,"context_line":"        expected_objs \u003d obj_port.DistributedPortBinding.get_objects("},{"line_number":340,"context_line":"            self.ctx, port_id\u003dport_id)"},{"line_number":341,"context_line":"        count_objs \u003d obj_port.DistributedPortBinding.count("},{"line_number":342,"context_line":"            self.ctx, port_id\u003dport_id)"},{"line_number":343,"context_line":"        exp_obj \u003d expected_objs.pop()"},{"line_number":344,"context_line":"        self.assertEqual(1, count_objs)"},{"line_number":345,"context_line":"        self.assertEqual(port_id, exp_obj.port_id)"}],"source_content_type":"text/x-python","patch_set":23,"id":"7a3c09a3_42403457","line":342,"range":{"start_line":341,"start_character":8,"end_line":342,"end_character":38},"in_reply_to":"ba5201f7_26e58037","updated":"2017-01-17 09:45:32.000000000","message":"Done","commit_id":"6ce05e18eede9f9799e8e67d7421f17d653ba5bc"},{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"17434b504a168180449f3633874eeb1a272215a3","unresolved":false,"context_lines":[{"line_number":367,"context_line":""},{"line_number":368,"context_line":"        ml2_db.delete_distributed_port_binding_if_stale(self.ctx, binding)"},{"line_number":369,"context_line":""},{"line_number":370,"context_line":"        obj \u003d obj_port.DistributedPortBinding.objects_exist("},{"line_number":371,"context_line":"            self.ctx, port_id\u003dbinding.port_id)"},{"line_number":372,"context_line":"        self.assertFalse(obj)"},{"line_number":373,"context_line":""}],"source_content_type":"text/x-python","patch_set":23,"id":"ba5201f7_064a3c26","line":370,"range":{"start_line":370,"start_character":8,"end_line":370,"end_character":11},"updated":"2017-01-11 20:16:58.000000000","message":"-\u003e obj_exists","commit_id":"6ce05e18eede9f9799e8e67d7421f17d653ba5bc"},{"author":{"_account_id":17491,"name":"Lujin Luo","email":"luo.lujin@jp.fujitsu.com","username":"Lujin"},"change_message_id":"620a9c8d74f02d757b82a51c51e1225d94d3f9e9","unresolved":false,"context_lines":[{"line_number":367,"context_line":""},{"line_number":368,"context_line":"        ml2_db.delete_distributed_port_binding_if_stale(self.ctx, binding)"},{"line_number":369,"context_line":""},{"line_number":370,"context_line":"        obj \u003d obj_port.DistributedPortBinding.objects_exist("},{"line_number":371,"context_line":"            self.ctx, port_id\u003dbinding.port_id)"},{"line_number":372,"context_line":"        self.assertFalse(obj)"},{"line_number":373,"context_line":""}],"source_content_type":"text/x-python","patch_set":23,"id":"7a3c09a3_223b28ed","line":370,"range":{"start_line":370,"start_character":8,"end_line":370,"end_character":11},"in_reply_to":"ba5201f7_064a3c26","updated":"2017-01-17 09:45:32.000000000","message":"Done","commit_id":"6ce05e18eede9f9799e8e67d7421f17d653ba5bc"},{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"17434b504a168180449f3633874eeb1a272215a3","unresolved":false,"context_lines":[{"line_number":388,"context_line":"        port_id \u003d uuidutils.generate_uuid()"},{"line_number":389,"context_line":"        port_id_1 \u003d uuidutils.generate_uuid()"},{"line_number":390,"context_line":"        port_id_2 \u003d uuidutils.generate_uuid()"},{"line_number":391,"context_line":"        # NOTE(lujinluo) to check startswith testcase we"},{"line_number":392,"context_line":"        # need port ids with same characters"},{"line_number":393,"context_line":"        port_id_1 \u003d port_id[:8] + port_id_1[8:]"},{"line_number":394,"context_line":"        port_id_2 \u003d port_id[:8] + port_id_2[8:]"}],"source_content_type":"text/x-python","patch_set":23,"id":"ba5201f7_6606a8cf","line":391,"updated":"2017-01-11 20:16:58.000000000","message":"this test case is worthless, let\u0027s kill it/rewrite it so that it does not require startswith matching.","commit_id":"6ce05e18eede9f9799e8e67d7421f17d653ba5bc"},{"author":{"_account_id":17491,"name":"Lujin Luo","email":"luo.lujin@jp.fujitsu.com","username":"Lujin"},"change_message_id":"620a9c8d74f02d757b82a51c51e1225d94d3f9e9","unresolved":false,"context_lines":[{"line_number":388,"context_line":"        port_id \u003d uuidutils.generate_uuid()"},{"line_number":389,"context_line":"        port_id_1 \u003d uuidutils.generate_uuid()"},{"line_number":390,"context_line":"        port_id_2 \u003d uuidutils.generate_uuid()"},{"line_number":391,"context_line":"        # NOTE(lujinluo) to check startswith testcase we"},{"line_number":392,"context_line":"        # need port ids with same characters"},{"line_number":393,"context_line":"        port_id_1 \u003d port_id[:8] + port_id_1[8:]"},{"line_number":394,"context_line":"        port_id_2 \u003d port_id[:8] + port_id_2[8:]"}],"source_content_type":"text/x-python","patch_set":23,"id":"7a3c09a3_1f7cc971","line":391,"in_reply_to":"ba5201f7_6606a8cf","updated":"2017-01-17 09:45:32.000000000","message":"This is my bad. I made the wrong changes in the first place. This test is supposed to test if one distributed port can have two different hosts, which is allowed. But I took it wrongly as testing duplication of port_ids with same prefix. I will change it back.","commit_id":"6ce05e18eede9f9799e8e67d7421f17d653ba5bc"},{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"17434b504a168180449f3633874eeb1a272215a3","unresolved":false,"context_lines":[{"line_number":402,"context_line":"        self.assertEqual(2, len(ports))"},{"line_number":403,"context_line":""},{"line_number":404,"context_line":"    def test_distributed_port_binding_deleted_by_port_deletion(self):"},{"line_number":405,"context_line":"        with self.ctx.session.begin(subtransactions\u003dTrue):"},{"line_number":406,"context_line":"            self.ctx.session.add(models_v2.Network(id\u003d\u0027network_id\u0027))"},{"line_number":407,"context_line":"            device_owner \u003d constants.DEVICE_OWNER_DVR_INTERFACE"},{"line_number":408,"context_line":"            port_id \u003d uuidutils.generate_uuid()"}],"source_content_type":"text/x-python","patch_set":23,"id":"ba5201f7_461524e3","line":405,"updated":"2017-01-11 20:16:58.000000000","message":"not sure we need that transaction now that we use OVO to create bindings and ports since create() already does it, and unit test environment is well isolated not to care about parallel requests by other threads (each test case has its own in-memory database).","commit_id":"6ce05e18eede9f9799e8e67d7421f17d653ba5bc"},{"author":{"_account_id":17491,"name":"Lujin Luo","email":"luo.lujin@jp.fujitsu.com","username":"Lujin"},"change_message_id":"620a9c8d74f02d757b82a51c51e1225d94d3f9e9","unresolved":false,"context_lines":[{"line_number":402,"context_line":"        self.assertEqual(2, len(ports))"},{"line_number":403,"context_line":""},{"line_number":404,"context_line":"    def test_distributed_port_binding_deleted_by_port_deletion(self):"},{"line_number":405,"context_line":"        with self.ctx.session.begin(subtransactions\u003dTrue):"},{"line_number":406,"context_line":"            self.ctx.session.add(models_v2.Network(id\u003d\u0027network_id\u0027))"},{"line_number":407,"context_line":"            device_owner \u003d constants.DEVICE_OWNER_DVR_INTERFACE"},{"line_number":408,"context_line":"            port_id \u003d uuidutils.generate_uuid()"}],"source_content_type":"text/x-python","patch_set":23,"id":"7a3c09a3_5f02d13f","line":405,"in_reply_to":"ba5201f7_461524e3","updated":"2017-01-17 09:45:32.000000000","message":"I will keep port creation in the transaction and move bindings creation out of it.","commit_id":"6ce05e18eede9f9799e8e67d7421f17d653ba5bc"},{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"17434b504a168180449f3633874eeb1a272215a3","unresolved":false,"context_lines":[{"line_number":430,"context_line":"            with self.ctx.session.begin(subtransactions\u003dTrue):"},{"line_number":431,"context_line":"                self.ctx.session.delete(port)"},{"line_number":432,"context_line":"            self.assertEqual([], warning_list)"},{"line_number":433,"context_line":"        ports_binds \u003d ml2_db.get_distributed_port_bindings(self.ctx, port_id)"},{"line_number":434,"context_line":"        self.assertEqual(0, len(ports_binds))"}],"source_content_type":"text/x-python","patch_set":23,"id":"ba5201f7_a6da5049","line":433,"range":{"start_line":433,"start_character":8,"end_line":433,"end_character":19},"updated":"2017-01-11 20:16:58.000000000","message":"-\u003e bindings","commit_id":"6ce05e18eede9f9799e8e67d7421f17d653ba5bc"},{"author":{"_account_id":17491,"name":"Lujin Luo","email":"luo.lujin@jp.fujitsu.com","username":"Lujin"},"change_message_id":"620a9c8d74f02d757b82a51c51e1225d94d3f9e9","unresolved":false,"context_lines":[{"line_number":430,"context_line":"            with self.ctx.session.begin(subtransactions\u003dTrue):"},{"line_number":431,"context_line":"                self.ctx.session.delete(port)"},{"line_number":432,"context_line":"            self.assertEqual([], warning_list)"},{"line_number":433,"context_line":"        ports_binds \u003d ml2_db.get_distributed_port_bindings(self.ctx, port_id)"},{"line_number":434,"context_line":"        self.assertEqual(0, len(ports_binds))"}],"source_content_type":"text/x-python","patch_set":23,"id":"7a3c09a3_dfede18f","line":433,"range":{"start_line":433,"start_character":8,"end_line":433,"end_character":19},"in_reply_to":"ba5201f7_a6da5049","updated":"2017-01-17 09:45:32.000000000","message":"Done","commit_id":"6ce05e18eede9f9799e8e67d7421f17d653ba5bc"},{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"e11d2446308ff191f1dfe5c72331778b99a5bc10","unresolved":false,"context_lines":[{"line_number":331,"context_line":"            with mock.patch.object(ml2_db.LOG, \u0027debug\u0027) as log_trace:"},{"line_number":332,"context_line":"                binding \u003d ml2_db.ensure_distributed_port_binding("},{"line_number":333,"context_line":"                    self.ctx, port_id, host_id, router_id)"},{"line_number":334,"context_line":"        self.assertTrue(query_first.called)"},{"line_number":335,"context_line":"        self.assertTrue(log_trace.called)"},{"line_number":336,"context_line":"        self.assertEqual(port_id, binding.port_id)"},{"line_number":337,"context_line":""},{"line_number":338,"context_line":"    def test_ensure_distributed_port_binding(self):"}],"source_content_type":"text/x-python","patch_set":24,"id":"7a3c09a3_d6c60a67","side":"PARENT","line":335,"range":{"start_line":334,"start_character":0,"end_line":335,"end_character":41},"updated":"2017-01-17 16:21:38.000000000","message":"Before, I suggested that checking that LOG was called is not worth it for a unit test. Same for the number of query calls. But you killed the whole test case instead. I think we should leave the test in place, just remove those worthless checks.","commit_id":"eb27f0be526f9bd4b97ee1f4e70d80a8a1b229e5"},{"author":{"_account_id":17491,"name":"Lujin Luo","email":"luo.lujin@jp.fujitsu.com","username":"Lujin"},"change_message_id":"90d86c43599ec40284383c555bba28acb9cc5233","unresolved":false,"context_lines":[{"line_number":331,"context_line":"            with mock.patch.object(ml2_db.LOG, \u0027debug\u0027) as log_trace:"},{"line_number":332,"context_line":"                binding \u003d ml2_db.ensure_distributed_port_binding("},{"line_number":333,"context_line":"                    self.ctx, port_id, host_id, router_id)"},{"line_number":334,"context_line":"        self.assertTrue(query_first.called)"},{"line_number":335,"context_line":"        self.assertTrue(log_trace.called)"},{"line_number":336,"context_line":"        self.assertEqual(port_id, binding.port_id)"},{"line_number":337,"context_line":""},{"line_number":338,"context_line":"    def test_ensure_distributed_port_binding(self):"}],"source_content_type":"text/x-python","patch_set":24,"id":"7a3c09a3_096121a9","side":"PARENT","line":335,"range":{"start_line":334,"start_character":0,"end_line":335,"end_character":41},"in_reply_to":"7a3c09a3_d6c60a67","updated":"2017-01-18 11:57:53.000000000","message":"Done","commit_id":"eb27f0be526f9bd4b97ee1f4e70d80a8a1b229e5"},{"author":{"_account_id":8726,"name":"Victor Morales","email":"chipahuac@hotmail.com","username":"electrocucaracha"},"change_message_id":"35c3e255a00143300938a0c344095ee62968f87d","unresolved":false,"context_lines":[{"line_number":250,"context_line":""},{"line_number":251,"context_line":""},{"line_number":252,"context_line":"class Ml2DvrDBTestCase(testlib_api.SqlTestCase):"},{"line_number":253,"context_line":"    CORE_PLUGIN \u003d \u0027neutron.db.db_base_plugin_v2.NeutronDbPluginV2\u0027"},{"line_number":254,"context_line":""},{"line_number":255,"context_line":"    def setUp(self):"},{"line_number":256,"context_line":"        super(Ml2DvrDBTestCase, self).setUp()"}],"source_content_type":"text/x-python","patch_set":27,"id":"5a3905b3_d2c4cb93","line":253,"range":{"start_line":253,"start_character":4,"end_line":253,"end_character":66},"updated":"2017-01-19 23:41:03.000000000","message":"nit: IMHO this should be on the top of the file after the imports section","commit_id":"03238ffce6ea07e4b6e5b71d2e689b4cf6e63375"},{"author":{"_account_id":17491,"name":"Lujin Luo","email":"luo.lujin@jp.fujitsu.com","username":"Lujin"},"change_message_id":"850a23bb4877321bcaa87605933b9c1ba0d90fb5","unresolved":false,"context_lines":[{"line_number":250,"context_line":""},{"line_number":251,"context_line":""},{"line_number":252,"context_line":"class Ml2DvrDBTestCase(testlib_api.SqlTestCase):"},{"line_number":253,"context_line":"    CORE_PLUGIN \u003d \u0027neutron.db.db_base_plugin_v2.NeutronDbPluginV2\u0027"},{"line_number":254,"context_line":""},{"line_number":255,"context_line":"    def setUp(self):"},{"line_number":256,"context_line":"        super(Ml2DvrDBTestCase, self).setUp()"}],"source_content_type":"text/x-python","patch_set":27,"id":"5a3905b3_08ffff67","line":253,"range":{"start_line":253,"start_character":4,"end_line":253,"end_character":66},"in_reply_to":"5a3905b3_d2c4cb93","updated":"2017-01-20 02:47:01.000000000","message":"My idea to put it here is because this is the only class using it","commit_id":"03238ffce6ea07e4b6e5b71d2e689b4cf6e63375"},{"author":{"_account_id":8726,"name":"Victor Morales","email":"chipahuac@hotmail.com","username":"electrocucaracha"},"change_message_id":"35c3e255a00143300938a0c344095ee62968f87d","unresolved":false,"context_lines":[{"line_number":322,"context_line":"            self.ctx, port_id\u003dport_id)"},{"line_number":323,"context_line":"        count_objs \u003d len(expected_objs)"},{"line_number":324,"context_line":"        exp_obj \u003d expected_objs.pop()"},{"line_number":325,"context_line":"        self.assertEqual(1, count_objs)"},{"line_number":326,"context_line":"        self.assertEqual(port_id, exp_obj.port_id)"},{"line_number":327,"context_line":""},{"line_number":328,"context_line":"    def test_ensure_distributed_port_binding_multiple_bindings(self):"}],"source_content_type":"text/x-python","patch_set":27,"id":"5a3905b3_12a0139f","line":325,"range":{"start_line":325,"start_character":8,"end_line":325,"end_character":39},"updated":"2017-01-19 23:41:03.000000000","message":"this assertion should be one line above and the declaration of the count_objs variable is not required","commit_id":"03238ffce6ea07e4b6e5b71d2e689b4cf6e63375"},{"author":{"_account_id":17491,"name":"Lujin Luo","email":"luo.lujin@jp.fujitsu.com","username":"Lujin"},"change_message_id":"850a23bb4877321bcaa87605933b9c1ba0d90fb5","unresolved":false,"context_lines":[{"line_number":322,"context_line":"            self.ctx, port_id\u003dport_id)"},{"line_number":323,"context_line":"        count_objs \u003d len(expected_objs)"},{"line_number":324,"context_line":"        exp_obj \u003d expected_objs.pop()"},{"line_number":325,"context_line":"        self.assertEqual(1, count_objs)"},{"line_number":326,"context_line":"        self.assertEqual(port_id, exp_obj.port_id)"},{"line_number":327,"context_line":""},{"line_number":328,"context_line":"    def test_ensure_distributed_port_binding_multiple_bindings(self):"}],"source_content_type":"text/x-python","patch_set":27,"id":"5a3905b3_a8450bb4","line":325,"range":{"start_line":325,"start_character":8,"end_line":325,"end_character":39},"in_reply_to":"5a3905b3_12a0139f","updated":"2017-01-20 02:47:01.000000000","message":"Done","commit_id":"03238ffce6ea07e4b6e5b71d2e689b4cf6e63375"},{"author":{"_account_id":8726,"name":"Victor Morales","email":"chipahuac@hotmail.com","username":"electrocucaracha"},"change_message_id":"35c3e255a00143300938a0c344095ee62968f87d","unresolved":false,"context_lines":[{"line_number":361,"context_line":"    def test_get_distributed_port_bindings_not_found(self):"},{"line_number":362,"context_line":"        port \u003d ml2_db.get_distributed_port_bindings(self.ctx,"},{"line_number":363,"context_line":"                                                    uuidutils.generate_uuid())"},{"line_number":364,"context_line":"        self.assertFalse(len(port))"},{"line_number":365,"context_line":""},{"line_number":366,"context_line":"    def test_get_distributed_port_bindings(self):"},{"line_number":367,"context_line":"        network_id \u003d uuidutils.generate_uuid()"}],"source_content_type":"text/x-python","patch_set":27,"id":"5a3905b3_124ad3c5","line":364,"range":{"start_line":364,"start_character":8,"end_line":364,"end_character":35},"updated":"2017-01-19 23:41:03.000000000","message":"nit: this assertion could be improved \n\nself.assertEqual(0, len(port))","commit_id":"03238ffce6ea07e4b6e5b71d2e689b4cf6e63375"},{"author":{"_account_id":17491,"name":"Lujin Luo","email":"luo.lujin@jp.fujitsu.com","username":"Lujin"},"change_message_id":"850a23bb4877321bcaa87605933b9c1ba0d90fb5","unresolved":false,"context_lines":[{"line_number":361,"context_line":"    def test_get_distributed_port_bindings_not_found(self):"},{"line_number":362,"context_line":"        port \u003d ml2_db.get_distributed_port_bindings(self.ctx,"},{"line_number":363,"context_line":"                                                    uuidutils.generate_uuid())"},{"line_number":364,"context_line":"        self.assertFalse(len(port))"},{"line_number":365,"context_line":""},{"line_number":366,"context_line":"    def test_get_distributed_port_bindings(self):"},{"line_number":367,"context_line":"        network_id \u003d uuidutils.generate_uuid()"}],"source_content_type":"text/x-python","patch_set":27,"id":"5a3905b3_a81c2bc2","line":364,"range":{"start_line":364,"start_character":8,"end_line":364,"end_character":35},"in_reply_to":"5a3905b3_124ad3c5","updated":"2017-01-20 02:47:01.000000000","message":"Done","commit_id":"03238ffce6ea07e4b6e5b71d2e689b4cf6e63375"},{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"231c4991ba00d62a2f26e754f3ec6b540186056a","unresolved":false,"context_lines":[{"line_number":287,"context_line":"        super(Ml2DvrDBTestCase, self).setUp()"},{"line_number":288,"context_line":"        self.setup_coreplugin(self.CORE_PLUGIN)"},{"line_number":289,"context_line":"        self.ctx \u003d context.get_admin_context()"},{"line_number":290,"context_line":"        self.setup_coreplugin(PLUGIN_NAME)"},{"line_number":291,"context_line":""},{"line_number":292,"context_line":"    def _setup_neutron_network(self, network_id, port_ids):"},{"line_number":293,"context_line":"        with db_api.context_manager.writer.using(self.ctx):"}],"source_content_type":"text/x-python","patch_set":78,"id":"df87a7cf_8fc14a83","line":290,"updated":"2017-12-06 19:48:49.000000000","message":"we already do this, so why do we need line 288? NeutronDbPluginV2 is a parent class of ml2 plugin.","commit_id":"429eab719f78c3f48fa7a32c55332cce80cb0c68"},{"author":{"_account_id":17491,"name":"Lujin Luo","email":"luo.lujin@jp.fujitsu.com","username":"Lujin"},"change_message_id":"e52e819d3369fa22568eded9b9b598c6f41fdda9","unresolved":false,"context_lines":[{"line_number":287,"context_line":"        super(Ml2DvrDBTestCase, self).setUp()"},{"line_number":288,"context_line":"        self.setup_coreplugin(self.CORE_PLUGIN)"},{"line_number":289,"context_line":"        self.ctx \u003d context.get_admin_context()"},{"line_number":290,"context_line":"        self.setup_coreplugin(PLUGIN_NAME)"},{"line_number":291,"context_line":""},{"line_number":292,"context_line":"    def _setup_neutron_network(self, network_id, port_ids):"},{"line_number":293,"context_line":"        with db_api.context_manager.writer.using(self.ctx):"}],"source_content_type":"text/x-python","patch_set":78,"id":"df87a7cf_268ffc75","line":290,"in_reply_to":"df87a7cf_8fc14a83","updated":"2017-12-07 08:50:15.000000000","message":"Let me check. It is probably because when this patch was drafted a year ago, we did not have core plugin set up.","commit_id":"429eab719f78c3f48fa7a32c55332cce80cb0c68"},{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"231c4991ba00d62a2f26e754f3ec6b540186056a","unresolved":false,"context_lines":[{"line_number":327,"context_line":"        binding_obj.create()"},{"line_number":328,"context_line":"        return binding_obj"},{"line_number":329,"context_line":""},{"line_number":330,"context_line":"    def test_ensure_distributed_port_binding_deals_with_db_duplicate(self):"},{"line_number":331,"context_line":"        network_id \u003d uuidutils.generate_uuid()"},{"line_number":332,"context_line":"        port_id \u003d uuidutils.generate_uuid()"},{"line_number":333,"context_line":"        router_id \u003d uuidutils.generate_uuid()"}],"source_content_type":"text/x-python","patch_set":78,"id":"df87a7cf_ef2ed641","line":330,"range":{"start_line":330,"start_character":51,"end_line":330,"end_character":68},"updated":"2017-12-06 19:48:49.000000000","message":"I am not sure the test case now reflects its name (and intent). The old version was checking that we first attempt to fetch before creating a new binding. The new version doesn\u0027t check whether get_object was even called. I think we should do it to leave semantics of the test case the same.","commit_id":"429eab719f78c3f48fa7a32c55332cce80cb0c68"},{"author":{"_account_id":17491,"name":"Lujin Luo","email":"luo.lujin@jp.fujitsu.com","username":"Lujin"},"change_message_id":"e52e819d3369fa22568eded9b9b598c6f41fdda9","unresolved":false,"context_lines":[{"line_number":327,"context_line":"        binding_obj.create()"},{"line_number":328,"context_line":"        return binding_obj"},{"line_number":329,"context_line":""},{"line_number":330,"context_line":"    def test_ensure_distributed_port_binding_deals_with_db_duplicate(self):"},{"line_number":331,"context_line":"        network_id \u003d uuidutils.generate_uuid()"},{"line_number":332,"context_line":"        port_id \u003d uuidutils.generate_uuid()"},{"line_number":333,"context_line":"        router_id \u003d uuidutils.generate_uuid()"}],"source_content_type":"text/x-python","patch_set":78,"id":"df87a7cf_26193c21","line":330,"range":{"start_line":330,"start_character":51,"end_line":330,"end_character":68},"in_reply_to":"df87a7cf_ef2ed641","updated":"2017-12-07 08:50:15.000000000","message":"Will add the check.","commit_id":"429eab719f78c3f48fa7a32c55332cce80cb0c68"},{"author":{"_account_id":11975,"name":"Slawek Kaplonski","email":"skaplons@redhat.com","username":"slaweq"},"change_message_id":"7d16c75d91ef3c33d86b13e5aa6a7f0a2195f64b","unresolved":false,"context_lines":[{"line_number":351,"context_line":"        expected_objs \u003d port_obj.DistributedPortBinding.get_objects("},{"line_number":352,"context_line":"            self.ctx, port_id\u003dport_id)"},{"line_number":353,"context_line":"        self.assertEqual(1, len(expected_objs))"},{"line_number":354,"context_line":"        exp_obj \u003d expected_objs.pop()"},{"line_number":355,"context_line":"        self.assertEqual(port_id, exp_obj.port_id)"},{"line_number":356,"context_line":""},{"line_number":357,"context_line":"    def test_ensure_distributed_port_binding_multiple_bindings(self):"}],"source_content_type":"text/x-python","patch_set":80,"id":"df87a7cf_6006fe54","line":354,"updated":"2017-12-11 10:09:59.000000000","message":"nit: this shortcut is IMHO not necessary and \"expected_obj\" would be better here","commit_id":"ee3c52a60752586c7d0c261acf7fcfec9eeaff05"},{"author":{"_account_id":17491,"name":"Lujin Luo","email":"luo.lujin@jp.fujitsu.com","username":"Lujin"},"change_message_id":"ba2445effd4b3a08870417d258d5eba0e7fc1cba","unresolved":false,"context_lines":[{"line_number":351,"context_line":"        expected_objs \u003d port_obj.DistributedPortBinding.get_objects("},{"line_number":352,"context_line":"            self.ctx, port_id\u003dport_id)"},{"line_number":353,"context_line":"        self.assertEqual(1, len(expected_objs))"},{"line_number":354,"context_line":"        exp_obj \u003d expected_objs.pop()"},{"line_number":355,"context_line":"        self.assertEqual(port_id, exp_obj.port_id)"},{"line_number":356,"context_line":""},{"line_number":357,"context_line":"    def test_ensure_distributed_port_binding_multiple_bindings(self):"}],"source_content_type":"text/x-python","patch_set":80,"id":"df87a7cf_24cd5384","line":354,"in_reply_to":"df87a7cf_6006fe54","updated":"2017-12-12 01:47:48.000000000","message":"Will respin.","commit_id":"ee3c52a60752586c7d0c261acf7fcfec9eeaff05"},{"author":{"_account_id":11975,"name":"Slawek Kaplonski","email":"skaplons@redhat.com","username":"slaweq"},"change_message_id":"7d16c75d91ef3c33d86b13e5aa6a7f0a2195f64b","unresolved":false,"context_lines":[{"line_number":352,"context_line":"            self.ctx, port_id\u003dport_id)"},{"line_number":353,"context_line":"        self.assertEqual(1, len(expected_objs))"},{"line_number":354,"context_line":"        exp_obj \u003d expected_objs.pop()"},{"line_number":355,"context_line":"        self.assertEqual(port_id, exp_obj.port_id)"},{"line_number":356,"context_line":""},{"line_number":357,"context_line":"    def test_ensure_distributed_port_binding_multiple_bindings(self):"},{"line_number":358,"context_line":"        network_id \u003d uuidutils.generate_uuid()"}],"source_content_type":"text/x-python","patch_set":80,"id":"df87a7cf_8001c23a","line":355,"updated":"2017-12-11 10:09:59.000000000","message":"please use pattern:\n\n    self.assertEqual(expected, actual)","commit_id":"ee3c52a60752586c7d0c261acf7fcfec9eeaff05"},{"author":{"_account_id":17491,"name":"Lujin Luo","email":"luo.lujin@jp.fujitsu.com","username":"Lujin"},"change_message_id":"ba2445effd4b3a08870417d258d5eba0e7fc1cba","unresolved":false,"context_lines":[{"line_number":352,"context_line":"            self.ctx, port_id\u003dport_id)"},{"line_number":353,"context_line":"        self.assertEqual(1, len(expected_objs))"},{"line_number":354,"context_line":"        exp_obj \u003d expected_objs.pop()"},{"line_number":355,"context_line":"        self.assertEqual(port_id, exp_obj.port_id)"},{"line_number":356,"context_line":""},{"line_number":357,"context_line":"    def test_ensure_distributed_port_binding_multiple_bindings(self):"},{"line_number":358,"context_line":"        network_id \u003d uuidutils.generate_uuid()"}],"source_content_type":"text/x-python","patch_set":80,"id":"df87a7cf_84a3ffb1","line":355,"in_reply_to":"df87a7cf_8001c23a","updated":"2017-12-12 01:47:48.000000000","message":"The current one follows exactly the pattern, right? exp_obj is the actual one and port_id is what we expect the port_id of exp_obj to be.","commit_id":"ee3c52a60752586c7d0c261acf7fcfec9eeaff05"},{"author":{"_account_id":11975,"name":"Slawek Kaplonski","email":"skaplons@redhat.com","username":"slaweq"},"change_message_id":"6ca802aefa772f61b80799437412703f0e1a6337","unresolved":false,"context_lines":[{"line_number":352,"context_line":"            self.ctx, port_id\u003dport_id)"},{"line_number":353,"context_line":"        self.assertEqual(1, len(expected_objs))"},{"line_number":354,"context_line":"        exp_obj \u003d expected_objs.pop()"},{"line_number":355,"context_line":"        self.assertEqual(port_id, exp_obj.port_id)"},{"line_number":356,"context_line":""},{"line_number":357,"context_line":"    def test_ensure_distributed_port_binding_multiple_bindings(self):"},{"line_number":358,"context_line":"        network_id \u003d uuidutils.generate_uuid()"}],"source_content_type":"text/x-python","patch_set":80,"id":"df87a7cf_f9c70d95","line":355,"in_reply_to":"df87a7cf_84a3ffb1","updated":"2017-12-12 09:13:44.000000000","message":"So current names are confusing for me. You have something called \"expected_obj\" which in fact is \"current_obj\"","commit_id":"ee3c52a60752586c7d0c261acf7fcfec9eeaff05"},{"author":{"_account_id":11975,"name":"Slawek Kaplonski","email":"skaplons@redhat.com","username":"slaweq"},"change_message_id":"e739f5c9c46cac1997c903d32da68bfd796021bb","unresolved":false,"context_lines":[{"line_number":352,"context_line":"            self.ctx, port_id\u003dport_id)"},{"line_number":353,"context_line":"        self.assertEqual(1, len(expected_objs))"},{"line_number":354,"context_line":"        expected_obj \u003d expected_objs.pop()"},{"line_number":355,"context_line":"        self.assertEqual(port_id, expected_obj.port_id)"},{"line_number":356,"context_line":""},{"line_number":357,"context_line":"    def test_ensure_distributed_port_binding_multiple_bindings(self):"},{"line_number":358,"context_line":"        network_id \u003d uuidutils.generate_uuid()"}],"source_content_type":"text/x-python","patch_set":85,"id":"df87a7cf_f2377bfd","line":355,"updated":"2017-12-19 08:49:54.000000000","message":"As I wrote in comment to PS80, please change names of \"expected_obj\" as it is in fact current object, not expected one","commit_id":"90241416a7cef70ac9e250dc5d145659d83e7c12"},{"author":{"_account_id":17491,"name":"Lujin Luo","email":"luo.lujin@jp.fujitsu.com","username":"Lujin"},"change_message_id":"a677800ee4a0a607c49298ca6772e1d4b588167c","unresolved":false,"context_lines":[{"line_number":352,"context_line":"            self.ctx, port_id\u003dport_id)"},{"line_number":353,"context_line":"        self.assertEqual(1, len(expected_objs))"},{"line_number":354,"context_line":"        expected_obj \u003d expected_objs.pop()"},{"line_number":355,"context_line":"        self.assertEqual(port_id, expected_obj.port_id)"},{"line_number":356,"context_line":""},{"line_number":357,"context_line":"    def test_ensure_distributed_port_binding_multiple_bindings(self):"},{"line_number":358,"context_line":"        network_id \u003d uuidutils.generate_uuid()"}],"source_content_type":"text/x-python","patch_set":85,"id":"bf8cb3f7_ec75e9fb","line":355,"in_reply_to":"df87a7cf_f2377bfd","updated":"2017-12-21 07:59:58.000000000","message":"Hi, sorry I forgot to address that comment. Will do in next PS.","commit_id":"90241416a7cef70ac9e250dc5d145659d83e7c12"}],"neutron/tests/unit/plugins/ml2/test_plugin.py":[{"author":{"_account_id":15518,"name":"Artur Korzeniewski","email":"artur.korzen@wp.pl","username":"akorzeni"},"change_message_id":"3fd6692299f4d4dbf7c960d7b0971ef1c14fb22b","unresolved":false,"context_lines":[{"line_number":2612,"context_line":"            plugin.set_ipam_backend()"},{"line_number":2613,"context_line":"            # deleting the port will call registry.notify, which will"},{"line_number":2614,"context_line":"            # run the transaction balancing function defined in this test"},{"line_number":2615,"context_line":"            with mock.patch(\u0027neutron.plugins.ml2.plugin.\u0027"},{"line_number":2616,"context_line":"                            \u0027db.get_locked_port_and_binding\u0027,"},{"line_number":2617,"context_line":"                            return_value\u003d(None, None)),\\"},{"line_number":2618,"context_line":"                    mock.patch.object(obj_port.PortBinding,"}],"source_content_type":"text/x-python","patch_set":20,"id":"ba5201f7_383c2293","line":2615,"updated":"2017-01-02 12:35:01.000000000","message":"Looks like too much mocking.","commit_id":"6d0c214b2486c113a0d7bc50189035bcde04d076"},{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"231c4991ba00d62a2f26e754f3ec6b540186056a","unresolved":false,"context_lines":[{"line_number":1632,"context_line":"            plugin \u003d directory.get_plugin()"},{"line_number":1633,"context_line":"            # TODO(lujinluo): Change binding_db to binding_obj, and remove"},{"line_number":1634,"context_line":"            # the use of _load_object() once Port OVO is integrated."},{"line_number":1635,"context_line":"            binding_db \u003d plugin._get_port(self.context,"},{"line_number":1636,"context_line":"                                          port[\u0027port\u0027][\u0027id\u0027]).port_binding"},{"line_number":1637,"context_line":"            binding \u003d obj_port.PortBinding._load_object(self.context,"},{"line_number":1638,"context_line":"                                                        binding_db)"},{"line_number":1639,"context_line":"            binding.update_host(\u0027test\u0027)"},{"line_number":1640,"context_line":"            mech_context \u003d driver_context.PortContext("},{"line_number":1641,"context_line":"                plugin, self.context, port[\u0027port\u0027],"}],"source_content_type":"text/x-python","patch_set":78,"id":"df87a7cf_efb816c9","line":1638,"range":{"start_line":1635,"start_character":12,"end_line":1638,"end_character":67},"updated":"2017-12-06 19:48:49.000000000","message":"why can\u0027t we at least PortBinding.get_objects here with port_id\u003dport[\u0027port\u0027][\u0027id\u0027]?","commit_id":"429eab719f78c3f48fa7a32c55332cce80cb0c68"},{"author":{"_account_id":17491,"name":"Lujin Luo","email":"luo.lujin@jp.fujitsu.com","username":"Lujin"},"change_message_id":"e52e819d3369fa22568eded9b9b598c6f41fdda9","unresolved":false,"context_lines":[{"line_number":1632,"context_line":"            plugin \u003d directory.get_plugin()"},{"line_number":1633,"context_line":"            # TODO(lujinluo): Change binding_db to binding_obj, and remove"},{"line_number":1634,"context_line":"            # the use of _load_object() once Port OVO is integrated."},{"line_number":1635,"context_line":"            binding_db \u003d plugin._get_port(self.context,"},{"line_number":1636,"context_line":"                                          port[\u0027port\u0027][\u0027id\u0027]).port_binding"},{"line_number":1637,"context_line":"            binding \u003d obj_port.PortBinding._load_object(self.context,"},{"line_number":1638,"context_line":"                                                        binding_db)"},{"line_number":1639,"context_line":"            binding.update_host(\u0027test\u0027)"},{"line_number":1640,"context_line":"            mech_context \u003d driver_context.PortContext("},{"line_number":1641,"context_line":"                plugin, self.context, port[\u0027port\u0027],"}],"source_content_type":"text/x-python","patch_set":78,"id":"df87a7cf_e68b541c","line":1638,"range":{"start_line":1635,"start_character":12,"end_line":1638,"end_character":67},"in_reply_to":"df87a7cf_efb816c9","updated":"2017-12-07 08:50:15.000000000","message":"Yes, we can. This is merely a design decision. I used _load_object() only because I wanted to keep the original code style, i.e. querying port_binding through port instead of db. \nIf we weigh hiding private method (_load_object()) more, I can surely query port_binding through get_object().","commit_id":"429eab719f78c3f48fa7a32c55332cce80cb0c68"},{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"231c4991ba00d62a2f26e754f3ec6b540186056a","unresolved":false,"context_lines":[{"line_number":1659,"context_line":"            # the use of _load_object() once Port OVO is integrated."},{"line_number":1660,"context_line":"            binding_db \u003d plugin._get_port("},{"line_number":1661,"context_line":"                self.context, port[\u0027port\u0027][\u0027id\u0027]).port_binding"},{"line_number":1662,"context_line":"            binding \u003d obj_port.PortBinding._load_object(self.context,"},{"line_number":1663,"context_line":"                                                        binding_db)"},{"line_number":1664,"context_line":"            binding.update_host(\u0027fake_host\u0027)"},{"line_number":1665,"context_line":"            binding[\u0027vif_type\u0027] \u003d port_vif_type"}],"source_content_type":"text/x-python","patch_set":78,"id":"df87a7cf_2fc6fe49","line":1662,"updated":"2017-12-06 19:48:49.000000000","message":"ditto","commit_id":"429eab719f78c3f48fa7a32c55332cce80cb0c68"},{"author":{"_account_id":17491,"name":"Lujin Luo","email":"luo.lujin@jp.fujitsu.com","username":"Lujin"},"change_message_id":"e52e819d3369fa22568eded9b9b598c6f41fdda9","unresolved":false,"context_lines":[{"line_number":1659,"context_line":"            # the use of _load_object() once Port OVO is integrated."},{"line_number":1660,"context_line":"            binding_db \u003d plugin._get_port("},{"line_number":1661,"context_line":"                self.context, port[\u0027port\u0027][\u0027id\u0027]).port_binding"},{"line_number":1662,"context_line":"            binding \u003d obj_port.PortBinding._load_object(self.context,"},{"line_number":1663,"context_line":"                                                        binding_db)"},{"line_number":1664,"context_line":"            binding.update_host(\u0027fake_host\u0027)"},{"line_number":1665,"context_line":"            binding[\u0027vif_type\u0027] \u003d port_vif_type"}],"source_content_type":"text/x-python","patch_set":78,"id":"df87a7cf_863da82c","line":1662,"in_reply_to":"df87a7cf_2fc6fe49","updated":"2017-12-07 08:50:15.000000000","message":"Done","commit_id":"429eab719f78c3f48fa7a32c55332cce80cb0c68"},{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"231c4991ba00d62a2f26e754f3ec6b540186056a","unresolved":false,"context_lines":[{"line_number":1779,"context_line":"            # the use of _load_object() once Port OVO is integrated."},{"line_number":1780,"context_line":"            binding_db \u003d plugin._get_port("},{"line_number":1781,"context_line":"                self.context, port[\u0027port\u0027][\u0027id\u0027]).port_binding"},{"line_number":1782,"context_line":"            binding \u003d obj_port.PortBinding._load_object(self.context,"},{"line_number":1783,"context_line":"                                                        binding_db)"},{"line_number":1784,"context_line":"            binding.update_host(\u0027test\u0027)"},{"line_number":1785,"context_line":"            mech_context \u003d driver_context.PortContext("}],"source_content_type":"text/x-python","patch_set":78,"id":"df87a7cf_4fc1022e","line":1782,"updated":"2017-12-06 19:48:49.000000000","message":"ditto","commit_id":"429eab719f78c3f48fa7a32c55332cce80cb0c68"},{"author":{"_account_id":17491,"name":"Lujin Luo","email":"luo.lujin@jp.fujitsu.com","username":"Lujin"},"change_message_id":"e52e819d3369fa22568eded9b9b598c6f41fdda9","unresolved":false,"context_lines":[{"line_number":1779,"context_line":"            # the use of _load_object() once Port OVO is integrated."},{"line_number":1780,"context_line":"            binding_db \u003d plugin._get_port("},{"line_number":1781,"context_line":"                self.context, port[\u0027port\u0027][\u0027id\u0027]).port_binding"},{"line_number":1782,"context_line":"            binding \u003d obj_port.PortBinding._load_object(self.context,"},{"line_number":1783,"context_line":"                                                        binding_db)"},{"line_number":1784,"context_line":"            binding.update_host(\u0027test\u0027)"},{"line_number":1785,"context_line":"            mech_context \u003d driver_context.PortContext("}],"source_content_type":"text/x-python","patch_set":78,"id":"df87a7cf_464320b0","line":1782,"in_reply_to":"df87a7cf_4fc1022e","updated":"2017-12-07 08:50:15.000000000","message":"Done","commit_id":"429eab719f78c3f48fa7a32c55332cce80cb0c68"},{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"231c4991ba00d62a2f26e754f3ec6b540186056a","unresolved":false,"context_lines":[{"line_number":1804,"context_line":"            # the use of _load_object() once Port OVO is integrated."},{"line_number":1805,"context_line":"            binding_db \u003d plugin._get_port("},{"line_number":1806,"context_line":"                self.context, port[\u0027port\u0027][\u0027id\u0027]).port_binding"},{"line_number":1807,"context_line":"            binding \u003d obj_port.PortBinding._load_object(self.context,"},{"line_number":1808,"context_line":"                                                        binding_db)"},{"line_number":1809,"context_line":"            binding.update_host(\u0027test\u0027)"},{"line_number":1810,"context_line":"            mech_context \u003d driver_context.PortContext("}],"source_content_type":"text/x-python","patch_set":78,"id":"df87a7cf_ef2b36e8","line":1807,"updated":"2017-12-06 19:48:49.000000000","message":"ditto","commit_id":"429eab719f78c3f48fa7a32c55332cce80cb0c68"},{"author":{"_account_id":17491,"name":"Lujin Luo","email":"luo.lujin@jp.fujitsu.com","username":"Lujin"},"change_message_id":"e52e819d3369fa22568eded9b9b598c6f41fdda9","unresolved":false,"context_lines":[{"line_number":1804,"context_line":"            # the use of _load_object() once Port OVO is integrated."},{"line_number":1805,"context_line":"            binding_db \u003d plugin._get_port("},{"line_number":1806,"context_line":"                self.context, port[\u0027port\u0027][\u0027id\u0027]).port_binding"},{"line_number":1807,"context_line":"            binding \u003d obj_port.PortBinding._load_object(self.context,"},{"line_number":1808,"context_line":"                                                        binding_db)"},{"line_number":1809,"context_line":"            binding.update_host(\u0027test\u0027)"},{"line_number":1810,"context_line":"            mech_context \u003d driver_context.PortContext("}],"source_content_type":"text/x-python","patch_set":78,"id":"df87a7cf_e615949d","line":1807,"in_reply_to":"df87a7cf_ef2b36e8","updated":"2017-12-07 08:50:15.000000000","message":"Done","commit_id":"429eab719f78c3f48fa7a32c55332cce80cb0c68"},{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"231c4991ba00d62a2f26e754f3ec6b540186056a","unresolved":false,"context_lines":[{"line_number":1822,"context_line":"        host_id \u003d \u0027host\u0027"},{"line_number":1823,"context_line":"        ctxt \u003d context.get_admin_context()"},{"line_number":1824,"context_line":"        binding_obj \u003d obj_port.DistributedPortBinding("},{"line_number":1825,"context_line":"            mock.MagicMock(),"},{"line_number":1826,"context_line":"            port_id\u003duuidutils.generate_uuid(),"},{"line_number":1827,"context_line":"            host\u003dhost_id,"},{"line_number":1828,"context_line":"            profile\u003d{},"}],"source_content_type":"text/x-python","patch_set":78,"id":"df87a7cf_4f44a2b7","line":1825,"updated":"2017-12-06 19:48:49.000000000","message":"hm. why do we use MagicMock as context? Why not ctxt that you handily calculate in line 1823?","commit_id":"429eab719f78c3f48fa7a32c55332cce80cb0c68"},{"author":{"_account_id":17491,"name":"Lujin Luo","email":"luo.lujin@jp.fujitsu.com","username":"Lujin"},"change_message_id":"fbcfbd16dafd3280bab12f8c35bfd1c530686630","unresolved":false,"context_lines":[{"line_number":1822,"context_line":"        host_id \u003d \u0027host\u0027"},{"line_number":1823,"context_line":"        ctxt \u003d context.get_admin_context()"},{"line_number":1824,"context_line":"        binding_obj \u003d obj_port.DistributedPortBinding("},{"line_number":1825,"context_line":"            mock.MagicMock(),"},{"line_number":1826,"context_line":"            port_id\u003duuidutils.generate_uuid(),"},{"line_number":1827,"context_line":"            host\u003dhost_id,"},{"line_number":1828,"context_line":"            profile\u003d{},"}],"source_content_type":"text/x-python","patch_set":78,"id":"df87a7cf_e7bfb2a7","line":1825,"in_reply_to":"df87a7cf_264dbcc3","updated":"2017-12-08 07:22:36.000000000","message":"The reason comes from the foreign key constraints. If we use the actual context, we need to create an actual port.","commit_id":"429eab719f78c3f48fa7a32c55332cce80cb0c68"},{"author":{"_account_id":17491,"name":"Lujin Luo","email":"luo.lujin@jp.fujitsu.com","username":"Lujin"},"change_message_id":"e52e819d3369fa22568eded9b9b598c6f41fdda9","unresolved":false,"context_lines":[{"line_number":1822,"context_line":"        host_id \u003d \u0027host\u0027"},{"line_number":1823,"context_line":"        ctxt \u003d context.get_admin_context()"},{"line_number":1824,"context_line":"        binding_obj \u003d obj_port.DistributedPortBinding("},{"line_number":1825,"context_line":"            mock.MagicMock(),"},{"line_number":1826,"context_line":"            port_id\u003duuidutils.generate_uuid(),"},{"line_number":1827,"context_line":"            host\u003dhost_id,"},{"line_number":1828,"context_line":"            profile\u003d{},"}],"source_content_type":"text/x-python","patch_set":78,"id":"df87a7cf_264dbcc3","line":1825,"in_reply_to":"df87a7cf_4f44a2b7","updated":"2017-12-07 08:50:15.000000000","message":"I will double check.","commit_id":"429eab719f78c3f48fa7a32c55332cce80cb0c68"},{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"231c4991ba00d62a2f26e754f3ec6b540186056a","unresolved":false,"context_lines":[{"line_number":1825,"context_line":"            mock.MagicMock(),"},{"line_number":1826,"context_line":"            port_id\u003duuidutils.generate_uuid(),"},{"line_number":1827,"context_line":"            host\u003dhost_id,"},{"line_number":1828,"context_line":"            profile\u003d{},"},{"line_number":1829,"context_line":"            router_id\u003d\u0027old_router_id\u0027,"},{"line_number":1830,"context_line":"            vif_type\u003dportbindings.VIF_TYPE_OVS,"},{"line_number":1831,"context_line":"            vnic_type\u003dportbindings.VNIC_NORMAL,"}],"source_content_type":"text/x-python","patch_set":78,"id":"df87a7cf_af0e8e8a","line":1828,"updated":"2017-12-06 19:48:49.000000000","message":"(nit) None (implicit default value) would work too right?","commit_id":"429eab719f78c3f48fa7a32c55332cce80cb0c68"},{"author":{"_account_id":17491,"name":"Lujin Luo","email":"luo.lujin@jp.fujitsu.com","username":"Lujin"},"change_message_id":"fbcfbd16dafd3280bab12f8c35bfd1c530686630","unresolved":false,"context_lines":[{"line_number":1825,"context_line":"            mock.MagicMock(),"},{"line_number":1826,"context_line":"            port_id\u003duuidutils.generate_uuid(),"},{"line_number":1827,"context_line":"            host\u003dhost_id,"},{"line_number":1828,"context_line":"            profile\u003d{},"},{"line_number":1829,"context_line":"            router_id\u003d\u0027old_router_id\u0027,"},{"line_number":1830,"context_line":"            vif_type\u003dportbindings.VIF_TYPE_OVS,"},{"line_number":1831,"context_line":"            vnic_type\u003dportbindings.VNIC_NORMAL,"}],"source_content_type":"text/x-python","patch_set":78,"id":"df87a7cf_07cdf664","line":1828,"in_reply_to":"df87a7cf_46dfa0d5","updated":"2017-12-08 07:22:36.000000000","message":"Failure without specifying profile is pasted in http://paste.openstack.org/show/628422/","commit_id":"429eab719f78c3f48fa7a32c55332cce80cb0c68"},{"author":{"_account_id":17491,"name":"Lujin Luo","email":"luo.lujin@jp.fujitsu.com","username":"Lujin"},"change_message_id":"e52e819d3369fa22568eded9b9b598c6f41fdda9","unresolved":false,"context_lines":[{"line_number":1825,"context_line":"            mock.MagicMock(),"},{"line_number":1826,"context_line":"            port_id\u003duuidutils.generate_uuid(),"},{"line_number":1827,"context_line":"            host\u003dhost_id,"},{"line_number":1828,"context_line":"            profile\u003d{},"},{"line_number":1829,"context_line":"            router_id\u003d\u0027old_router_id\u0027,"},{"line_number":1830,"context_line":"            vif_type\u003dportbindings.VIF_TYPE_OVS,"},{"line_number":1831,"context_line":"            vnic_type\u003dportbindings.VNIC_NORMAL,"}],"source_content_type":"text/x-python","patch_set":78,"id":"df87a7cf_46dfa0d5","line":1828,"in_reply_to":"df87a7cf_af0e8e8a","updated":"2017-12-07 08:50:15.000000000","message":"No, I think this is why I specified {}. Will check which tests will fail and update.","commit_id":"429eab719f78c3f48fa7a32c55332cce80cb0c68"},{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"231c4991ba00d62a2f26e754f3ec6b540186056a","unresolved":false,"context_lines":[{"line_number":1884,"context_line":"        context._binding.vnic_type \u003d portbindings.VNIC_NORMAL"},{"line_number":1885,"context_line":"        context._binding.profile \u003d None"},{"line_number":1886,"context_line":"        context._binding.vif_type \u003d \u0027\u0027"},{"line_number":1887,"context_line":"        context._binding.vif_details \u003d None"},{"line_number":1888,"context_line":"        context.original \u003d mock_port"},{"line_number":1889,"context_line":"        with mock.patch.object(plugin, \u0027_update_port_dict_binding\u0027), \\"},{"line_number":1890,"context_line":"            mock.patch.object(segments_db, \u0027get_network_segments\u0027,"}],"source_content_type":"text/x-python","patch_set":78,"id":"df87a7cf_6f0e463c","line":1887,"updated":"2017-12-06 19:48:49.000000000","message":"can we instead set context._binding to a legit binding object with those properties?","commit_id":"429eab719f78c3f48fa7a32c55332cce80cb0c68"},{"author":{"_account_id":17491,"name":"Lujin Luo","email":"luo.lujin@jp.fujitsu.com","username":"Lujin"},"change_message_id":"e52e819d3369fa22568eded9b9b598c6f41fdda9","unresolved":false,"context_lines":[{"line_number":1884,"context_line":"        context._binding.vnic_type \u003d portbindings.VNIC_NORMAL"},{"line_number":1885,"context_line":"        context._binding.profile \u003d None"},{"line_number":1886,"context_line":"        context._binding.vif_type \u003d \u0027\u0027"},{"line_number":1887,"context_line":"        context._binding.vif_details \u003d None"},{"line_number":1888,"context_line":"        context.original \u003d mock_port"},{"line_number":1889,"context_line":"        with mock.patch.object(plugin, \u0027_update_port_dict_binding\u0027), \\"},{"line_number":1890,"context_line":"            mock.patch.object(segments_db, \u0027get_network_segments\u0027,"}],"source_content_type":"text/x-python","patch_set":78,"id":"df87a7cf_6640a4a6","line":1887,"in_reply_to":"df87a7cf_6f0e463c","updated":"2017-12-07 08:50:15.000000000","message":"Ok, will add.","commit_id":"429eab719f78c3f48fa7a32c55332cce80cb0c68"},{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"231c4991ba00d62a2f26e754f3ec6b540186056a","unresolved":false,"context_lines":[{"line_number":2561,"context_line":"        \"\"\"Test validate distributed router interface update succeeds.\"\"\""},{"line_number":2562,"context_line":"        host_id \u003d \u0027host\u0027"},{"line_number":2563,"context_line":"        binding_obj \u003d obj_port.DistributedPortBinding("},{"line_number":2564,"context_line":"            mock.MagicMock(),"},{"line_number":2565,"context_line":"            port_id\u003duuidutils.generate_uuid(),"},{"line_number":2566,"context_line":"            host\u003dhost_id,"},{"line_number":2567,"context_line":"            router_id\u003d\u0027old_router_id\u0027,"}],"source_content_type":"text/x-python","patch_set":78,"id":"df87a7cf_e2ffcdfe","line":2564,"updated":"2017-12-06 19:48:49.000000000","message":"please use a real context","commit_id":"429eab719f78c3f48fa7a32c55332cce80cb0c68"},{"author":{"_account_id":17491,"name":"Lujin Luo","email":"luo.lujin@jp.fujitsu.com","username":"Lujin"},"change_message_id":"fbcfbd16dafd3280bab12f8c35bfd1c530686630","unresolved":false,"context_lines":[{"line_number":2561,"context_line":"        \"\"\"Test validate distributed router interface update succeeds.\"\"\""},{"line_number":2562,"context_line":"        host_id \u003d \u0027host\u0027"},{"line_number":2563,"context_line":"        binding_obj \u003d obj_port.DistributedPortBinding("},{"line_number":2564,"context_line":"            mock.MagicMock(),"},{"line_number":2565,"context_line":"            port_id\u003duuidutils.generate_uuid(),"},{"line_number":2566,"context_line":"            host\u003dhost_id,"},{"line_number":2567,"context_line":"            router_id\u003d\u0027old_router_id\u0027,"}],"source_content_type":"text/x-python","patch_set":78,"id":"df87a7cf_e7ed72b7","line":2564,"in_reply_to":"df87a7cf_069c380d","updated":"2017-12-08 07:22:36.000000000","message":"Yeah, this is the same issue with foreign key (port_id). Do we really want to create a real port for this purpose?","commit_id":"429eab719f78c3f48fa7a32c55332cce80cb0c68"},{"author":{"_account_id":17491,"name":"Lujin Luo","email":"luo.lujin@jp.fujitsu.com","username":"Lujin"},"change_message_id":"e52e819d3369fa22568eded9b9b598c6f41fdda9","unresolved":false,"context_lines":[{"line_number":2561,"context_line":"        \"\"\"Test validate distributed router interface update succeeds.\"\"\""},{"line_number":2562,"context_line":"        host_id \u003d \u0027host\u0027"},{"line_number":2563,"context_line":"        binding_obj \u003d obj_port.DistributedPortBinding("},{"line_number":2564,"context_line":"            mock.MagicMock(),"},{"line_number":2565,"context_line":"            port_id\u003duuidutils.generate_uuid(),"},{"line_number":2566,"context_line":"            host\u003dhost_id,"},{"line_number":2567,"context_line":"            router_id\u003d\u0027old_router_id\u0027,"}],"source_content_type":"text/x-python","patch_set":78,"id":"df87a7cf_069c380d","line":2564,"in_reply_to":"df87a7cf_e2ffcdfe","updated":"2017-12-07 08:50:15.000000000","message":"Will do.","commit_id":"429eab719f78c3f48fa7a32c55332cce80cb0c68"},{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"231c4991ba00d62a2f26e754f3ec6b540186056a","unresolved":false,"context_lines":[{"line_number":2805,"context_line":"                    self.context, port[\u0027port\u0027][\u0027id\u0027])"},{"line_number":2806,"context_line":"                # TODO(lujinluo): Remove the use of _load_object() once"},{"line_number":2807,"context_line":"                # Port OVO is integrated."},{"line_number":2808,"context_line":"                binding \u003d obj_port.PortBinding._load_object("},{"line_number":2809,"context_line":"                    self.context, port_db.port_binding)"},{"line_number":2810,"context_line":"                binding.update_host(\u0027host-ovs-no_filter\u0027)"},{"line_number":2811,"context_line":"                mech_context \u003d driver_context.PortContext("}],"source_content_type":"text/x-python","patch_set":78,"id":"df87a7cf_0203d10e","line":2808,"updated":"2017-12-06 19:48:49.000000000","message":"use PortBinding.get_object?","commit_id":"429eab719f78c3f48fa7a32c55332cce80cb0c68"},{"author":{"_account_id":17491,"name":"Lujin Luo","email":"luo.lujin@jp.fujitsu.com","username":"Lujin"},"change_message_id":"e52e819d3369fa22568eded9b9b598c6f41fdda9","unresolved":false,"context_lines":[{"line_number":2805,"context_line":"                    self.context, port[\u0027port\u0027][\u0027id\u0027])"},{"line_number":2806,"context_line":"                # TODO(lujinluo): Remove the use of _load_object() once"},{"line_number":2807,"context_line":"                # Port OVO is integrated."},{"line_number":2808,"context_line":"                binding \u003d obj_port.PortBinding._load_object("},{"line_number":2809,"context_line":"                    self.context, port_db.port_binding)"},{"line_number":2810,"context_line":"                binding.update_host(\u0027host-ovs-no_filter\u0027)"},{"line_number":2811,"context_line":"                mech_context \u003d driver_context.PortContext("}],"source_content_type":"text/x-python","patch_set":78,"id":"df87a7cf_26f13c96","line":2808,"in_reply_to":"df87a7cf_0203d10e","updated":"2017-12-07 08:50:15.000000000","message":"Done","commit_id":"429eab719f78c3f48fa7a32c55332cce80cb0c68"},{"author":{"_account_id":11975,"name":"Slawek Kaplonski","email":"skaplons@redhat.com","username":"slaweq"},"change_message_id":"7d16c75d91ef3c33d86b13e5aa6a7f0a2195f64b","unresolved":false,"context_lines":[{"line_number":2560,"context_line":"            vif_type\u003dportbindings.VIF_TYPE_OVS,"},{"line_number":2561,"context_line":"            vnic_type\u003dportbindings.VNIC_NORMAL,"},{"line_number":2562,"context_line":"            status\u003dconstants.PORT_STATUS_DOWN)"},{"line_number":2563,"context_line":"        binding_obj.create()"},{"line_number":2564,"context_line":"        with mock.patch.object("},{"line_number":2565,"context_line":"            mech_test.TestMechanismDriver,"},{"line_number":2566,"context_line":"            \u0027update_port_postcommit\u0027,"}],"source_content_type":"text/x-python","patch_set":80,"id":"df87a7cf_c0eb4a75","line":2563,"updated":"2017-12-11 10:09:59.000000000","message":"nit: this creation of binding object could be maybe moved to some helper method to avaid code duplication as it is repeated in few places","commit_id":"ee3c52a60752586c7d0c261acf7fcfec9eeaff05"},{"author":{"_account_id":17491,"name":"Lujin Luo","email":"luo.lujin@jp.fujitsu.com","username":"Lujin"},"change_message_id":"ba2445effd4b3a08870417d258d5eba0e7fc1cba","unresolved":false,"context_lines":[{"line_number":2560,"context_line":"            vif_type\u003dportbindings.VIF_TYPE_OVS,"},{"line_number":2561,"context_line":"            vnic_type\u003dportbindings.VNIC_NORMAL,"},{"line_number":2562,"context_line":"            status\u003dconstants.PORT_STATUS_DOWN)"},{"line_number":2563,"context_line":"        binding_obj.create()"},{"line_number":2564,"context_line":"        with mock.patch.object("},{"line_number":2565,"context_line":"            mech_test.TestMechanismDriver,"},{"line_number":2566,"context_line":"            \u0027update_port_postcommit\u0027,"}],"source_content_type":"text/x-python","patch_set":80,"id":"df87a7cf_076cd1cb","line":2563,"in_reply_to":"df87a7cf_c0eb4a75","updated":"2017-12-12 01:47:48.000000000","message":"Yeah, it makes sense. But let\u0027s leave it as it is for now. Will come back maybe later.","commit_id":"ee3c52a60752586c7d0c261acf7fcfec9eeaff05"}],"neutron/tests/unit/plugins/ml2/test_port_binding.py":[{"author":{"_account_id":17120,"name":"Manjeet Singh Bhatia","email":"manjeet.s.bhatia@intel.com","username":"manjeets"},"change_message_id":"fcfad6ffa5f0fddfb0d2b51bbff29138605cf8a5","unresolved":false,"context_lines":[{"line_number":110,"context_line":"        ctx \u003d context.get_admin_context()"},{"line_number":111,"context_line":"        with self.port(name\u003d\u0027name\u0027) as port:"},{"line_number":112,"context_line":"            # emulating concurrent binding deletion"},{"line_number":113,"context_line":"            #TODO(lujinluo): change to delete_objects() once it is ready"},{"line_number":114,"context_line":"            obj \u003d obj_port.PortBinding.get_object("},{"line_number":115,"context_line":"                ctx, port_id\u003dport[\u0027port\u0027][\u0027id\u0027])"},{"line_number":116,"context_line":"            obj.delete()"}],"source_content_type":"text/x-python","patch_set":12,"id":"1a6eadb0_63c5fc59","line":113,"range":{"start_line":113,"start_character":12,"end_line":113,"end_character":72},"updated":"2016-12-19 18:36:43.000000000","message":"delete objects is ready and got merged last week\nhttps://github.com/openstack/neutron/commit/0b9935a1411e58005370c762b5a5895e385e45b2","commit_id":"eb606cefc90a7d2f7232d3f084d93f6c86183566"},{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"17434b504a168180449f3633874eeb1a272215a3","unresolved":false,"context_lines":[{"line_number":110,"context_line":"        ctx \u003d context.get_admin_context()"},{"line_number":111,"context_line":"        with self.port(name\u003d\u0027name\u0027) as port:"},{"line_number":112,"context_line":"            # emulating concurrent binding deletion"},{"line_number":113,"context_line":"            obj_port.PortBinding.get_object("},{"line_number":114,"context_line":"                ctx, port_id\u003dport[\u0027port\u0027][\u0027id\u0027]).delete()"},{"line_number":115,"context_line":"            self.assertIsNone("},{"line_number":116,"context_line":"                self.plugin.get_bound_port_context(ctx, port[\u0027port\u0027][\u0027id\u0027]))"}],"source_content_type":"text/x-python","patch_set":23,"id":"ba5201f7_c6ad949c","line":113,"updated":"2017-01-11 20:16:58.000000000","message":"there is delete_objects() for that matter","commit_id":"6ce05e18eede9f9799e8e67d7421f17d653ba5bc"},{"author":{"_account_id":17491,"name":"Lujin Luo","email":"luo.lujin@jp.fujitsu.com","username":"Lujin"},"change_message_id":"620a9c8d74f02d757b82a51c51e1225d94d3f9e9","unresolved":false,"context_lines":[{"line_number":110,"context_line":"        ctx \u003d context.get_admin_context()"},{"line_number":111,"context_line":"        with self.port(name\u003d\u0027name\u0027) as port:"},{"line_number":112,"context_line":"            # emulating concurrent binding deletion"},{"line_number":113,"context_line":"            obj_port.PortBinding.get_object("},{"line_number":114,"context_line":"                ctx, port_id\u003dport[\u0027port\u0027][\u0027id\u0027]).delete()"},{"line_number":115,"context_line":"            self.assertIsNone("},{"line_number":116,"context_line":"                self.plugin.get_bound_port_context(ctx, port[\u0027port\u0027][\u0027id\u0027]))"}],"source_content_type":"text/x-python","patch_set":23,"id":"7a3c09a3_82105c50","line":113,"in_reply_to":"ba5201f7_c6ad949c","updated":"2017-01-17 09:45:32.000000000","message":"Done","commit_id":"6ce05e18eede9f9799e8e67d7421f17d653ba5bc"}]}
