)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":4694,"name":"Miguel Lavalle","email":"miguel@mlavalle.com","username":"minsel"},"change_message_id":"1c540825bb72e2081e074d700000e2eab2765250","unresolved":false,"context_lines":[{"line_number":8,"context_line":"neutron/plugin/ml2/db.py"},{"line_number":9,"context_line":""},{"line_number":10,"context_line":"This patch integrates Port Binding Level OVO in get_binding_levels"},{"line_number":11,"context_line":"method in /plugin/ml2/db.py and introduces context for usuage in"},{"line_number":12,"context_line":"object operation."},{"line_number":13,"context_line":""},{"line_number":14,"context_line":"Change-Id: Ifa779f5f70a7502bd96b34d64a84d272af2a6886"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":6,"id":"1a95cdbc_e0ab7873","line":11,"range":{"start_line":11,"start_character":55,"end_line":11,"end_character":61},"updated":"2018-08-07 23:26:57.000000000","message":"usage","commit_id":"3d3a0f64924da2cdc881b77aacf853293098b7cb"},{"author":{"_account_id":4694,"name":"Miguel Lavalle","email":"miguel@mlavalle.com","username":"minsel"},"change_message_id":"029930af0e3a696afe40589292fbf494f3e8dc0d","unresolved":false,"context_lines":[{"line_number":8,"context_line":"neutron/plugin/ml2/db.py"},{"line_number":9,"context_line":""},{"line_number":10,"context_line":"This patch integrates Port Binding Level OVO in get_binding_levels"},{"line_number":11,"context_line":"method in /plugin/ml2/db.py and introduces context for usuage in"},{"line_number":12,"context_line":"object operation."},{"line_number":13,"context_line":""},{"line_number":14,"context_line":"Change-Id: Ifa779f5f70a7502bd96b34d64a84d272af2a6886"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":7,"id":"1a95cdbc_8842d666","line":11,"range":{"start_line":11,"start_character":55,"end_line":11,"end_character":61},"updated":"2016-10-06 22:51:35.000000000","message":"usage","commit_id":"79a256fc5bfcea9a9cff3ba1dd3b2c29bc8114f0"},{"author":{"_account_id":8726,"name":"Victor Morales","email":"chipahuac@hotmail.com","username":"electrocucaracha"},"change_message_id":"59d45ba3222bbe0e8e3f66c19534d2e5eac78527","unresolved":false,"context_lines":[{"line_number":4,"context_line":"Commit:     Shashank Kumar Shankar \u003cshashank.kumar.shankar@intel.com\u003e"},{"line_number":5,"context_line":"CommitDate: 2016-11-03 17:07:52 +0000"},{"line_number":6,"context_line":""},{"line_number":7,"context_line":"Integration of Port Binding Level OVO in /plugin/ml2/db.py"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"This patch integrates Port Binding Level OVO in /plugin/ml2/db.py"},{"line_number":10,"context_line":"and introduces context for usage in object operation."}],"source_content_type":"text/x-gerrit-commit-message","patch_set":22,"id":"9a629dbe_8c9e2eb7","line":7,"range":{"start_line":7,"start_character":0,"end_line":7,"end_character":58},"updated":"2016-11-11 01:42:31.000000000","message":"The title exceeds the maximum number of characters","commit_id":"3dcc9d78b8953311fa872e9ab2825289f84ab852"},{"author":{"_account_id":8726,"name":"Victor Morales","email":"chipahuac@hotmail.com","username":"electrocucaracha"},"change_message_id":"a3de06f2b36a0e4f959cb5cd3743e9eb5dd40ded","unresolved":false,"context_lines":[{"line_number":6,"context_line":""},{"line_number":7,"context_line":"Integration of Port Binding Level OVO"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"This patch integrates Port Binding Level OVO in /plugin/ml2/db.py"},{"line_number":10,"context_line":"and introduces context for usage in object operation."},{"line_number":11,"context_line":""},{"line_number":12,"context_line":"Change-Id: Ifa779f5f70a7502bd96b34d64a84d272af2a6886"},{"line_number":13,"context_line":"Partially-Implements: blueprint adopt-oslo-versioned-objects-for-db"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":25,"id":"5a74a57a_49173aed","line":10,"range":{"start_line":9,"start_character":0,"end_line":10,"end_character":53},"updated":"2016-11-30 15:52:42.000000000","message":"Can you mention that you have modified some methods to use context instead of session?","commit_id":"82df83d85021e6ef0fd42ba8060b0b7b4bec4fae"},{"author":{"_account_id":22774,"name":"Shashank Kumar Shankar","email":"shashank.kumar.shankar@intel.com","username":"skshankar"},"change_message_id":"f1bb3656b2def35a25347de90f792406d4e22ee6","unresolved":false,"context_lines":[{"line_number":6,"context_line":""},{"line_number":7,"context_line":"Integration of Port Binding Level OVO"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"This patch integrates Port Binding Level OVO in /plugin/ml2/db.py"},{"line_number":10,"context_line":"and introduces context for usage in object operation."},{"line_number":11,"context_line":""},{"line_number":12,"context_line":"Change-Id: Ifa779f5f70a7502bd96b34d64a84d272af2a6886"},{"line_number":13,"context_line":"Partially-Implements: blueprint adopt-oslo-versioned-objects-for-db"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":25,"id":"3a71b18c_7c6db431","line":10,"range":{"start_line":9,"start_character":0,"end_line":10,"end_character":53},"in_reply_to":"5a74a57a_49173aed","updated":"2016-12-01 16:22:04.000000000","message":"Done","commit_id":"82df83d85021e6ef0fd42ba8060b0b7b4bec4fae"},{"author":{"_account_id":8726,"name":"Victor Morales","email":"chipahuac@hotmail.com","username":"electrocucaracha"},"change_message_id":"0a7b3f7db8fe911ad9da47356a27c64203c198e1","unresolved":false,"context_lines":[{"line_number":7,"context_line":"Integration of Port Binding Level OVO"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"This patch integrates Port Binding Level OVO in /plugin/ml2/db.py"},{"line_number":10,"context_line":"and introduces context instead of session for usage in object"},{"line_number":11,"context_line":"operations."},{"line_number":12,"context_line":""},{"line_number":13,"context_line":"Change-Id: Ifa779f5f70a7502bd96b34d64a84d272af2a6886"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":26,"id":"3a71b18c_d90a9a25","line":10,"range":{"start_line":10,"start_character":15,"end_line":10,"end_character":41},"updated":"2016-12-06 18:25:00.000000000","message":"I\u0027m not sure if this patch should be split in two, one for bp/enginefacade-switch and the other for bp/adopt-oslo-versioned-objects-for-db or just add a tag here","commit_id":"8cc56aad623305091f432577ec3ccb2bf25417ff"}],"neutron/objects/network.py":[{"author":{"_account_id":6951,"name":"Brandon Logan","email":"brandon.logan@rackspace.com","username":"brandon-logan"},"change_message_id":"ac11b7448691f918c654a0cb058de465de4dd966","unresolved":false,"context_lines":[{"line_number":40,"context_line":"    fields \u003d {"},{"line_number":41,"context_line":"        \u0027id\u0027: obj_fields.UUIDField(),"},{"line_number":42,"context_line":"        \u0027network_id\u0027: obj_fields.UUIDField(),"},{"line_number":43,"context_line":"        \u0027name\u0027: obj_fields.StringField(nullable\u003dTrue),"},{"line_number":44,"context_line":"        \u0027network_type\u0027: obj_fields.StringField(),"},{"line_number":45,"context_line":"        \u0027physical_network\u0027: obj_fields.StringField(nullable\u003dTrue),"},{"line_number":46,"context_line":"        \u0027segmentation_id\u0027: obj_fields.IntegerField(nullable\u003dTrue),"}],"source_content_type":"text/x-python","patch_set":11,"id":"fa6399be_2a111d53","line":43,"updated":"2016-10-11 18:38:35.000000000","message":"this seems unrelated.  if so, it should be its own patch.","commit_id":"dd438113f7035be2706723eaa0247f939d29aead"},{"author":{"_account_id":4694,"name":"Miguel Lavalle","email":"miguel@mlavalle.com","username":"minsel"},"change_message_id":"d632befdfcf7d131c133c78f48e17c157a49643f","unresolved":false,"context_lines":[{"line_number":40,"context_line":"    fields \u003d {"},{"line_number":41,"context_line":"        \u0027id\u0027: obj_fields.UUIDField(),"},{"line_number":42,"context_line":"        \u0027network_id\u0027: obj_fields.UUIDField(),"},{"line_number":43,"context_line":"        \u0027name\u0027: obj_fields.StringField(nullable\u003dTrue),"},{"line_number":44,"context_line":"        \u0027network_type\u0027: obj_fields.StringField(),"},{"line_number":45,"context_line":"        \u0027physical_network\u0027: obj_fields.StringField(nullable\u003dTrue),"},{"line_number":46,"context_line":"        \u0027segmentation_id\u0027: obj_fields.IntegerField(nullable\u003dTrue),"}],"source_content_type":"text/x-python","patch_set":11,"id":"fa6399be_59562d2a","line":43,"in_reply_to":"fa6399be_2a111d53","updated":"2016-10-11 20:54:08.000000000","message":"I suggested this change. Please see my comment to https://review.openstack.org/#/c/382037/11/neutron/plugins/ml2/managers.py@807","commit_id":"dd438113f7035be2706723eaa0247f939d29aead"},{"author":{"_account_id":6951,"name":"Brandon Logan","email":"brandon.logan@rackspace.com","username":"brandon-logan"},"change_message_id":"f72830e8a39f8cb1791f1c69de17d7099400be8c","unresolved":false,"context_lines":[{"line_number":40,"context_line":"    fields \u003d {"},{"line_number":41,"context_line":"        \u0027id\u0027: obj_fields.UUIDField(),"},{"line_number":42,"context_line":"        \u0027network_id\u0027: obj_fields.UUIDField(),"},{"line_number":43,"context_line":"        \u0027name\u0027: obj_fields.StringField(nullable\u003dTrue),"},{"line_number":44,"context_line":"        \u0027network_type\u0027: obj_fields.StringField(),"},{"line_number":45,"context_line":"        \u0027physical_network\u0027: obj_fields.StringField(nullable\u003dTrue),"},{"line_number":46,"context_line":"        \u0027segmentation_id\u0027: obj_fields.IntegerField(nullable\u003dTrue),"}],"source_content_type":"text/x-python","patch_set":11,"id":"fa6399be_2410424e","line":43,"in_reply_to":"fa6399be_59562d2a","updated":"2016-10-12 16:49:27.000000000","message":"ah okay makes sense","commit_id":"dd438113f7035be2706723eaa0247f939d29aead"}],"neutron/objects/ports.py":[{"author":{"_account_id":4694,"name":"Miguel Lavalle","email":"miguel@mlavalle.com","username":"minsel"},"change_message_id":"f95e3fe108024e170bb907a4b95c9547f228e2e0","unresolved":false,"context_lines":[{"line_number":130,"context_line":"    }"},{"line_number":131,"context_line":""},{"line_number":132,"context_line":"    foreign_keys \u003d {"},{"line_number":133,"context_line":"        \u0027Port\u0027: {\u0027port_id\u0027: \u0027id\u0027}"},{"line_number":134,"context_line":"    }"},{"line_number":135,"context_line":""},{"line_number":136,"context_line":"    @classmethod"}],"source_content_type":"text/x-python","patch_set":16,"id":"fa6399be_4aa4eab8","line":133,"updated":"2016-10-15 01:48:46.000000000","message":"Here you need to add:\n\n\u0027NetworkSegment\u0027: {\u0027segment_id\u0027: \u0027id\u0027}","commit_id":"d5fc1a218cfd96eac57c3e5e624a42faf9cbfe10"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"change_message_id":"54e4cd7ece0045651d32709c39734eb1900e2c08","unresolved":false,"context_lines":[{"line_number":126,"context_line":"        \u0027host\u0027: obj_fields.StringField(),"},{"line_number":127,"context_line":"        \u0027level\u0027: obj_fields.IntegerField(),"},{"line_number":128,"context_line":"        \u0027driver\u0027: obj_fields.StringField(nullable\u003dTrue),"},{"line_number":129,"context_line":"        \u0027segment_id\u0027: obj_fields.UUIDField(nullable\u003dTrue)"},{"line_number":130,"context_line":"    }"},{"line_number":131,"context_line":""},{"line_number":132,"context_line":"    foreign_keys \u003d {"}],"source_content_type":"text/x-python","patch_set":17,"id":"fa6399be_a303c8bd","line":129,"updated":"2016-10-17 15:01:48.000000000","message":"you need to bump the object version number","commit_id":"1a82151ffe96d34c720c6627773972da91ff5cc6"},{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"69f2d93b5f0a1bcf4fa3e9931fe51c97a6c80f7f","unresolved":false,"context_lines":[{"line_number":126,"context_line":"        \u0027host\u0027: obj_fields.StringField(),"},{"line_number":127,"context_line":"        \u0027level\u0027: obj_fields.IntegerField(),"},{"line_number":128,"context_line":"        \u0027driver\u0027: obj_fields.StringField(nullable\u003dTrue),"},{"line_number":129,"context_line":"        \u0027segment_id\u0027: obj_fields.UUIDField(nullable\u003dTrue)"},{"line_number":130,"context_line":"    }"},{"line_number":131,"context_line":""},{"line_number":132,"context_line":"    foreign_keys \u003d {"}],"source_content_type":"text/x-python","patch_set":17,"id":"fa6399be_c1f79ff3","line":129,"in_reply_to":"fa6399be_2eaebfe7","updated":"2016-10-18 17:04:22.000000000","message":"garyk, not yet because Port object is not exposed on the wire. That said, I don\u0027t believe the change is needed.","commit_id":"1a82151ffe96d34c720c6627773972da91ff5cc6"},{"author":{"_account_id":22774,"name":"Shashank Kumar Shankar","email":"shashank.kumar.shankar@intel.com","username":"skshankar"},"change_message_id":"aca81763b1aca8b3a68be261cfe4588114d584c2","unresolved":false,"context_lines":[{"line_number":126,"context_line":"        \u0027host\u0027: obj_fields.StringField(),"},{"line_number":127,"context_line":"        \u0027level\u0027: obj_fields.IntegerField(),"},{"line_number":128,"context_line":"        \u0027driver\u0027: obj_fields.StringField(nullable\u003dTrue),"},{"line_number":129,"context_line":"        \u0027segment_id\u0027: obj_fields.UUIDField(nullable\u003dTrue)"},{"line_number":130,"context_line":"    }"},{"line_number":131,"context_line":""},{"line_number":132,"context_line":"    foreign_keys \u003d {"}],"source_content_type":"text/x-python","patch_set":17,"id":"fa6399be_2eaebfe7","line":129,"in_reply_to":"fa6399be_a303c8bd","updated":"2016-10-17 16:46:12.000000000","message":"Thanks for the review. It is done here: https://review.openstack.org/#/c/382037/17/neutron/tests/unit/objects/test_objects.py@43","commit_id":"1a82151ffe96d34c720c6627773972da91ff5cc6"},{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"e68b882ca7fdd6acc870df1ddaf10ec72bc822e3","unresolved":false,"context_lines":[{"line_number":126,"context_line":"        \u0027host\u0027: obj_fields.StringField(),"},{"line_number":127,"context_line":"        \u0027level\u0027: obj_fields.IntegerField(),"},{"line_number":128,"context_line":"        \u0027driver\u0027: obj_fields.StringField(nullable\u003dTrue),"},{"line_number":129,"context_line":"        \u0027segment_id\u0027: obj_fields.UUIDField(nullable\u003dTrue)"},{"line_number":130,"context_line":"    }"},{"line_number":131,"context_line":""},{"line_number":132,"context_line":"    foreign_keys \u003d {"}],"source_content_type":"text/x-python","patch_set":19,"id":"fa6399be_ce242eb1","line":129,"updated":"2016-10-18 17:03:34.000000000","message":"why the change? We want that field to be object based, so that Port pulling binding_levels gets full segment info filled in.\n\nThat will of course require some changes to ml2\u0027s driver_context.PortContext to accommodate for the fact that levels don\u0027t have segment_id but segment.id now.","commit_id":"1fe78f1b808363b990242dbfa2286a7185449bde"},{"author":{"_account_id":6951,"name":"Brandon Logan","email":"brandon.logan@rackspace.com","username":"brandon-logan"},"change_message_id":"fbc1927090695f79c55ad6714bae737f26939511","unresolved":false,"context_lines":[{"line_number":126,"context_line":"        \u0027host\u0027: obj_fields.StringField(),"},{"line_number":127,"context_line":"        \u0027level\u0027: obj_fields.IntegerField(),"},{"line_number":128,"context_line":"        \u0027driver\u0027: obj_fields.StringField(nullable\u003dTrue),"},{"line_number":129,"context_line":"        \u0027segment_id\u0027: obj_fields.UUIDField(nullable\u003dTrue)"},{"line_number":130,"context_line":"    }"},{"line_number":131,"context_line":""},{"line_number":132,"context_line":"    foreign_keys \u003d {"}],"source_content_type":"text/x-python","patch_set":19,"id":"fa6399be_7695b03e","line":129,"in_reply_to":"fa6399be_ce242eb1","updated":"2016-10-18 21:55:59.000000000","message":"Out of curiousity, what makes this object special to warrant it to populate an entire subobject when the model only does segment_id as well? For example, why not populate the port that port_id corresponds to as well?","commit_id":"1fe78f1b808363b990242dbfa2286a7185449bde"},{"author":{"_account_id":22774,"name":"Shashank Kumar Shankar","email":"shashank.kumar.shankar@intel.com","username":"skshankar"},"change_message_id":"f347e5c24e6b8b5aa37bfd1572e16f03aaeed12b","unresolved":false,"context_lines":[{"line_number":126,"context_line":"        \u0027host\u0027: obj_fields.StringField(),"},{"line_number":127,"context_line":"        \u0027level\u0027: obj_fields.IntegerField(),"},{"line_number":128,"context_line":"        \u0027driver\u0027: obj_fields.StringField(nullable\u003dTrue),"},{"line_number":129,"context_line":"        \u0027segment_id\u0027: obj_fields.UUIDField(nullable\u003dTrue)"},{"line_number":130,"context_line":"    }"},{"line_number":131,"context_line":""},{"line_number":132,"context_line":"    foreign_keys \u003d {"}],"source_content_type":"text/x-python","patch_set":19,"id":"fa6399be_1cec9528","line":129,"in_reply_to":"fa6399be_ce242eb1","updated":"2016-10-18 22:57:59.000000000","message":"Since it is the model [1], I was running into errors at the creation [2] as the synthetic field inside the level object was getting set to None. \n\n[1] - https://github.com/openstack/neutron/blob/90eaf71ba140d9a48d96375f4865f8b89568a147/neutron/plugins/ml2/models.py#L76\n[2] - https://review.openstack.org/#/c/382037/20/neutron/plugins/ml2/db.py@105","commit_id":"1fe78f1b808363b990242dbfa2286a7185449bde"},{"author":{"_account_id":15518,"name":"Artur Korzeniewski","email":"artur.korzen@wp.pl","username":"akorzeni"},"change_message_id":"00ae12c37911684d45b3081b3486572bc8c62f6e","unresolved":false,"context_lines":[{"line_number":121,"context_line":""},{"line_number":122,"context_line":"    foreign_keys \u003d {"},{"line_number":123,"context_line":"        \u0027Port\u0027: {\u0027port_id\u0027: \u0027id\u0027},"},{"line_number":124,"context_line":"        \u0027NetworkSegment\u0027: {\u0027segment_id\u0027: \u0027id\u0027}"},{"line_number":125,"context_line":"    }"},{"line_number":126,"context_line":""},{"line_number":127,"context_line":"    @classmethod"}],"source_content_type":"text/x-python","patch_set":23,"id":"5a74a57a_d174f1fe","line":124,"range":{"start_line":124,"start_character":8,"end_line":124,"end_character":46},"updated":"2016-11-23 14:20:57.000000000","message":"I\u0027m wondering where this is used?","commit_id":"fbdbd0d47f48de9db9ccb4f4c230cd090ae3c954"},{"author":{"_account_id":22774,"name":"Shashank Kumar Shankar","email":"shashank.kumar.shankar@intel.com","username":"skshankar"},"change_message_id":"fff6e26320e237f9976efa56ab41ee662d666c36","unresolved":false,"context_lines":[{"line_number":121,"context_line":""},{"line_number":122,"context_line":"    foreign_keys \u003d {"},{"line_number":123,"context_line":"        \u0027Port\u0027: {\u0027port_id\u0027: \u0027id\u0027},"},{"line_number":124,"context_line":"        \u0027NetworkSegment\u0027: {\u0027segment_id\u0027: \u0027id\u0027}"},{"line_number":125,"context_line":"    }"},{"line_number":126,"context_line":""},{"line_number":127,"context_line":"    @classmethod"}],"source_content_type":"text/x-python","patch_set":23,"id":"5a74a57a_db2fa29f","line":124,"range":{"start_line":124,"start_character":8,"end_line":124,"end_character":46},"in_reply_to":"5a74a57a_d174f1fe","updated":"2016-11-23 17:38:11.000000000","message":"Done. Removed.","commit_id":"fbdbd0d47f48de9db9ccb4f4c230cd090ae3c954"},{"author":{"_account_id":15518,"name":"Artur Korzeniewski","email":"artur.korzen@wp.pl","username":"akorzeni"},"change_message_id":"23c032fac55dd490bfd2e718b4e9514e12f8b350","unresolved":false,"context_lines":[{"line_number":326,"context_line":"        )"},{"line_number":327,"context_line":""},{"line_number":328,"context_line":"    @classmethod"},{"line_number":329,"context_line":"    def get_ports_filter_by_segment_id(cls, context, segment_id):"},{"line_number":330,"context_line":"        query \u003d context.session.query(models_v2.Port)"},{"line_number":331,"context_line":"        query \u003d query.join("},{"line_number":332,"context_line":"            ml2_models.PortBindingLevel,"}],"source_content_type":"text/x-python","patch_set":24,"id":"5a74a57a_9285f2ae","line":329,"range":{"start_line":329,"start_character":8,"end_line":329,"end_character":17},"updated":"2016-11-24 08:08:18.000000000","message":"if you are returning the port IDs, then the method should be called get_port_ids_filter_by_segment_id.","commit_id":"d39c8f192688ad9ce1cc2778e7c605e1236f3a2c"},{"author":{"_account_id":8726,"name":"Victor Morales","email":"chipahuac@hotmail.com","username":"electrocucaracha"},"change_message_id":"a3de06f2b36a0e4f959cb5cd3743e9eb5dd40ded","unresolved":false,"context_lines":[{"line_number":333,"context_line":"            ml2_models.PortBindingLevel.port_id \u003d\u003d models_v2.Port.id)"},{"line_number":334,"context_line":"        query \u003d query.filter("},{"line_number":335,"context_line":"            ml2_models.PortBindingLevel.segment_id \u003d\u003d segment_id)"},{"line_number":336,"context_line":"        port_ids \u003d [p.id for p in query]"},{"line_number":337,"context_line":"        return port_ids"},{"line_number":338,"context_line":""},{"line_number":339,"context_line":"    # TODO(rossella_s): get rid of it once we switch the db model to using"},{"line_number":340,"context_line":"    # custom types."}],"source_content_type":"text/x-python","patch_set":25,"id":"5a74a57a_53736d4d","line":337,"range":{"start_line":336,"start_character":8,"end_line":337,"end_character":23},"updated":"2016-11-30 15:52:42.000000000","message":"nit: you don\u0027t have to create a variable to return this value\n\n        return [p.id for p in query]","commit_id":"82df83d85021e6ef0fd42ba8060b0b7b4bec4fae"},{"author":{"_account_id":22774,"name":"Shashank Kumar Shankar","email":"shashank.kumar.shankar@intel.com","username":"skshankar"},"change_message_id":"f1bb3656b2def35a25347de90f792406d4e22ee6","unresolved":false,"context_lines":[{"line_number":333,"context_line":"            ml2_models.PortBindingLevel.port_id \u003d\u003d models_v2.Port.id)"},{"line_number":334,"context_line":"        query \u003d query.filter("},{"line_number":335,"context_line":"            ml2_models.PortBindingLevel.segment_id \u003d\u003d segment_id)"},{"line_number":336,"context_line":"        port_ids \u003d [p.id for p in query]"},{"line_number":337,"context_line":"        return port_ids"},{"line_number":338,"context_line":""},{"line_number":339,"context_line":"    # TODO(rossella_s): get rid of it once we switch the db model to using"},{"line_number":340,"context_line":"    # custom types."}],"source_content_type":"text/x-python","patch_set":25,"id":"3a71b18c_9c237005","line":337,"range":{"start_line":336,"start_character":8,"end_line":337,"end_character":23},"in_reply_to":"5a74a57a_53736d4d","updated":"2016-12-01 16:22:04.000000000","message":"Done","commit_id":"82df83d85021e6ef0fd42ba8060b0b7b4bec4fae"},{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"2934884b8a7ef931bec54b9dce14da010484dd38","unresolved":false,"context_lines":[{"line_number":114,"context_line":"        \u0027segment\u0027: obj_fields.ObjectField("},{"line_number":115,"context_line":"            \u0027NetworkSegment\u0027, nullable\u003dTrue"},{"line_number":116,"context_line":"        ),"},{"line_number":117,"context_line":"        \u0027segment_id\u0027: obj_fields.UUIDField(),"},{"line_number":118,"context_line":"    }"},{"line_number":119,"context_line":""},{"line_number":120,"context_line":"    synthetic_fields \u003d [\u0027segment\u0027]"}],"source_content_type":"text/x-python","patch_set":26,"id":"3a71b18c_bc180977","line":117,"updated":"2016-12-08 15:07:20.000000000","message":"how is it different from .segment.id? I understand that it allows you to avoid modification of PortContext in ml2, but I don\u0027t think it\u0027s a reason to duplicate data in the object. binding level.segment_id embedded in PortContext is not part of public API so it should be fine to change ml2 definition.","commit_id":"8cc56aad623305091f432577ec3ccb2bf25417ff"},{"author":{"_account_id":22774,"name":"Shashank Kumar Shankar","email":"shashank.kumar.shankar@intel.com","username":"skshankar"},"change_message_id":"908a3f7dba870ba3451d7ccfd92c527c09cd425e","unresolved":false,"context_lines":[{"line_number":114,"context_line":"        \u0027segment\u0027: obj_fields.ObjectField("},{"line_number":115,"context_line":"            \u0027NetworkSegment\u0027, nullable\u003dTrue"},{"line_number":116,"context_line":"        ),"},{"line_number":117,"context_line":"        \u0027segment_id\u0027: obj_fields.UUIDField(),"},{"line_number":118,"context_line":"    }"},{"line_number":119,"context_line":""},{"line_number":120,"context_line":"    synthetic_fields \u003d [\u0027segment\u0027]"}],"source_content_type":"text/x-python","patch_set":26,"id":"3a71b18c_b2bf45fb","line":117,"in_reply_to":"3a71b18c_bc180977","updated":"2016-12-08 19:23:59.000000000","message":"This was added because the synthetic field is not created during create object called on portbinding level object. I have added a stack trace here: [1]. It works fine if a new field segment_id is added. Should we keep the segment_id to pass tests? Please let me know how to proceed. \n\n[1] - http://paste.openstack.org/raw/591839/","commit_id":"8cc56aad623305091f432577ec3ccb2bf25417ff"},{"author":{"_account_id":15518,"name":"Artur Korzeniewski","email":"artur.korzen@wp.pl","username":"akorzeni"},"change_message_id":"aed43c6c6d7b5a10b597924a9fbca0d810b47930","unresolved":false,"context_lines":[{"line_number":114,"context_line":"        \u0027segment\u0027: obj_fields.ObjectField("},{"line_number":115,"context_line":"            \u0027NetworkSegment\u0027, nullable\u003dTrue"},{"line_number":116,"context_line":"        ),"},{"line_number":117,"context_line":"        \u0027segment_id\u0027: common_types.UUIDField(),"},{"line_number":118,"context_line":"    }"},{"line_number":119,"context_line":""},{"line_number":120,"context_line":"    synthetic_fields \u003d [\u0027segment\u0027]"}],"source_content_type":"text/x-python","patch_set":31,"id":"ba5201f7_d413d35a","line":117,"updated":"2017-01-03 08:31:27.000000000","message":"As I have understood the previous reviews, we have to drop the extra segment_id and overwrite the create/update methods for level object to update the NetworkSegment fields accordingly in DB.","commit_id":"6446ffe128bee1bd95c4c5197109375919873b00"},{"author":{"_account_id":15518,"name":"Artur Korzeniewski","email":"artur.korzen@wp.pl","username":"akorzeni"},"change_message_id":"2c5b99f406f0bf28bdb70c5c1ca233680fa1fe19","unresolved":false,"context_lines":[{"line_number":114,"context_line":"        \u0027segment\u0027: obj_fields.ObjectField("},{"line_number":115,"context_line":"            \u0027NetworkSegment\u0027, nullable\u003dTrue"},{"line_number":116,"context_line":"        ),"},{"line_number":117,"context_line":"        \u0027segment_id\u0027: common_types.UUIDField(),"},{"line_number":118,"context_line":"    }"},{"line_number":119,"context_line":""},{"line_number":120,"context_line":"    synthetic_fields \u003d [\u0027segment\u0027]"}],"source_content_type":"text/x-python","patch_set":31,"id":"ba5201f7_e0d000cc","line":117,"in_reply_to":"ba5201f7_620f5488","updated":"2017-01-10 18:14:37.000000000","message":"As segment being synthetic field, we can compute it at runtime, no need to point at any field in object.\n\nFrom PortBindingLevel object, we are not able to create network_segment, what we should do, is to try to load the network_segment while create/update.\n\nWhen trying to save the data, you have to get the segment object and extract the segment_id and then save - in modify_fields_to_db.\n\nI guess that removing segment_id as field is quite complicating the operations on PortBindingLevel object...\n\nYou can upload your changes and I can take a look what is failing.","commit_id":"6446ffe128bee1bd95c4c5197109375919873b00"},{"author":{"_account_id":22774,"name":"Shashank Kumar Shankar","email":"shashank.kumar.shankar@intel.com","username":"skshankar"},"change_message_id":"594af2507ebcd4b57c1fce03128170e5f4908093","unresolved":false,"context_lines":[{"line_number":114,"context_line":"        \u0027segment\u0027: obj_fields.ObjectField("},{"line_number":115,"context_line":"            \u0027NetworkSegment\u0027, nullable\u003dTrue"},{"line_number":116,"context_line":"        ),"},{"line_number":117,"context_line":"        \u0027segment_id\u0027: common_types.UUIDField(),"},{"line_number":118,"context_line":"    }"},{"line_number":119,"context_line":""},{"line_number":120,"context_line":"    synthetic_fields \u003d [\u0027segment\u0027]"}],"source_content_type":"text/x-python","patch_set":31,"id":"ba5201f7_620f5488","line":117,"in_reply_to":"ba5201f7_6f4fb492","updated":"2017-01-05 20:50:02.000000000","message":"I have a question regarding this. Usually in foreign key-synthetic fields relation, the foreign key in the synthetic field references back to a field which is present in the outside object loading the synthetic field. Here, we are side loading NetworkSegment object. But in the NetworkSegment object, it is referring to segment_id [1] due to the foreign key present in the model [2]. So if we remove this segment_id, the NetworkSegment object inside the PortBinding Level object is not created. \n\nIn other examples involving foreign key and synthetic key relations, we see that synthetic field refers to a field which is present as a normal field in the outer object. Example: In ports object, allowed address pairs is a synthetic field [3]. And in the allowed address pairs object it has a foreign key reference to \u0027id\u0027 field of port object. [4]. Applying the same to level and segment objects, if we remove the segment_id, which field should the foreign_key refer back to? port_id? I tried this locally and it still fails to create the segment object. Is it because the model still has segment_id [5] and we are referencing to port_id instead? I am not sure how to override create/update to take this into account. Let me know if I am thinking correctly. \n\n\n[1] - https://github.com/openstack/neutron/blob/master/neutron/objects/network.py#L53\n[2] - https://github.com/openstack/neutron/blob/master/neutron/plugins/ml2/models.py#L76\n[3] - https://github.com/openstack/neutron/blob/master/neutron/objects/ports.py#L253\n[4] - https://github.com/openstack/neutron/blob/master/neutron/objects/port/extensions/allowedaddresspairs.py#L37\n[5] - https://github.com/openstack/neutron/blob/master/neutron/plugins/ml2/models.py#L76","commit_id":"6446ffe128bee1bd95c4c5197109375919873b00"},{"author":{"_account_id":15518,"name":"Artur Korzeniewski","email":"artur.korzen@wp.pl","username":"akorzeni"},"change_message_id":"0253d5cbf3a502fed5d6448fa69c10070eb23e02","unresolved":false,"context_lines":[{"line_number":114,"context_line":"        \u0027segment\u0027: obj_fields.ObjectField("},{"line_number":115,"context_line":"            \u0027NetworkSegment\u0027, nullable\u003dTrue"},{"line_number":116,"context_line":"        ),"},{"line_number":117,"context_line":"        \u0027segment_id\u0027: common_types.UUIDField(),"},{"line_number":118,"context_line":"    }"},{"line_number":119,"context_line":""},{"line_number":120,"context_line":"    synthetic_fields \u003d [\u0027segment\u0027]"}],"source_content_type":"text/x-python","patch_set":31,"id":"ba5201f7_6f4fb492","line":117,"in_reply_to":"ba5201f7_d413d35a","updated":"2017-01-03 09:46:14.000000000","message":"To be more precise, we need to drop the segment_id in object and take care of translation between segment.id to segment_id when storing the data in DB. \nSo beside overriding the create/update, we need to override the modify_fields_(to|from)_db.","commit_id":"6446ffe128bee1bd95c4c5197109375919873b00"},{"author":{"_account_id":22774,"name":"Shashank Kumar Shankar","email":"shashank.kumar.shankar@intel.com","username":"skshankar"},"change_message_id":"f541bc54cd95a8b3837a27713ca744be13d9f196","unresolved":false,"context_lines":[{"line_number":114,"context_line":"        \u0027segment\u0027: obj_fields.ObjectField("},{"line_number":115,"context_line":"            \u0027NetworkSegment\u0027, nullable\u003dTrue"},{"line_number":116,"context_line":"        ),"},{"line_number":117,"context_line":"        \u0027segment_id\u0027: common_types.UUIDField(),"},{"line_number":118,"context_line":"    }"},{"line_number":119,"context_line":""},{"line_number":120,"context_line":"    synthetic_fields \u003d [\u0027segment\u0027]"}],"source_content_type":"text/x-python","patch_set":31,"id":"ba5201f7_3a2cc101","line":117,"in_reply_to":"ba5201f7_e0d000cc","updated":"2017-01-11 19:36:55.000000000","message":"Since the complete integration of Port Binding Level is completed in this patch and the tests pass correctly with the NetworkSegment synthetic field removed, I do not see a need to have a synthetic field for NetworkSegment since it is not specifically required in the integration. So we decided to remove it and make the Port Binding Level object simpler. Let me know your thoughts.","commit_id":"6446ffe128bee1bd95c4c5197109375919873b00"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"change_message_id":"636d592fc378041aacc6d23ebd7b73bd4443723b","unresolved":false,"context_lines":[{"line_number":327,"context_line":"            ml2_models.PortBindingLevel,"},{"line_number":328,"context_line":"            ml2_models.PortBindingLevel.port_id \u003d\u003d models_v2.Port.id)"},{"line_number":329,"context_line":"        query \u003d query.filter("},{"line_number":330,"context_line":"            ml2_models.PortBindingLevel.segment_id \u003d\u003d segment_id)"},{"line_number":331,"context_line":"        return [p.id for p in query]"},{"line_number":332,"context_line":""},{"line_number":333,"context_line":"    # TODO(rossella_s): get rid of it once we switch the db model to using"}],"source_content_type":"text/x-python","patch_set":32,"id":"ba5201f7_75ce5a2e","line":330,"range":{"start_line":330,"start_character":12,"end_line":330,"end_character":50},"updated":"2017-01-11 16:26:52.000000000","message":"i do not think that we should have ml2 code in generic object data.","commit_id":"79392779e8424e3b9baaa49ba74c98912b5b341e"},{"author":{"_account_id":22774,"name":"Shashank Kumar Shankar","email":"shashank.kumar.shankar@intel.com","username":"skshankar"},"change_message_id":"6071978f6b3bd9f034bbdfa4047956617fc9fa5d","unresolved":false,"context_lines":[{"line_number":327,"context_line":"            ml2_models.PortBindingLevel,"},{"line_number":328,"context_line":"            ml2_models.PortBindingLevel.port_id \u003d\u003d models_v2.Port.id)"},{"line_number":329,"context_line":"        query \u003d query.filter("},{"line_number":330,"context_line":"            ml2_models.PortBindingLevel.segment_id \u003d\u003d segment_id)"},{"line_number":331,"context_line":"        return [p.id for p in query]"},{"line_number":332,"context_line":""},{"line_number":333,"context_line":"    # TODO(rossella_s): get rid of it once we switch the db model to using"}],"source_content_type":"text/x-python","patch_set":32,"id":"ba5201f7_56d15956","line":330,"range":{"start_line":330,"start_character":12,"end_line":330,"end_character":50},"in_reply_to":"ba5201f7_75ce5a2e","updated":"2017-01-11 17:51:18.000000000","message":"This was moved here to keep SQLAlchemy querying with joins in the OVO definitions itself. Since we anyway have to use ml2 model in line 105, we moved the querying here.","commit_id":"79392779e8424e3b9baaa49ba74c98912b5b341e"},{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"1b370b5864ba8d1de53abca3279e448dccf86c53","unresolved":false,"context_lines":[{"line_number":118,"context_line":"        \u0027host\u0027: obj_fields.StringField(),"},{"line_number":119,"context_line":"        \u0027level\u0027: obj_fields.IntegerField(),"},{"line_number":120,"context_line":"        \u0027driver\u0027: obj_fields.StringField(nullable\u003dTrue),"},{"line_number":121,"context_line":"        \u0027segment_id\u0027: common_types.UUIDField(),"},{"line_number":122,"context_line":"    }"},{"line_number":123,"context_line":""},{"line_number":124,"context_line":"    foreign_keys \u003d {"}],"source_content_type":"text/x-python","patch_set":38,"id":"3a461143_1d4d183e","line":121,"updated":"2017-01-30 14:23:24.000000000","message":"I was asked to describe why I believe it\u0027s important to keep full segment info in the level object.\n\nThe level object is included into port object to provide information on hierarchical bindings. Originally, I wanted to make it so that pulling a port will give the consumer all the needed information to bind the port, including segmentation info. If we replace segment object here with its ID, then there should be another data fetch from the server to get segmentation information, which is against the goal of push-notifications.","commit_id":"93b90e16a2060488db99e4fcb511689c4b0c395e"},{"author":{"_account_id":22774,"name":"Shashank Kumar Shankar","email":"shashank.kumar.shankar@intel.com","username":"skshankar"},"change_message_id":"0b72fd847847dc3205146cc6a7f498dc8d518f37","unresolved":false,"context_lines":[{"line_number":118,"context_line":"        \u0027host\u0027: obj_fields.StringField(),"},{"line_number":119,"context_line":"        \u0027level\u0027: obj_fields.IntegerField(),"},{"line_number":120,"context_line":"        \u0027driver\u0027: obj_fields.StringField(nullable\u003dTrue),"},{"line_number":121,"context_line":"        \u0027segment_id\u0027: common_types.UUIDField(),"},{"line_number":122,"context_line":"    }"},{"line_number":123,"context_line":""},{"line_number":124,"context_line":"    foreign_keys \u003d {"}],"source_content_type":"text/x-python","patch_set":38,"id":"3a461143_9243ae41","line":121,"in_reply_to":"3a461143_1d4d183e","updated":"2017-01-30 16:31:20.000000000","message":"So, the synthetic field is to be used to load segment info in port context used in push notifications. And, to create the NetworkSegment obj we will need the segment_id in level object for foreign key reference. \n\n\nHence can we infer that we need both the segment_id and the segment object? The former to satisfy foreign key constraints and the latter for push notifications.","commit_id":"93b90e16a2060488db99e4fcb511689c4b0c395e"},{"author":{"_account_id":1131,"name":"Brian Haley","email":"haleyb.dev@gmail.com","username":"brian-haley"},"change_message_id":"416c0ffc61eeb47555039d1b5a983d6ebf279b16","unresolved":false,"context_lines":[{"line_number":409,"context_line":""},{"line_number":410,"context_line":"    @classmethod"},{"line_number":411,"context_line":"    def get_port_ids_filter_by_segment_id(cls, context, segment_id):"},{"line_number":412,"context_line":"        query \u003d context.session.query(models_v2.Port)"},{"line_number":413,"context_line":"        query \u003d query.join("},{"line_number":414,"context_line":"            ml2_models.PortBindingLevel,"},{"line_number":415,"context_line":"            ml2_models.PortBindingLevel.port_id \u003d\u003d models_v2.Port.id)"}],"source_content_type":"text/x-python","patch_set":71,"id":"3f79a3b5_abea280b","line":412,"range":{"start_line":412,"start_character":48,"end_line":412,"end_character":52},"updated":"2018-08-31 15:40:56.000000000","message":"I don\u0027t want to stop progress here, but after looking at https://review.openstack.org/#/c/592361/ can this be Port.id  to only fetch that column?","commit_id":"6fdd6a7008bf122ca4136d4c73f2c92a68e13b67"},{"author":{"_account_id":17120,"name":"Manjeet Singh Bhatia","email":"manjeet.s.bhatia@intel.com","username":"manjeets"},"change_message_id":"c22581941166706d712f51904358a6a6bfda1f57","unresolved":false,"context_lines":[{"line_number":409,"context_line":""},{"line_number":410,"context_line":"    @classmethod"},{"line_number":411,"context_line":"    def get_port_ids_filter_by_segment_id(cls, context, segment_id):"},{"line_number":412,"context_line":"        query \u003d context.session.query(models_v2.Port)"},{"line_number":413,"context_line":"        query \u003d query.join("},{"line_number":414,"context_line":"            ml2_models.PortBindingLevel,"},{"line_number":415,"context_line":"            ml2_models.PortBindingLevel.port_id \u003d\u003d models_v2.Port.id)"}],"source_content_type":"text/x-python","patch_set":71,"id":"3f79a3b5_eebeeeac","line":412,"range":{"start_line":412,"start_character":48,"end_line":412,"end_character":52},"in_reply_to":"3f79a3b5_0e96ca95","updated":"2018-08-31 15:50:28.000000000","message":"makes sense to keep it same as it was.","commit_id":"6fdd6a7008bf122ca4136d4c73f2c92a68e13b67"},{"author":{"_account_id":11604,"name":"sean mooney","email":"smooney@redhat.com","username":"sean-k-mooney"},"change_message_id":"6229e6eeb6c8c60396882d96db2b031ffc926e80","unresolved":false,"context_lines":[{"line_number":409,"context_line":""},{"line_number":410,"context_line":"    @classmethod"},{"line_number":411,"context_line":"    def get_port_ids_filter_by_segment_id(cls, context, segment_id):"},{"line_number":412,"context_line":"        query \u003d context.session.query(models_v2.Port)"},{"line_number":413,"context_line":"        query \u003d query.join("},{"line_number":414,"context_line":"            ml2_models.PortBindingLevel,"},{"line_number":415,"context_line":"            ml2_models.PortBindingLevel.port_id \u003d\u003d models_v2.Port.id)"}],"source_content_type":"text/x-python","patch_set":71,"id":"3f79a3b5_0e96ca95","line":412,"range":{"start_line":412,"start_character":48,"end_line":412,"end_character":52},"in_reply_to":"3f79a3b5_abea280b","updated":"2018-08-31 15:48:07.000000000","message":"the previous code on lline 325 of \nhttps://review.openstack.org/#/c/382037/71/neutron/plugins/ml2/db.py\ndid use port.id in the inital query\nquery \u003d context.session.query(models_v2.Port.id)\n        query \u003d query.join(\n            models.PortBindingLevel,\n            models.PortBindingLevel.port_id \u003d\u003d models_v2.Port.id)\n        query \u003d query.filter(models.PortBindingLevel.segment_id \u003d\u003d segment_id)\n        port_ids \u003d [p.id for p in query]\n\nthe rest of this look identical so i guess this was\nan unitneded change","commit_id":"6fdd6a7008bf122ca4136d4c73f2c92a68e13b67"},{"author":{"_account_id":11975,"name":"Slawek Kaplonski","email":"skaplons@redhat.com","username":"slaweq"},"change_message_id":"b4ade0cecb17d745cdd29f5169c4e0be41d83f70","unresolved":false,"context_lines":[{"line_number":409,"context_line":""},{"line_number":410,"context_line":"    @classmethod"},{"line_number":411,"context_line":"    def get_port_ids_filter_by_segment_id(cls, context, segment_id):"},{"line_number":412,"context_line":"        query \u003d context.session.query(models_v2.Port)"},{"line_number":413,"context_line":"        query \u003d query.join("},{"line_number":414,"context_line":"            ml2_models.PortBindingLevel,"},{"line_number":415,"context_line":"            ml2_models.PortBindingLevel.port_id \u003d\u003d models_v2.Port.id)"}],"source_content_type":"text/x-python","patch_set":71,"id":"3f79a3b5_aa7534ce","line":412,"range":{"start_line":412,"start_character":48,"end_line":412,"end_character":52},"in_reply_to":"3f79a3b5_eebeeeac","updated":"2018-09-01 08:26:55.000000000","message":"Done","commit_id":"6fdd6a7008bf122ca4136d4c73f2c92a68e13b67"},{"author":{"_account_id":841,"name":"Akihiro Motoki","email":"amotoki@gmail.com","username":"amotoki"},"change_message_id":"e28127010a3b0ebc221e1d711a754b8ea932ac5d","unresolved":false,"context_lines":[{"line_number":408,"context_line":"                                            **kwargs)"},{"line_number":409,"context_line":""},{"line_number":410,"context_line":"    @classmethod"},{"line_number":411,"context_line":"    def get_port_ids_filter_by_segment_id(cls, context, segment_id):"},{"line_number":412,"context_line":"        query \u003d context.session.query(models_v2.Port.id)"},{"line_number":413,"context_line":"        query \u003d query.join("},{"line_number":414,"context_line":"            ml2_models.PortBindingLevel,"}],"source_content_type":"text/x-python","patch_set":74,"id":"3f79a3b5_98683c88","line":411,"range":{"start_line":411,"start_character":8,"end_line":411,"end_character":41},"updated":"2018-09-21 16:59:23.000000000","message":"(Although it is approved) this is a method of the port object, so \"port\" in the method is unnecessary. \"get_ids_filter_by_segment_id\" looks better.","commit_id":"cfec395b8f00e9aff8cc3a370a3cda1a66cd2af3"}],"neutron/plugins/ml2/db.py":[{"author":{"_account_id":22218,"name":"Sindhu Devale","email":"sindhu.devale@intel.com","username":"sindhudevale"},"change_message_id":"d626a747a29702e361284045da9995656d795e03","unresolved":false,"context_lines":[{"line_number":112,"context_line":""},{"line_number":113,"context_line":""},{"line_number":114,"context_line":"def get_binding_levels(context, port_id, host):"},{"line_number":115,"context_line":"    port_bl_objs \u003d ports.PortBindingLevel.get_objects("},{"line_number":116,"context_line":"        context, port_id\u003dport_id, host\u003dhost)"},{"line_number":117,"context_line":"    result \u003d port_bl_objs.sort(key\u003dlambda x: x.level)"},{"line_number":118,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"1a95cdbc_e2c68e15","line":115,"updated":"2016-10-04 21:22:11.000000000","message":"why did u remove `if host:`?","commit_id":"b141021143bca5ad063a46e7d218c60d87b2b541"},{"author":{"_account_id":22774,"name":"Shashank Kumar Shankar","email":"shashank.kumar.shankar@intel.com","username":"skshankar"},"change_message_id":"2b684ce59838dedca1b73309399c1aeea6704e14","unresolved":false,"context_lines":[{"line_number":112,"context_line":""},{"line_number":113,"context_line":""},{"line_number":114,"context_line":"def get_binding_levels(context, port_id, host):"},{"line_number":115,"context_line":"    port_bl_objs \u003d ports.PortBindingLevel.get_objects("},{"line_number":116,"context_line":"        context, port_id\u003dport_id, host\u003dhost)"},{"line_number":117,"context_line":"    result \u003d port_bl_objs.sort(key\u003dlambda x: x.level)"},{"line_number":118,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"1a95cdbc_5909f42b","line":115,"in_reply_to":"1a95cdbc_e2c68e15","updated":"2016-10-04 21:45:33.000000000","message":"Thanks for looking. :) Missed that somehow.","commit_id":"b141021143bca5ad063a46e7d218c60d87b2b541"},{"author":{"_account_id":4694,"name":"Miguel Lavalle","email":"miguel@mlavalle.com","username":"minsel"},"change_message_id":"9ec3a58dd32a6414e162a6e86471b7f624a78d75","unresolved":false,"context_lines":[{"line_number":116,"context_line":"    if host:"},{"line_number":117,"context_line":"        port_bl_objs \u003d ports.PortBindingLevel.get_objects("},{"line_number":118,"context_line":"            context, port_id\u003dport_id, host\u003dhost)"},{"line_number":119,"context_line":"        port_bl_objs.sort(key\u003doperator.attrgetter(\u0027level\u0027))"},{"line_number":120,"context_line":"        LOG.debug(\"For port %(port_id)s, host %(host)s, \""},{"line_number":121,"context_line":"                  \"got binding levels %(levels)s\","},{"line_number":122,"context_line":"                  {\u0027port_id\u0027: port_id,"}],"source_content_type":"text/x-python","patch_set":4,"id":"1a95cdbc_68f3059f","line":119,"updated":"2016-10-05 22:14:20.000000000","message":"I think there is a mis-match between the PortBindingLevel object (https://github.com/openstack/neutron/blob/master/neutron/objects/ports.py#L129) and the original db model (https://github.com/openstack/neutron/blob/master/neutron/plugins/ml2/models.py#L76). The latter stores segment_id, whereas the former is storing segment. As a consequence, with the code in master (when running neutron.tests.unit.plugins.ml2.test_port_binding.PortBindingTestCase.test_binding_status_active as an example) the result we get from the query looks like:\n\n[\u003cneutron.plugins.ml2.models.PortBindingLevel[object at 7fcf8c27f8d0] {port_id\u003du\u0027283fa73e-c6a6-4e06-a312-f5a08a38ed94\u0027, host\u003du\u0027host-ovs-filter-active\u0027, level\u003d0, driver\u003du\u0027test\u0027, segment_id\u003du\u0027a5de8c17-b90b-4fe8-9ccc-e0a6b162eee2\u0027}\u003e] \n\nwhereas with the code in PS4 we get:\n\n[PortBindingLevel(driver\u003d\u0027test\u0027,host\u003d\u0027host-ovs-filter-active\u0027,level\u003d0,port_id\u003d5e4ac0c7-ce80-40be-96d0-3c7c0107e381,segment\u003dNetworkSegment(ba6e14d0-daa9-44d2-9132-e3927023f4fb))]\n\nSo either you need you need to adjust the PortBindingLevel object or adjust all the code that calls into this method to expect a segment object instead of the segment id","commit_id":"94013c2a16358ccbfc75681a4c3621423fec192d"},{"author":{"_account_id":22774,"name":"Shashank Kumar Shankar","email":"shashank.kumar.shankar@intel.com","username":"skshankar"},"change_message_id":"0fefe2aa25311b0644716afbc2f569a864941811","unresolved":false,"context_lines":[{"line_number":116,"context_line":"    if host:"},{"line_number":117,"context_line":"        port_bl_objs \u003d ports.PortBindingLevel.get_objects("},{"line_number":118,"context_line":"            context, port_id\u003dport_id, host\u003dhost)"},{"line_number":119,"context_line":"        port_bl_objs.sort(key\u003doperator.attrgetter(\u0027level\u0027))"},{"line_number":120,"context_line":"        LOG.debug(\"For port %(port_id)s, host %(host)s, \""},{"line_number":121,"context_line":"                  \"got binding levels %(levels)s\","},{"line_number":122,"context_line":"                  {\u0027port_id\u0027: port_id,"}],"source_content_type":"text/x-python","patch_set":4,"id":"1a95cdbc_fd4fb1ba","line":119,"in_reply_to":"1a95cdbc_68f3059f","updated":"2016-10-06 15:10:08.000000000","message":"Done. Thanks for the review. I added a new field in the object. But the idea was to access the segment_id as segment.id as per commit message in patch [1]. Since I was running into errors saying PortBindingLevel object does not have segment in it, I added a new field. \n\n[1] - https://review.openstack.org/#/c/351368/","commit_id":"94013c2a16358ccbfc75681a4c3621423fec192d"},{"author":{"_account_id":4694,"name":"Miguel Lavalle","email":"miguel@mlavalle.com","username":"minsel"},"change_message_id":"125dbc66e9cc56a9400e34cb3d45aa763c051009","unresolved":false,"context_lines":[{"line_number":97,"context_line":"        return None, None"},{"line_number":98,"context_line":""},{"line_number":99,"context_line":""},{"line_number":100,"context_line":"def set_binding_levels(session, levels):"},{"line_number":101,"context_line":"    if levels:"},{"line_number":102,"context_line":"        for level in levels:"},{"line_number":103,"context_line":"            session.add(level)"}],"source_content_type":"text/x-python","patch_set":7,"id":"1a95cdbc_bed34803","side":"PARENT","line":100,"updated":"2016-10-07 00:08:20.000000000","message":"You are pushing a PortBindingLevel object to the port context here: https://review.openstack.org/#/c/382037/7/neutron/plugins/ml2/managers.py@797. So you need to modify this method also","commit_id":"80d4df144d62ce638ca7bdd228cdd116e34b3067"},{"author":{"_account_id":22774,"name":"Shashank Kumar Shankar","email":"shashank.kumar.shankar@intel.com","username":"skshankar"},"change_message_id":"c94991f091dbcb0f974caf5c74face4c2abae655","unresolved":false,"context_lines":[{"line_number":97,"context_line":"        return None, None"},{"line_number":98,"context_line":""},{"line_number":99,"context_line":""},{"line_number":100,"context_line":"def set_binding_levels(session, levels):"},{"line_number":101,"context_line":"    if levels:"},{"line_number":102,"context_line":"        for level in levels:"},{"line_number":103,"context_line":"            session.add(level)"}],"source_content_type":"text/x-python","patch_set":7,"id":"1a95cdbc_074cd09c","side":"PARENT","line":100,"in_reply_to":"1a95cdbc_bed34803","updated":"2016-10-07 18:34:05.000000000","message":"Done","commit_id":"80d4df144d62ce638ca7bdd228cdd116e34b3067"},{"author":{"_account_id":4694,"name":"Miguel Lavalle","email":"miguel@mlavalle.com","username":"minsel"},"change_message_id":"125dbc66e9cc56a9400e34cb3d45aa763c051009","unresolved":false,"context_lines":[{"line_number":124,"context_line":"        return result"},{"line_number":125,"context_line":""},{"line_number":126,"context_line":""},{"line_number":127,"context_line":"def clear_binding_levels(session, port_id, host):"},{"line_number":128,"context_line":"    if host:"},{"line_number":129,"context_line":"        (session.query(models.PortBindingLevel)."},{"line_number":130,"context_line":"         filter_by(port_id\u003dport_id, host\u003dhost)."}],"source_content_type":"text/x-python","patch_set":7,"id":"1a95cdbc_ded014f9","side":"PARENT","line":127,"updated":"2016-10-07 00:08:20.000000000","message":"An I think also this one","commit_id":"80d4df144d62ce638ca7bdd228cdd116e34b3067"},{"author":{"_account_id":22774,"name":"Shashank Kumar Shankar","email":"shashank.kumar.shankar@intel.com","username":"skshankar"},"change_message_id":"c94991f091dbcb0f974caf5c74face4c2abae655","unresolved":false,"context_lines":[{"line_number":124,"context_line":"        return result"},{"line_number":125,"context_line":""},{"line_number":126,"context_line":""},{"line_number":127,"context_line":"def clear_binding_levels(session, port_id, host):"},{"line_number":128,"context_line":"    if host:"},{"line_number":129,"context_line":"        (session.query(models.PortBindingLevel)."},{"line_number":130,"context_line":"         filter_by(port_id\u003dport_id, host\u003dhost)."}],"source_content_type":"text/x-python","patch_set":7,"id":"1a95cdbc_a75ddc48","side":"PARENT","line":127,"in_reply_to":"1a95cdbc_ded014f9","updated":"2016-10-07 18:34:05.000000000","message":"Done","commit_id":"80d4df144d62ce638ca7bdd228cdd116e34b3067"},{"author":{"_account_id":4694,"name":"Miguel Lavalle","email":"miguel@mlavalle.com","username":"minsel"},"change_message_id":"20029cc918a08f10747eef1b288b8c6cb62478b8","unresolved":false,"context_lines":[{"line_number":102,"context_line":"def set_binding_levels(context, levels):"},{"line_number":103,"context_line":"    if levels:"},{"line_number":104,"context_line":"        for level in levels:"},{"line_number":105,"context_line":"            object \u003d ports.PortBindingLevel("},{"line_number":106,"context_line":"                context,"},{"line_number":107,"context_line":"                port_id\u003dlevel.port_id,"},{"line_number":108,"context_line":"                host\u003dlevel.host,"},{"line_number":109,"context_line":"                level\u003dlevel.level)"},{"line_number":110,"context_line":"            object.create()"},{"line_number":111,"context_line":"        LOG.debug(\"For port %(port_id)s, host %(host)s, \""},{"line_number":112,"context_line":"                  \"set binding levels %(levels)s\","}],"source_content_type":"text/x-python","patch_set":10,"id":"fa6399be_8ee42b3c","line":109,"range":{"start_line":105,"start_character":12,"end_line":109,"end_character":34},"updated":"2016-10-10 21:09:43.000000000","message":"In https://review.openstack.org/#/c/382037/10/neutron/plugins/ml2/managers.py@798 you pushed a PortBindingLevel object to context._binding_levels. The only call to this method is from https://github.com/openstack/neutron/blob/master/neutron/plugins/ml2/plugin.py#L509. As you can see, what you get in the levels argument is bind_context._binding_levels, which is where you pushed the PortBindingLevel object (as described above). So here you don\u0027t need to create the object again. Remove these lines. You only need the L110 below","commit_id":"24246c0282451e4afc07670ef3c753e9e162db06"},{"author":{"_account_id":22774,"name":"Shashank Kumar Shankar","email":"shashank.kumar.shankar@intel.com","username":"skshankar"},"change_message_id":"6760bcda4bc9b0e1e8df69c62455ecb3db1c0110","unresolved":false,"context_lines":[{"line_number":102,"context_line":"def set_binding_levels(context, levels):"},{"line_number":103,"context_line":"    if levels:"},{"line_number":104,"context_line":"        for level in levels:"},{"line_number":105,"context_line":"            object \u003d ports.PortBindingLevel("},{"line_number":106,"context_line":"                context,"},{"line_number":107,"context_line":"                port_id\u003dlevel.port_id,"},{"line_number":108,"context_line":"                host\u003dlevel.host,"},{"line_number":109,"context_line":"                level\u003dlevel.level)"},{"line_number":110,"context_line":"            object.create()"},{"line_number":111,"context_line":"        LOG.debug(\"For port %(port_id)s, host %(host)s, \""},{"line_number":112,"context_line":"                  \"set binding levels %(levels)s\","}],"source_content_type":"text/x-python","patch_set":10,"id":"fa6399be_07fa9542","line":109,"range":{"start_line":105,"start_character":12,"end_line":109,"end_character":34},"in_reply_to":"fa6399be_8ee42b3c","updated":"2016-10-11 16:52:24.000000000","message":"Done","commit_id":"24246c0282451e4afc07670ef3c753e9e162db06"},{"author":{"_account_id":6951,"name":"Brandon Logan","email":"brandon.logan@rackspace.com","username":"brandon-logan"},"change_message_id":"ac11b7448691f918c654a0cb058de465de4dd966","unresolved":false,"context_lines":[{"line_number":116,"context_line":"    if host:"},{"line_number":117,"context_line":"        port_bl_objs \u003d ports.PortBindingLevel.get_objects("},{"line_number":118,"context_line":"            context, port_id\u003dport_id, host\u003dhost)"},{"line_number":119,"context_line":"        port_bl_objs.sort(key\u003doperator.attrgetter(\u0027level\u0027))"},{"line_number":120,"context_line":"        LOG.debug(\"For port %(port_id)s, host %(host)s, \""},{"line_number":121,"context_line":"                  \"got binding levels %(levels)s\","},{"line_number":122,"context_line":"                  {\u0027port_id\u0027: port_id,"}],"source_content_type":"text/x-python","patch_set":11,"id":"fa6399be_ea5d65ea","line":119,"updated":"2016-10-11 18:38:35.000000000","message":"so this is changing the sorting from being done by the db to being done in python.  This will probably be a performance hit.\n\nCan\u0027t we use the _pager argument in get_objects?","commit_id":"dd438113f7035be2706723eaa0247f939d29aead"},{"author":{"_account_id":22774,"name":"Shashank Kumar Shankar","email":"shashank.kumar.shankar@intel.com","username":"skshankar"},"change_message_id":"1ba65efeab27f0c1fc46794c400501b72500b038","unresolved":false,"context_lines":[{"line_number":116,"context_line":"    if host:"},{"line_number":117,"context_line":"        port_bl_objs \u003d ports.PortBindingLevel.get_objects("},{"line_number":118,"context_line":"            context, port_id\u003dport_id, host\u003dhost)"},{"line_number":119,"context_line":"        port_bl_objs.sort(key\u003doperator.attrgetter(\u0027level\u0027))"},{"line_number":120,"context_line":"        LOG.debug(\"For port %(port_id)s, host %(host)s, \""},{"line_number":121,"context_line":"                  \"got binding levels %(levels)s\","},{"line_number":122,"context_line":"                  {\u0027port_id\u0027: port_id,"}],"source_content_type":"text/x-python","patch_set":11,"id":"fa6399be_545f9d0d","line":119,"in_reply_to":"fa6399be_ea5d65ea","updated":"2016-10-12 21:50:28.000000000","message":"Done","commit_id":"dd438113f7035be2706723eaa0247f939d29aead"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"change_message_id":"54e4cd7ece0045651d32709c39734eb1900e2c08","unresolved":false,"context_lines":[{"line_number":99,"context_line":"        return None, None"},{"line_number":100,"context_line":""},{"line_number":101,"context_line":""},{"line_number":102,"context_line":"def set_binding_levels(context, levels):"},{"line_number":103,"context_line":"    if levels:"},{"line_number":104,"context_line":"        for level in levels:"},{"line_number":105,"context_line":"            level.create()"}],"source_content_type":"text/x-python","patch_set":17,"id":"fa6399be_431cac13","line":102,"updated":"2016-10-17 15:01:48.000000000","message":"these are public methods so you need to check that it does not break any of the ml2 drivers","commit_id":"1a82151ffe96d34c720c6627773972da91ff5cc6"},{"author":{"_account_id":22774,"name":"Shashank Kumar Shankar","email":"shashank.kumar.shankar@intel.com","username":"skshankar"},"change_message_id":"aca81763b1aca8b3a68be261cfe4588114d584c2","unresolved":false,"context_lines":[{"line_number":99,"context_line":"        return None, None"},{"line_number":100,"context_line":""},{"line_number":101,"context_line":""},{"line_number":102,"context_line":"def set_binding_levels(context, levels):"},{"line_number":103,"context_line":"    if levels:"},{"line_number":104,"context_line":"        for level in levels:"},{"line_number":105,"context_line":"            level.create()"}],"source_content_type":"text/x-python","patch_set":17,"id":"fa6399be_0408f727","line":102,"in_reply_to":"fa6399be_431cac13","updated":"2016-10-17 16:46:12.000000000","message":"Only get_binding_levels() seems to be used in [1] and [2] which is outside the neutron repo. I am currently working on how to resolve this. \n\n[1] - http://git.openstack.org/cgit/openstack/networking-cisco/tree/networking_cisco/plugins/ml2/drivers/cisco/apic/apic_sync.py#n93\n[2] - http://git.openstack.org/cgit/openstack/networking-vsphere/tree/networking_vsphere/ml2/ovsvapp_rpc.py#n384","commit_id":"1a82151ffe96d34c720c6627773972da91ff5cc6"},{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"e68b882ca7fdd6acc870df1ddaf10ec72bc822e3","unresolved":false,"context_lines":[{"line_number":99,"context_line":"        return None, None"},{"line_number":100,"context_line":""},{"line_number":101,"context_line":""},{"line_number":102,"context_line":"def set_binding_levels(context, levels):"},{"line_number":103,"context_line":"    if levels:"},{"line_number":104,"context_line":"        for level in levels:"},{"line_number":105,"context_line":"            level.create()"}],"source_content_type":"text/x-python","patch_set":19,"id":"fa6399be_8e515611","line":102,"range":{"start_line":102,"start_character":23,"end_line":102,"end_character":32},"updated":"2016-10-18 17:03:34.000000000","message":"why passing context? it\u0027s already captured in level objects passed in the second argument.","commit_id":"1fe78f1b808363b990242dbfa2286a7185449bde"},{"author":{"_account_id":22774,"name":"Shashank Kumar Shankar","email":"shashank.kumar.shankar@intel.com","username":"skshankar"},"change_message_id":"f347e5c24e6b8b5aa37bfd1572e16f03aaeed12b","unresolved":false,"context_lines":[{"line_number":99,"context_line":"        return None, None"},{"line_number":100,"context_line":""},{"line_number":101,"context_line":""},{"line_number":102,"context_line":"def set_binding_levels(context, levels):"},{"line_number":103,"context_line":"    if levels:"},{"line_number":104,"context_line":"        for level in levels:"},{"line_number":105,"context_line":"            level.create()"}],"source_content_type":"text/x-python","patch_set":19,"id":"fa6399be_5cf60dfa","line":102,"range":{"start_line":102,"start_character":23,"end_line":102,"end_character":32},"in_reply_to":"fa6399be_8e515611","updated":"2016-10-18 22:57:59.000000000","message":"Done","commit_id":"1fe78f1b808363b990242dbfa2286a7185449bde"},{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"e68b882ca7fdd6acc870df1ddaf10ec72bc822e3","unresolved":false,"context_lines":[{"line_number":112,"context_line":"        LOG.debug(\"Attempted to set empty binding levels\")"},{"line_number":113,"context_line":""},{"line_number":114,"context_line":""},{"line_number":115,"context_line":"def get_binding_levels(context, port_id, host):"},{"line_number":116,"context_line":"    if host:"},{"line_number":117,"context_line":"        # TODO(sshank): The followed logic is checked to make"},{"line_number":118,"context_line":"        # sure Ml2 doesn\u0027t break in places outside the neutron repo."}],"source_content_type":"text/x-python","patch_set":19,"id":"fa6399be_4ee49e3a","line":115,"range":{"start_line":115,"start_character":4,"end_line":115,"end_character":22},"updated":"2016-10-18 17:03:34.000000000","message":"I think it\u0027s better to have a new function for our needs, and deprecate existing one when we are ready.","commit_id":"1fe78f1b808363b990242dbfa2286a7185449bde"},{"author":{"_account_id":22774,"name":"Shashank Kumar Shankar","email":"shashank.kumar.shankar@intel.com","username":"skshankar"},"change_message_id":"f347e5c24e6b8b5aa37bfd1572e16f03aaeed12b","unresolved":false,"context_lines":[{"line_number":112,"context_line":"        LOG.debug(\"Attempted to set empty binding levels\")"},{"line_number":113,"context_line":""},{"line_number":114,"context_line":""},{"line_number":115,"context_line":"def get_binding_levels(context, port_id, host):"},{"line_number":116,"context_line":"    if host:"},{"line_number":117,"context_line":"        # TODO(sshank): The followed logic is checked to make"},{"line_number":118,"context_line":"        # sure Ml2 doesn\u0027t break in places outside the neutron repo."}],"source_content_type":"text/x-python","patch_set":19,"id":"fa6399be_bc5569c7","line":115,"range":{"start_line":115,"start_character":4,"end_line":115,"end_character":22},"in_reply_to":"fa6399be_4ee49e3a","updated":"2016-10-18 22:57:59.000000000","message":"Done","commit_id":"1fe78f1b808363b990242dbfa2286a7185449bde"},{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"e68b882ca7fdd6acc870df1ddaf10ec72bc822e3","unresolved":false,"context_lines":[{"line_number":134,"context_line":"                       \u0027levels\u0027: port_bl_objs})"},{"line_number":135,"context_line":"            return port_bl_objs"},{"line_number":136,"context_line":"        else:"},{"line_number":137,"context_line":"            result \u003d (context.query(models.PortBindingLevel)."},{"line_number":138,"context_line":"                      filter_by(port_id\u003dport_id, host\u003dhost)."},{"line_number":139,"context_line":"                      order_by(models.PortBindingLevel.level)."},{"line_number":140,"context_line":"                      all())"}],"source_content_type":"text/x-python","patch_set":19,"id":"fa6399be_0e6f0693","line":137,"range":{"start_line":137,"start_character":22,"end_line":137,"end_character":29},"updated":"2016-10-18 17:03:34.000000000","message":"that\u0027s really weird, because we know if it\u0027s not a context but a session now. I suggest we don\u0027t put what effective are two separate functions under the same name; instead we split and keep their concerns separated.","commit_id":"1fe78f1b808363b990242dbfa2286a7185449bde"},{"author":{"_account_id":6951,"name":"Brandon Logan","email":"brandon.logan@rackspace.com","username":"brandon-logan"},"change_message_id":"55a33a0686e432b443a0a93893a92239928b9b72","unresolved":false,"context_lines":[{"line_number":336,"context_line":""},{"line_number":337,"context_line":"    port_objs \u003d []"},{"line_number":338,"context_line":"    for port_bl_obj in port_bl_objs:"},{"line_number":339,"context_line":"        query \u003d ports.Port.get_objects(context, port_bl_obj.id)"},{"line_number":340,"context_line":"        port_objs.append(query)"},{"line_number":341,"context_line":""},{"line_number":342,"context_line":"    # Removes repeated values"}],"source_content_type":"text/x-python","patch_set":21,"id":"ba5da102_25761c3e","line":339,"range":{"start_line":339,"start_character":47,"end_line":339,"end_character":62},"updated":"2016-11-02 22:46:59.000000000","message":"port_bl_obj.id being an ordered argument doesn\u0027t make sense here.  In fact, i\u0027m not sure how this even works because _pager is the 2nd argument that get_objects defines.  I think you meant to use a filter.  And don\u0027t you mean to use port_bl_obj.port_id?","commit_id":"524a7c9510c65aa5d2010aa47957b5dc79a5d29f"},{"author":{"_account_id":6951,"name":"Brandon Logan","email":"brandon.logan@rackspace.com","username":"brandon-logan"},"change_message_id":"55a33a0686e432b443a0a93893a92239928b9b72","unresolved":false,"context_lines":[{"line_number":336,"context_line":""},{"line_number":337,"context_line":"    port_objs \u003d []"},{"line_number":338,"context_line":"    for port_bl_obj in port_bl_objs:"},{"line_number":339,"context_line":"        query \u003d ports.Port.get_objects(context, port_bl_obj.id)"},{"line_number":340,"context_line":"        port_objs.append(query)"},{"line_number":341,"context_line":""},{"line_number":342,"context_line":"    # Removes repeated values"}],"source_content_type":"text/x-python","patch_set":21,"id":"ba5da102_c5280036","line":339,"range":{"start_line":339,"start_character":8,"end_line":339,"end_character":13},"updated":"2016-11-02 22:46:59.000000000","message":"query doesn\u0027t make sense anymore as this is a list of ports now.","commit_id":"524a7c9510c65aa5d2010aa47957b5dc79a5d29f"},{"author":{"_account_id":22774,"name":"Shashank Kumar Shankar","email":"shashank.kumar.shankar@intel.com","username":"skshankar"},"change_message_id":"611e916d20d09add65862a63637754488373e6f4","unresolved":false,"context_lines":[{"line_number":336,"context_line":""},{"line_number":337,"context_line":"    port_objs \u003d []"},{"line_number":338,"context_line":"    for port_bl_obj in port_bl_objs:"},{"line_number":339,"context_line":"        query \u003d ports.Port.get_objects(context, port_bl_obj.id)"},{"line_number":340,"context_line":"        port_objs.append(query)"},{"line_number":341,"context_line":""},{"line_number":342,"context_line":"    # Removes repeated values"}],"source_content_type":"text/x-python","patch_set":21,"id":"ba5da102_82a17796","line":339,"range":{"start_line":339,"start_character":47,"end_line":339,"end_character":62},"in_reply_to":"ba5da102_25761c3e","updated":"2016-11-03 17:09:14.000000000","message":"Done","commit_id":"524a7c9510c65aa5d2010aa47957b5dc79a5d29f"},{"author":{"_account_id":22774,"name":"Shashank Kumar Shankar","email":"shashank.kumar.shankar@intel.com","username":"skshankar"},"change_message_id":"611e916d20d09add65862a63637754488373e6f4","unresolved":false,"context_lines":[{"line_number":336,"context_line":""},{"line_number":337,"context_line":"    port_objs \u003d []"},{"line_number":338,"context_line":"    for port_bl_obj in port_bl_objs:"},{"line_number":339,"context_line":"        query \u003d ports.Port.get_objects(context, port_bl_obj.id)"},{"line_number":340,"context_line":"        port_objs.append(query)"},{"line_number":341,"context_line":""},{"line_number":342,"context_line":"    # Removes repeated values"}],"source_content_type":"text/x-python","patch_set":21,"id":"ba5da102_c2a7efa4","line":339,"range":{"start_line":339,"start_character":8,"end_line":339,"end_character":13},"in_reply_to":"ba5da102_c5280036","updated":"2016-11-03 17:09:14.000000000","message":"Done","commit_id":"524a7c9510c65aa5d2010aa47957b5dc79a5d29f"},{"author":{"_account_id":8726,"name":"Victor Morales","email":"chipahuac@hotmail.com","username":"electrocucaracha"},"change_message_id":"59d45ba3222bbe0e8e3f66c19534d2e5eac78527","unresolved":false,"context_lines":[{"line_number":328,"context_line":"                filter(models_v2.Subnet.id.in_(subnet_ids)).count())"},{"line_number":329,"context_line":""},{"line_number":330,"context_line":""},{"line_number":331,"context_line":"def _prevent_segment_delete_with_port_bound(resource, event, trigger,"},{"line_number":332,"context_line":"                                            context, segment):"},{"line_number":333,"context_line":"    \"\"\"Raise exception if there are any ports bound with segment_id.\"\"\""},{"line_number":334,"context_line":"    segment_id \u003d segment[\u0027id\u0027]"}],"source_content_type":"text/x-python","patch_set":22,"id":"9a629dbe_4c909695","line":331,"updated":"2016-11-11 01:42:31.000000000","message":"Maybe this could be a good candidate for class method","commit_id":"3dcc9d78b8953311fa872e9ab2825289f84ab852"},{"author":{"_account_id":15518,"name":"Artur Korzeniewski","email":"artur.korzen@wp.pl","username":"akorzeni"},"change_message_id":"00ae12c37911684d45b3081b3486572bc8c62f6e","unresolved":false,"context_lines":[{"line_number":100,"context_line":"        return result"},{"line_number":101,"context_line":""},{"line_number":102,"context_line":""},{"line_number":103,"context_line":"def get_binding_levels_objs(context, port_id, host):"},{"line_number":104,"context_line":"    if host:"},{"line_number":105,"context_line":"        pager \u003d objects_base.Pager(sorts\u003d[(\u0027level\u0027, True)])"},{"line_number":106,"context_line":"        port_bl_objs \u003d ports.PortBindingLevel.get_objects("}],"source_content_type":"text/x-python","patch_set":23,"id":"5a74a57a_cce7fc3e","line":103,"range":{"start_line":103,"start_character":4,"end_line":103,"end_character":27},"updated":"2016-11-23 14:20:57.000000000","message":"Why introducing new method? Introduction of OVO should be done in the original one.","commit_id":"fbdbd0d47f48de9db9ccb4f4c230cd090ae3c954"},{"author":{"_account_id":15518,"name":"Artur Korzeniewski","email":"artur.korzen@wp.pl","username":"akorzeni"},"change_message_id":"a87ae6eb397b87c7592adf7f565b2228b1bf2d09","unresolved":false,"context_lines":[{"line_number":100,"context_line":"        return result"},{"line_number":101,"context_line":""},{"line_number":102,"context_line":""},{"line_number":103,"context_line":"def get_binding_levels_objs(context, port_id, host):"},{"line_number":104,"context_line":"    if host:"},{"line_number":105,"context_line":"        pager \u003d objects_base.Pager(sorts\u003d[(\u0027level\u0027, True)])"},{"line_number":106,"context_line":"        port_bl_objs \u003d ports.PortBindingLevel.get_objects("}],"source_content_type":"text/x-python","patch_set":23,"id":"5a74a57a_f260e637","line":103,"range":{"start_line":103,"start_character":4,"end_line":103,"end_character":27},"in_reply_to":"5a74a57a_b613dd5b","updated":"2016-11-24 07:54:40.000000000","message":"Ok, so I guess that changing session to context is problematic here? \n\nIn that situation, you should propose a dependent patch on external repo to change the session to context and then modify the original get_binding_levels here.","commit_id":"fbdbd0d47f48de9db9ccb4f4c230cd090ae3c954"},{"author":{"_account_id":22774,"name":"Shashank Kumar Shankar","email":"shashank.kumar.shankar@intel.com","username":"skshankar"},"change_message_id":"fff6e26320e237f9976efa56ab41ee662d666c36","unresolved":false,"context_lines":[{"line_number":100,"context_line":"        return result"},{"line_number":101,"context_line":""},{"line_number":102,"context_line":""},{"line_number":103,"context_line":"def get_binding_levels_objs(context, port_id, host):"},{"line_number":104,"context_line":"    if host:"},{"line_number":105,"context_line":"        pager \u003d objects_base.Pager(sorts\u003d[(\u0027level\u0027, True)])"},{"line_number":106,"context_line":"        port_bl_objs \u003d ports.PortBindingLevel.get_objects("}],"source_content_type":"text/x-python","patch_set":23,"id":"5a74a57a_b613dd5b","line":103,"range":{"start_line":103,"start_character":4,"end_line":103,"end_character":27},"in_reply_to":"5a74a57a_cce7fc3e","updated":"2016-11-23 17:38:11.000000000","message":"This was done since the original one was used outside of the neutron repo. To not break them, this was introduced.","commit_id":"fbdbd0d47f48de9db9ccb4f4c230cd090ae3c954"},{"author":{"_account_id":15518,"name":"Artur Korzeniewski","email":"artur.korzen@wp.pl","username":"akorzeni"},"change_message_id":"00ae12c37911684d45b3081b3486572bc8c62f6e","unresolved":false,"context_lines":[{"line_number":305,"context_line":"                                            context, segment):"},{"line_number":306,"context_line":"    \"\"\"Raise exception if there are any ports bound with segment_id.\"\"\""},{"line_number":307,"context_line":"    segment_id \u003d segment[\u0027id\u0027]"},{"line_number":308,"context_line":"    port_bl_objs \u003d ports.PortBindingLevel.get_objects(context,"},{"line_number":309,"context_line":"                                                      segment_id\u003dsegment_id)"},{"line_number":310,"context_line":""},{"line_number":311,"context_line":"    port_objs_list \u003d []"},{"line_number":312,"context_line":"    for port_bl_obj in port_bl_objs:"},{"line_number":313,"context_line":"        port_objs \u003d ports.Port.get_objects(context, port_bl_obj.port_id)"},{"line_number":314,"context_line":"        port_objs_list.append(port_objs)"},{"line_number":315,"context_line":""},{"line_number":316,"context_line":"    port_objs_list \u003d chain.from_iterable(port_objs_list)"},{"line_number":317,"context_line":""},{"line_number":318,"context_line":"    # Removes repeated values"},{"line_number":319,"context_line":"    port_objs_list \u003d list(set(port_objs_list))"},{"line_number":320,"context_line":""},{"line_number":321,"context_line":"    port_ids \u003d [p.id for p in port_objs_list]"},{"line_number":322,"context_line":""}],"source_content_type":"text/x-python","patch_set":23,"id":"5a74a57a_723ec8b9","line":319,"range":{"start_line":308,"start_character":4,"end_line":319,"end_character":46},"updated":"2016-11-23 14:20:57.000000000","message":"It can be handled by new method in port OVO get_ports_filter_by_segment_id(context, segment_id\u003ds_id).\nInside that method you can play with query modeling or use OVOs:\n\n\n    pbl_objs \u003d ports.PortBindingLevel.get_objects(context,\n                   segment_id\u003dsegment_id)\n\n    port_ids \u003d [x.port_id for x in pbl_objs]\n    return ports.Port.get_objects(context, id\u003dport_ids)","commit_id":"fbdbd0d47f48de9db9ccb4f4c230cd090ae3c954"},{"author":{"_account_id":22774,"name":"Shashank Kumar Shankar","email":"shashank.kumar.shankar@intel.com","username":"skshankar"},"change_message_id":"fff6e26320e237f9976efa56ab41ee662d666c36","unresolved":false,"context_lines":[{"line_number":305,"context_line":"                                            context, segment):"},{"line_number":306,"context_line":"    \"\"\"Raise exception if there are any ports bound with segment_id.\"\"\""},{"line_number":307,"context_line":"    segment_id \u003d segment[\u0027id\u0027]"},{"line_number":308,"context_line":"    port_bl_objs \u003d ports.PortBindingLevel.get_objects(context,"},{"line_number":309,"context_line":"                                                      segment_id\u003dsegment_id)"},{"line_number":310,"context_line":""},{"line_number":311,"context_line":"    port_objs_list \u003d []"},{"line_number":312,"context_line":"    for port_bl_obj in port_bl_objs:"},{"line_number":313,"context_line":"        port_objs \u003d ports.Port.get_objects(context, port_bl_obj.port_id)"},{"line_number":314,"context_line":"        port_objs_list.append(port_objs)"},{"line_number":315,"context_line":""},{"line_number":316,"context_line":"    port_objs_list \u003d chain.from_iterable(port_objs_list)"},{"line_number":317,"context_line":""},{"line_number":318,"context_line":"    # Removes repeated values"},{"line_number":319,"context_line":"    port_objs_list \u003d list(set(port_objs_list))"},{"line_number":320,"context_line":""},{"line_number":321,"context_line":"    port_ids \u003d [p.id for p in port_objs_list]"},{"line_number":322,"context_line":""}],"source_content_type":"text/x-python","patch_set":23,"id":"5a74a57a_962501ad","line":319,"range":{"start_line":308,"start_character":4,"end_line":319,"end_character":46},"in_reply_to":"5a74a57a_723ec8b9","updated":"2016-11-23 17:38:11.000000000","message":"Done. Moved this into the Port OVO.","commit_id":"fbdbd0d47f48de9db9ccb4f4c230cd090ae3c954"},{"author":{"_account_id":15518,"name":"Artur Korzeniewski","email":"artur.korzen@wp.pl","username":"akorzeni"},"change_message_id":"23c032fac55dd490bfd2e718b4e9514e12f8b350","unresolved":false,"context_lines":[{"line_number":99,"context_line":"        return result"},{"line_number":100,"context_line":""},{"line_number":101,"context_line":""},{"line_number":102,"context_line":"def get_binding_levels_objs(context, port_id, host):"},{"line_number":103,"context_line":"    if host:"},{"line_number":104,"context_line":"        pager \u003d objects_base.Pager(sorts\u003d[(\u0027level\u0027, True)])"},{"line_number":105,"context_line":"        port_bl_objs \u003d ports.PortBindingLevel.get_objects("}],"source_content_type":"text/x-python","patch_set":24,"id":"5a74a57a_12c002e0","line":102,"range":{"start_line":102,"start_character":4,"end_line":102,"end_character":27},"updated":"2016-11-24 08:08:18.000000000","message":"Resolve the conflicts in external repos to have only one get_binding_levels method here.","commit_id":"d39c8f192688ad9ce1cc2778e7c605e1236f3a2c"},{"author":{"_account_id":22774,"name":"Shashank Kumar Shankar","email":"shashank.kumar.shankar@intel.com","username":"skshankar"},"change_message_id":"a91e6c061d8bbef6ccf8a246e67449206832a32d","unresolved":false,"context_lines":[{"line_number":99,"context_line":"        return result"},{"line_number":100,"context_line":""},{"line_number":101,"context_line":""},{"line_number":102,"context_line":"def get_binding_levels_objs(context, port_id, host):"},{"line_number":103,"context_line":"    if host:"},{"line_number":104,"context_line":"        pager \u003d objects_base.Pager(sorts\u003d[(\u0027level\u0027, True)])"},{"line_number":105,"context_line":"        port_bl_objs \u003d ports.PortBindingLevel.get_objects("}],"source_content_type":"text/x-python","patch_set":24,"id":"5a74a57a_27d60bf1","line":102,"range":{"start_line":102,"start_character":4,"end_line":102,"end_character":27},"in_reply_to":"5a74a57a_12c002e0","updated":"2016-11-28 23:31:08.000000000","message":"This was suggested by Ihar here: [1] to make it as a separate function. This is because it touches 2 external repos [2]. \n\n[1] - https://review.openstack.org/#/c/382037/19/neutron/plugins/ml2/db.py@115\n[2] - http://codesearch.openstack.org/?q\u003dget_binding_levels\u0026i\u003dnope\u0026files\u003d\u0026repos\u003d","commit_id":"d39c8f192688ad9ce1cc2778e7c605e1236f3a2c"},{"author":{"_account_id":15518,"name":"Artur Korzeniewski","email":"artur.korzen@wp.pl","username":"akorzeni"},"change_message_id":"d4d47797ca9f7954f46fab5aed8f4b0371dd14f2","unresolved":false,"context_lines":[{"line_number":99,"context_line":"        return result"},{"line_number":100,"context_line":""},{"line_number":101,"context_line":""},{"line_number":102,"context_line":"def get_binding_levels_objs(context, port_id, host):"},{"line_number":103,"context_line":"    if host:"},{"line_number":104,"context_line":"        pager \u003d objects_base.Pager(sorts\u003d[(\u0027level\u0027, True)])"},{"line_number":105,"context_line":"        port_bl_objs \u003d ports.PortBindingLevel.get_objects("}],"source_content_type":"text/x-python","patch_set":24,"id":"5a74a57a_94453044","line":102,"range":{"start_line":102,"start_character":4,"end_line":102,"end_character":27},"in_reply_to":"5a74a57a_27d60bf1","updated":"2016-11-29 13:27:47.000000000","message":"Hmm, the external repo fixes look easy. I would better like the backward compatible one method but...","commit_id":"d39c8f192688ad9ce1cc2778e7c605e1236f3a2c"},{"author":{"_account_id":8726,"name":"Victor Morales","email":"chipahuac@hotmail.com","username":"electrocucaracha"},"change_message_id":"a3de06f2b36a0e4f959cb5cd3743e9eb5dd40ded","unresolved":false,"context_lines":[{"line_number":114,"context_line":""},{"line_number":115,"context_line":"def clear_binding_levels(context, port_id, host):"},{"line_number":116,"context_line":"    if host:"},{"line_number":117,"context_line":"        port_bl_objs \u003d ports.PortBindingLevel.get_objects("},{"line_number":118,"context_line":"            context, port_id\u003dport_id, host\u003dhost)"},{"line_number":119,"context_line":"        for port_bl in port_bl_objs:"},{"line_number":120,"context_line":"            port_bl.delete()"},{"line_number":121,"context_line":"        LOG.debug(\"For port %(port_id)s, host %(host)s, \""},{"line_number":122,"context_line":"                  \"cleared binding levels\","},{"line_number":123,"context_line":"                  {\u0027port_id\u0027: port_id,"}],"source_content_type":"text/x-python","patch_set":25,"id":"5a74a57a_b38201c7","line":120,"range":{"start_line":117,"start_character":8,"end_line":120,"end_character":28},"updated":"2016-11-30 15:52:42.000000000","message":"This is a good candidate for using new delete method[1]\n\n[1] https://review.openstack.org/#/c/403832/","commit_id":"82df83d85021e6ef0fd42ba8060b0b7b4bec4fae"},{"author":{"_account_id":22774,"name":"Shashank Kumar Shankar","email":"shashank.kumar.shankar@intel.com","username":"skshankar"},"change_message_id":"f1bb3656b2def35a25347de90f792406d4e22ee6","unresolved":false,"context_lines":[{"line_number":114,"context_line":""},{"line_number":115,"context_line":"def clear_binding_levels(context, port_id, host):"},{"line_number":116,"context_line":"    if host:"},{"line_number":117,"context_line":"        port_bl_objs \u003d ports.PortBindingLevel.get_objects("},{"line_number":118,"context_line":"            context, port_id\u003dport_id, host\u003dhost)"},{"line_number":119,"context_line":"        for port_bl in port_bl_objs:"},{"line_number":120,"context_line":"            port_bl.delete()"},{"line_number":121,"context_line":"        LOG.debug(\"For port %(port_id)s, host %(host)s, \""},{"line_number":122,"context_line":"                  \"cleared binding levels\","},{"line_number":123,"context_line":"                  {\u0027port_id\u0027: port_id,"}],"source_content_type":"text/x-python","patch_set":25,"id":"3a71b18c_3c5a5c84","line":120,"range":{"start_line":117,"start_character":8,"end_line":120,"end_character":28},"in_reply_to":"5a74a57a_b38201c7","updated":"2016-12-01 16:22:04.000000000","message":"I\u0027ll make the change once that patch gets merged.","commit_id":"82df83d85021e6ef0fd42ba8060b0b7b4bec4fae"},{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"2934884b8a7ef931bec54b9dce14da010484dd38","unresolved":false,"context_lines":[{"line_number":99,"context_line":"        return result"},{"line_number":100,"context_line":""},{"line_number":101,"context_line":""},{"line_number":102,"context_line":"def get_binding_levels_objs(context, port_id, host):"},{"line_number":103,"context_line":"    if host:"},{"line_number":104,"context_line":"        pager \u003d objects_base.Pager(sorts\u003d[(\u0027level\u0027, True)])"},{"line_number":105,"context_line":"        port_bl_objs \u003d ports.PortBindingLevel.get_objects("}],"source_content_type":"text/x-python","patch_set":26,"id":"3a71b18c_3c7f9967","line":102,"range":{"start_line":102,"start_character":4,"end_line":102,"end_character":27},"updated":"2016-12-08 15:07:20.000000000","message":"get_binding_level_objs","commit_id":"8cc56aad623305091f432577ec3ccb2bf25417ff"},{"author":{"_account_id":17491,"name":"Lujin Luo","email":"luo.lujin@jp.fujitsu.com","username":"Lujin"},"change_message_id":"6167b31f0f7c0009611c72e50776a8dcf081ad1b","unresolved":false,"context_lines":[{"line_number":304,"context_line":"                                            context, segment):"},{"line_number":305,"context_line":"    \"\"\"Raise exception if there are any ports bound with segment_id.\"\"\""},{"line_number":306,"context_line":"    segment_id \u003d segment[\u0027id\u0027]"},{"line_number":307,"context_line":"    port_ids \u003d ports.Port.get_port_ids_filter_by_segment_id(context,"},{"line_number":308,"context_line":"                                                         segment_id\u003dsegment_id)"},{"line_number":309,"context_line":""},{"line_number":310,"context_line":"    # There are still some ports in the segment, segment should not be deleted"},{"line_number":311,"context_line":"    # TODO(xiaohhui): Should we delete the dhcp port automatically here?"}],"source_content_type":"text/x-python","patch_set":26,"id":"3a71b18c_7a070618","line":308,"range":{"start_line":307,"start_character":4,"end_line":308,"end_character":79},"updated":"2016-12-05 09:14:05.000000000","message":"nit:\nport_ids \u003d ports.Port.get_port_ids_filter_by_segment_id(\n    context, segment_id\u003dsegment_id)","commit_id":"8cc56aad623305091f432577ec3ccb2bf25417ff"},{"author":{"_account_id":8726,"name":"Victor Morales","email":"chipahuac@hotmail.com","username":"electrocucaracha"},"change_message_id":"0a7b3f7db8fe911ad9da47356a27c64203c198e1","unresolved":false,"context_lines":[{"line_number":304,"context_line":"                                            context, segment):"},{"line_number":305,"context_line":"    \"\"\"Raise exception if there are any ports bound with segment_id.\"\"\""},{"line_number":306,"context_line":"    segment_id \u003d segment[\u0027id\u0027]"},{"line_number":307,"context_line":"    port_ids \u003d ports.Port.get_port_ids_filter_by_segment_id(context,"},{"line_number":308,"context_line":"                                                         segment_id\u003dsegment_id)"},{"line_number":309,"context_line":""},{"line_number":310,"context_line":"    # There are still some ports in the segment, segment should not be deleted"},{"line_number":311,"context_line":"    # TODO(xiaohhui): Should we delete the dhcp port automatically here?"}],"source_content_type":"text/x-python","patch_set":26,"id":"3a71b18c_54d64f4f","line":308,"range":{"start_line":307,"start_character":4,"end_line":308,"end_character":79},"in_reply_to":"3a71b18c_7a070618","updated":"2016-12-06 18:25:00.000000000","message":"+1","commit_id":"8cc56aad623305091f432577ec3ccb2bf25417ff"},{"author":{"_account_id":22776,"name":"Nakul Dahiwade","email":"nakul.dahiwade@intel.com","username":"nakul.dahiwade"},"change_message_id":"44531060954c708cc16880018c1ac8a3fc51865e","unresolved":false,"context_lines":[{"line_number":114,"context_line":""},{"line_number":115,"context_line":"def clear_binding_levels(context, port_id, host):"},{"line_number":116,"context_line":"    if host:"},{"line_number":117,"context_line":"        port_bl_objs \u003d ports.PortBindingLevel.get_objects("},{"line_number":118,"context_line":"            context, port_id\u003dport_id, host\u003dhost)"},{"line_number":119,"context_line":"        for port_bl in port_bl_objs:"},{"line_number":120,"context_line":"            port_bl.delete()"}],"source_content_type":"text/x-python","patch_set":29,"id":"1a6eadb0_f18ead2c","line":117,"updated":"2016-12-15 20:24:07.000000000","message":"I think you can use delete_objects method here:\nhttps://review.openstack.org/#/c/403832/","commit_id":"4bf8b4852c7204d09fd45842a307ae212835a69c"},{"author":{"_account_id":15518,"name":"Artur Korzeniewski","email":"artur.korzen@wp.pl","username":"akorzeni"},"change_message_id":"7e715e827409d9785f13f5908a205b7739b5e8fa","unresolved":false,"context_lines":[{"line_number":114,"context_line":""},{"line_number":115,"context_line":"def clear_binding_levels(context, port_id, host):"},{"line_number":116,"context_line":"    if host:"},{"line_number":117,"context_line":"        port_bl_objs \u003d ports.PortBindingLevel.get_objects("},{"line_number":118,"context_line":"            context, port_id\u003dport_id, host\u003dhost)"},{"line_number":119,"context_line":"        for port_bl in port_bl_objs:"},{"line_number":120,"context_line":"            port_bl.delete()"},{"line_number":121,"context_line":"        LOG.debug(\"For port %(port_id)s, host %(host)s, \""},{"line_number":122,"context_line":"                  \"cleared binding levels\","},{"line_number":123,"context_line":"                  {\u0027port_id\u0027: port_id,"}],"source_content_type":"text/x-python","patch_set":29,"id":"3a71b18c_06b18a8f","line":120,"range":{"start_line":117,"start_character":8,"end_line":120,"end_character":28},"updated":"2016-12-16 09:37:46.000000000","message":"any transaction here?","commit_id":"4bf8b4852c7204d09fd45842a307ae212835a69c"},{"author":{"_account_id":15518,"name":"Artur Korzeniewski","email":"artur.korzen@wp.pl","username":"akorzeni"},"change_message_id":"aed43c6c6d7b5a10b597924a9fbca0d810b47930","unresolved":false,"context_lines":[{"line_number":114,"context_line":""},{"line_number":115,"context_line":"def clear_binding_levels(context, port_id, host):"},{"line_number":116,"context_line":"    if host:"},{"line_number":117,"context_line":"        port_bl_objs \u003d ports.PortBindingLevel.get_objects("},{"line_number":118,"context_line":"            context, port_id\u003dport_id, host\u003dhost)"},{"line_number":119,"context_line":"        for port_bl in port_bl_objs:"},{"line_number":120,"context_line":"            port_bl.delete()"},{"line_number":121,"context_line":"        LOG.debug(\"For port %(port_id)s, host %(host)s, \""},{"line_number":122,"context_line":"                  \"cleared binding levels\","},{"line_number":123,"context_line":"                  {\u0027port_id\u0027: port_id,"}],"source_content_type":"text/x-python","patch_set":31,"id":"ba5201f7_f96a9219","line":120,"range":{"start_line":117,"start_character":7,"end_line":120,"end_character":28},"updated":"2017-01-03 08:31:27.000000000","message":"Use delete_objects() here.","commit_id":"6446ffe128bee1bd95c4c5197109375919873b00"},{"author":{"_account_id":15518,"name":"Artur Korzeniewski","email":"artur.korzen@wp.pl","username":"akorzeni"},"change_message_id":"aed43c6c6d7b5a10b597924a9fbca0d810b47930","unresolved":false,"context_lines":[{"line_number":305,"context_line":"    \"\"\"Raise exception if there are any ports bound with segment_id.\"\"\""},{"line_number":306,"context_line":"    segment_id \u003d segment[\u0027id\u0027]"},{"line_number":307,"context_line":"    port_ids \u003d ports.Port.get_port_ids_filter_by_segment_id(context,"},{"line_number":308,"context_line":"                                                         segment_id\u003dsegment_id)"},{"line_number":309,"context_line":""},{"line_number":310,"context_line":"    # There are still some ports in the segment, segment should not be deleted"},{"line_number":311,"context_line":"    # TODO(xiaohhui): Should we delete the dhcp port automatically here?"}],"source_content_type":"text/x-python","patch_set":31,"id":"ba5201f7_7965c243","line":308,"updated":"2017-01-03 08:31:27.000000000","message":"I\u0027m not sure about the indentation here.","commit_id":"6446ffe128bee1bd95c4c5197109375919873b00"},{"author":{"_account_id":22220,"name":"Anindita Das","email":"anindita.das@utexas.edu","username":"anudas"},"change_message_id":"573e5bd00d93d46acad4b6eed466738086576ac0","unresolved":false,"context_lines":[{"line_number":114,"context_line":""},{"line_number":115,"context_line":"def clear_binding_levels(context, port_id, host):"},{"line_number":116,"context_line":"    if host:"},{"line_number":117,"context_line":"        port_bl_objs \u003d port_obj.PortBindingLevel.get_objects("},{"line_number":118,"context_line":"            context, port_id\u003dport_id, host\u003dhost)"},{"line_number":119,"context_line":"        for port_bl in port_bl_objs:"},{"line_number":120,"context_line":"            port_bl.delete()"},{"line_number":121,"context_line":"        LOG.debug(\"For port %(port_id)s, host %(host)s, \""},{"line_number":122,"context_line":"                  \"cleared binding levels\","},{"line_number":123,"context_line":"                  {\u0027port_id\u0027: port_id,"}],"source_content_type":"text/x-python","patch_set":32,"id":"ba5201f7_2ce56137","line":120,"range":{"start_line":117,"start_character":0,"end_line":120,"end_character":28},"updated":"2017-01-11 21:05:57.000000000","message":"This needs to be replaced by delete_objects()","commit_id":"79392779e8424e3b9baaa49ba74c98912b5b341e"},{"author":{"_account_id":22774,"name":"Shashank Kumar Shankar","email":"shashank.kumar.shankar@intel.com","username":"skshankar"},"change_message_id":"c9a7b31c7e7ac3d1fb77bc54e344c6be52f922e0","unresolved":false,"context_lines":[{"line_number":114,"context_line":""},{"line_number":115,"context_line":"def clear_binding_levels(context, port_id, host):"},{"line_number":116,"context_line":"    if host:"},{"line_number":117,"context_line":"        port_bl_objs \u003d port_obj.PortBindingLevel.get_objects("},{"line_number":118,"context_line":"            context, port_id\u003dport_id, host\u003dhost)"},{"line_number":119,"context_line":"        for port_bl in port_bl_objs:"},{"line_number":120,"context_line":"            port_bl.delete()"},{"line_number":121,"context_line":"        LOG.debug(\"For port %(port_id)s, host %(host)s, \""},{"line_number":122,"context_line":"                  \"cleared binding levels\","},{"line_number":123,"context_line":"                  {\u0027port_id\u0027: port_id,"}],"source_content_type":"text/x-python","patch_set":32,"id":"9a57fde8_5f8d5730","line":120,"range":{"start_line":117,"start_character":0,"end_line":120,"end_character":28},"in_reply_to":"ba5201f7_2ce56137","updated":"2017-01-12 19:53:21.000000000","message":"Done","commit_id":"79392779e8424e3b9baaa49ba74c98912b5b341e"},{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"3fba99ca6e3cfa43129b4af2d208d5a80a33cf5f","unresolved":false,"context_lines":[{"line_number":85,"context_line":"        LOG.debug(\"Attempted to set empty binding levels\")"},{"line_number":86,"context_line":""},{"line_number":87,"context_line":""},{"line_number":88,"context_line":"def get_binding_levels(context, port_id, host):"},{"line_number":89,"context_line":"    if host:"},{"line_number":90,"context_line":"        result \u003d (context.session.query(models.PortBindingLevel)."},{"line_number":91,"context_line":"                  filter_by(port_id\u003dport_id, host\u003dhost)."}],"source_content_type":"text/x-python","patch_set":34,"id":"7a3c09a3_c9ec5295","line":88,"updated":"2017-01-18 21:31:49.000000000","message":"Should we mark the function as deprecated?","commit_id":"3e7ae4a3381792bebd366b041f1790f4159d27e2"},{"author":{"_account_id":22774,"name":"Shashank Kumar Shankar","email":"shashank.kumar.shankar@intel.com","username":"skshankar"},"change_message_id":"d71c6520d37ccc425a74976af2210ab8ae56bbdf","unresolved":false,"context_lines":[{"line_number":85,"context_line":"        LOG.debug(\"Attempted to set empty binding levels\")"},{"line_number":86,"context_line":""},{"line_number":87,"context_line":""},{"line_number":88,"context_line":"def get_binding_levels(context, port_id, host):"},{"line_number":89,"context_line":"    if host:"},{"line_number":90,"context_line":"        result \u003d (context.session.query(models.PortBindingLevel)."},{"line_number":91,"context_line":"                  filter_by(port_id\u003dport_id, host\u003dhost)."}],"source_content_type":"text/x-python","patch_set":34,"id":"7a3c09a3_9cfb6747","line":88,"in_reply_to":"7a3c09a3_c9ec5295","updated":"2017-01-18 22:41:20.000000000","message":"Done. Added a comment.","commit_id":"3e7ae4a3381792bebd366b041f1790f4159d27e2"},{"author":{"_account_id":22220,"name":"Anindita Das","email":"anindita.das@utexas.edu","username":"anudas"},"change_message_id":"7045b6b5fa88388b25b4241d3965328db6e9c059","unresolved":false,"context_lines":[{"line_number":85,"context_line":"        LOG.debug(\"Attempted to set empty binding levels\")"},{"line_number":86,"context_line":""},{"line_number":87,"context_line":""},{"line_number":88,"context_line":"# TODO(sshank): The following function is to be depricated later on when repos"},{"line_number":89,"context_line":"# outside of neutron switch to OVOs."},{"line_number":90,"context_line":"def get_binding_levels(context, port_id, host):"},{"line_number":91,"context_line":"    if host:"}],"source_content_type":"text/x-python","patch_set":35,"id":"5a3905b3_add71d22","line":88,"range":{"start_line":88,"start_character":48,"end_line":88,"end_character":58},"updated":"2017-01-19 01:31:15.000000000","message":"/s/depricated/deprecated","commit_id":"fa960b0ccbd1ca440ceb0a8afee8aa2a7bc3317e"},{"author":{"_account_id":15518,"name":"Artur Korzeniewski","email":"artur.korzen@wp.pl","username":"akorzeni"},"change_message_id":"39714105cf30ec492f7f5ce5c4581501008c12ac","unresolved":false,"context_lines":[{"line_number":85,"context_line":"        LOG.debug(\"Attempted to set empty binding levels\")"},{"line_number":86,"context_line":""},{"line_number":87,"context_line":""},{"line_number":88,"context_line":"# TODO(sshank): The following function is to be depricated later on when repos"},{"line_number":89,"context_line":"# outside of neutron switch to OVOs."},{"line_number":90,"context_line":"def get_binding_levels(context, port_id, host):"},{"line_number":91,"context_line":"    if host:"}],"source_content_type":"text/x-python","patch_set":35,"id":"5a3905b3_8fc16c31","line":88,"range":{"start_line":88,"start_character":48,"end_line":88,"end_character":58},"in_reply_to":"5a3905b3_add71d22","updated":"2017-01-19 08:02:28.000000000","message":"Done","commit_id":"fa960b0ccbd1ca440ceb0a8afee8aa2a7bc3317e"},{"author":{"_account_id":8726,"name":"Victor Morales","email":"chipahuac@hotmail.com","username":"electrocucaracha"},"change_message_id":"07c6b1006c59cf58c4949f42faab743437dbc5fe","unresolved":false,"context_lines":[{"line_number":85,"context_line":"        LOG.debug(\"Attempted to set empty binding levels\")"},{"line_number":86,"context_line":""},{"line_number":87,"context_line":""},{"line_number":88,"context_line":"# TODO(sshank): The following function is to be deprecated later on when repos"},{"line_number":89,"context_line":"# outside of neutron switch to OVOs."},{"line_number":90,"context_line":"def get_binding_levels(context, port_id, host):"},{"line_number":91,"context_line":"    if host:"},{"line_number":92,"context_line":"        result \u003d (context.session.query(models.PortBindingLevel)."}],"source_content_type":"text/x-python","patch_set":36,"id":"5a3905b3_ab81a14c","line":89,"range":{"start_line":88,"start_character":0,"end_line":89,"end_character":36},"updated":"2017-01-19 15:39:20.000000000","message":"Shouldn\u0027t be this deprecated with a debtcollector entry?","commit_id":"bf3a212bbcece83e753a092cb19ebd7ac14041c5"},{"author":{"_account_id":22774,"name":"Shashank Kumar Shankar","email":"shashank.kumar.shankar@intel.com","username":"skshankar"},"change_message_id":"790cdae43a31acd3166e844ac791d34aa07d85d4","unresolved":false,"context_lines":[{"line_number":85,"context_line":"        LOG.debug(\"Attempted to set empty binding levels\")"},{"line_number":86,"context_line":""},{"line_number":87,"context_line":""},{"line_number":88,"context_line":"# TODO(sshank): The following function is to be deprecated later on when repos"},{"line_number":89,"context_line":"# outside of neutron switch to OVOs."},{"line_number":90,"context_line":"def get_binding_levels(context, port_id, host):"},{"line_number":91,"context_line":"    if host:"},{"line_number":92,"context_line":"        result \u003d (context.session.query(models.PortBindingLevel)."}],"source_content_type":"text/x-python","patch_set":36,"id":"3a461143_e7be99d3","line":89,"range":{"start_line":88,"start_character":0,"end_line":89,"end_character":36},"in_reply_to":"5a3905b3_0cebcab1","updated":"2017-01-25 16:57:10.000000000","message":"Done","commit_id":"bf3a212bbcece83e753a092cb19ebd7ac14041c5"},{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"741cb58922de5c575418fc5d301d829bd469bd71","unresolved":false,"context_lines":[{"line_number":85,"context_line":"        LOG.debug(\"Attempted to set empty binding levels\")"},{"line_number":86,"context_line":""},{"line_number":87,"context_line":""},{"line_number":88,"context_line":"# TODO(sshank): The following function is to be deprecated later on when repos"},{"line_number":89,"context_line":"# outside of neutron switch to OVOs."},{"line_number":90,"context_line":"def get_binding_levels(context, port_id, host):"},{"line_number":91,"context_line":"    if host:"},{"line_number":92,"context_line":"        result \u003d (context.session.query(models.PortBindingLevel)."}],"source_content_type":"text/x-python","patch_set":36,"id":"5a3905b3_0cebcab1","line":89,"range":{"start_line":88,"start_character":0,"end_line":89,"end_character":36},"in_reply_to":"5a3905b3_ab81a14c","updated":"2017-01-24 20:56:37.000000000","message":"Yeah, why the comment if we can mark it as deprecated now.","commit_id":"bf3a212bbcece83e753a092cb19ebd7ac14041c5"},{"author":{"_account_id":14611,"name":"dasm","display_name":"dasm","email":"dsmigiel@redhat.com","username":"dasm"},"change_message_id":"9a76559c9a2ca1e781ccebd337e7b67e907dc3a0","unresolved":false,"context_lines":[{"line_number":92,"context_line":"        LOG.debug(\"Attempted to set empty binding levels\")"},{"line_number":93,"context_line":""},{"line_number":94,"context_line":""},{"line_number":95,"context_line":"@removals.remove("},{"line_number":96,"context_line":"    message\u003d\"Function get_binding_levels is deprecated. Please use \""},{"line_number":97,"context_line":"            \"get_binding_level_objs instead as it makes use of OVOs.\")"},{"line_number":98,"context_line":"def get_binding_levels(context, port_id, host):"},{"line_number":99,"context_line":"    if host:"},{"line_number":100,"context_line":"        result \u003d (context.session.query(models.PortBindingLevel)."}],"source_content_type":"text/x-python","patch_set":50,"id":"dfeb2761_48d5811b","line":97,"range":{"start_line":95,"start_character":0,"end_line":97,"end_character":70},"updated":"2017-04-04 19:52:53.000000000","message":"Please use moves: https://docs.openstack.org/developer/debtcollector/api.html#module-debtcollector.moves\n\n debtcollector.moves.moved_function","commit_id":"5f1ad38296bd757cc21b2b196c3dcac31fc169a1"},{"author":{"_account_id":22774,"name":"Shashank Kumar Shankar","email":"shashank.kumar.shankar@intel.com","username":"skshankar"},"change_message_id":"efa4245e8e562d5cf0fdeb5c4dc245b0f4626f18","unresolved":false,"context_lines":[{"line_number":92,"context_line":"        LOG.debug(\"Attempted to set empty binding levels\")"},{"line_number":93,"context_line":""},{"line_number":94,"context_line":""},{"line_number":95,"context_line":"@removals.remove("},{"line_number":96,"context_line":"    message\u003d\"Function get_binding_levels is deprecated. Please use \""},{"line_number":97,"context_line":"            \"get_binding_level_objs instead as it makes use of OVOs.\")"},{"line_number":98,"context_line":"def get_binding_levels(context, port_id, host):"},{"line_number":99,"context_line":"    if host:"},{"line_number":100,"context_line":"        result \u003d (context.session.query(models.PortBindingLevel)."}],"source_content_type":"text/x-python","patch_set":50,"id":"dfeb2761_88fb8945","line":97,"range":{"start_line":95,"start_character":0,"end_line":97,"end_character":70},"in_reply_to":"dfeb2761_48d5811b","updated":"2017-04-04 20:04:01.000000000","message":"Since moving it breaks things outside of neutron, we felt this was apt to use.","commit_id":"5f1ad38296bd757cc21b2b196c3dcac31fc169a1"},{"author":{"_account_id":4694,"name":"Miguel Lavalle","email":"miguel@mlavalle.com","username":"minsel"},"change_message_id":"1c540825bb72e2081e074d700000e2eab2765250","unresolved":false,"context_lines":[{"line_number":55,"context_line":"def set_binding_levels(context, levels):"},{"line_number":56,"context_line":"    if levels:"},{"line_number":57,"context_line":"        for level in levels:"},{"line_number":58,"context_line":"            level.create()"},{"line_number":59,"context_line":"        LOG.debug(\"For port %(port_id)s, host %(host)s, \""},{"line_number":60,"context_line":"                  \"set binding levels %(levels)s\","},{"line_number":61,"context_line":"                  {\u0027port_id\u0027: levels[0].port_id,"}],"source_content_type":"text/x-python","patch_set":62,"id":"3f79a3b5_3f93cba5","line":58,"updated":"2018-08-07 23:26:57.000000000","message":"Both unit test cases are failing here. It seems to me the OVO is not passing to SQLAlchemy values for port_id, host and level, which are the primary key for port binding level: https://github.com/openstack/neutron/blob/master/neutron/plugins/ml2/models.py#L77-L81. This is the traceback that I get executing with pdb: http://paste.openstack.org/show/727580/. \n\nI didn\u0027t have time tonight to debug further. Hope this helps","commit_id":"e3dfe5bd5318c294694be939b5f1ba3797282d09"},{"author":{"_account_id":27654,"name":"Hongbin Lu","email":"kira034@163.com","username":"hongbin.lu"},"change_message_id":"3db7d38fd49f8b82fb20430bc235c2c818036d19","unresolved":false,"context_lines":[{"line_number":55,"context_line":"def set_binding_levels(context, levels):"},{"line_number":56,"context_line":"    if levels:"},{"line_number":57,"context_line":"        for level in levels:"},{"line_number":58,"context_line":"            level.create()"},{"line_number":59,"context_line":"        LOG.debug(\"For port %(port_id)s, host %(host)s, \""},{"line_number":60,"context_line":"                  \"set binding levels %(levels)s\","},{"line_number":61,"context_line":"                  {\u0027port_id\u0027: levels[0].port_id,"}],"source_content_type":"text/x-python","patch_set":63,"id":"3f79a3b5_a029a59b","line":58,"range":{"start_line":58,"start_character":18,"end_line":58,"end_character":24},"updated":"2018-08-10 22:40:55.000000000","message":"I wonder if there is a possibility that the caller is still using the deprecated \u0027get_binding_levels\u0027 method and passing in a non-OVO object type to here? If yes, this call will break.","commit_id":"24fc794a97200dd0a4fc3ad02cef4c0bb2341315"},{"author":{"_account_id":11975,"name":"Slawek Kaplonski","email":"skaplons@redhat.com","username":"slaweq"},"change_message_id":"6371049c0bae85394a46168e1716b48daad549f2","unresolved":false,"context_lines":[{"line_number":55,"context_line":"def set_binding_levels(context, levels):"},{"line_number":56,"context_line":"    if levels:"},{"line_number":57,"context_line":"        for level in levels:"},{"line_number":58,"context_line":"            level.create()"},{"line_number":59,"context_line":"        LOG.debug(\"For port %(port_id)s, host %(host)s, \""},{"line_number":60,"context_line":"                  \"set binding levels %(levels)s\","},{"line_number":61,"context_line":"                  {\u0027port_id\u0027: levels[0].port_id,"}],"source_content_type":"text/x-python","patch_set":63,"id":"3f79a3b5_94edb5f1","line":58,"range":{"start_line":58,"start_character":18,"end_line":58,"end_character":24},"in_reply_to":"3f79a3b5_a029a59b","updated":"2018-08-13 13:23:48.000000000","message":"As I checked there is no any callers who do that: http://codesearch.openstack.org/?q\u003dset_binding_levels\u0026i\u003dnope\u0026files\u003d\u0026repos\u003d so it should be good","commit_id":"24fc794a97200dd0a4fc3ad02cef4c0bb2341315"},{"author":{"_account_id":13995,"name":"Nate Johnston","email":"nate.johnston@redhat.com","username":"natejohnston"},"change_message_id":"7650b79cb9acd8e2529da1f0b45bd52ee596093b","unresolved":false,"context_lines":[{"line_number":339,"context_line":"        # don\u0027t check for network deletes"},{"line_number":340,"context_line":"        return"},{"line_number":341,"context_line":""},{"line_number":342,"context_line":"    with db_api.context_manager.reader.using(context):"},{"line_number":343,"context_line":"        segment_id \u003d segment[\u0027id\u0027]"},{"line_number":344,"context_line":"        port_ids \u003d port_obj.Port.get_port_ids_filter_by_segment_id("},{"line_number":345,"context_line":"            context, segment_id\u003dsegment_id)"}],"source_content_type":"text/x-python","patch_set":65,"id":"3f79a3b5_b6277dca","line":342,"range":{"start_line":342,"start_character":0,"end_line":342,"end_character":54},"updated":"2018-08-14 15:06:33.000000000","message":"When using OVOs, this line should not be necessary","commit_id":"3af64a3f9817896f917950e0940cb8de8c957b2f"},{"author":{"_account_id":11975,"name":"Slawek Kaplonski","email":"skaplons@redhat.com","username":"slaweq"},"change_message_id":"3d784100702fc99ff99ce42fabc162fc5c4ca79d","unresolved":false,"context_lines":[{"line_number":339,"context_line":"        # don\u0027t check for network deletes"},{"line_number":340,"context_line":"        return"},{"line_number":341,"context_line":""},{"line_number":342,"context_line":"    with db_api.context_manager.reader.using(context):"},{"line_number":343,"context_line":"        segment_id \u003d segment[\u0027id\u0027]"},{"line_number":344,"context_line":"        port_ids \u003d port_obj.Port.get_port_ids_filter_by_segment_id("},{"line_number":345,"context_line":"            context, segment_id\u003dsegment_id)"}],"source_content_type":"text/x-python","patch_set":65,"id":"3f79a3b5_7c399ba1","line":342,"range":{"start_line":342,"start_character":0,"end_line":342,"end_character":54},"in_reply_to":"3f79a3b5_b6277dca","updated":"2018-08-16 08:23:25.000000000","message":"Done","commit_id":"3af64a3f9817896f917950e0940cb8de8c957b2f"},{"author":{"_account_id":4694,"name":"Miguel Lavalle","email":"miguel@mlavalle.com","username":"minsel"},"change_message_id":"b8495c8c4a59e29eacbf418966aadc684ccd4313","unresolved":false,"context_lines":[{"line_number":321,"context_line":"        # don\u0027t check for network deletes"},{"line_number":322,"context_line":"        return"},{"line_number":323,"context_line":""},{"line_number":324,"context_line":"    with db_api.context_manager.reader.using(context):"},{"line_number":325,"context_line":"        segment_id \u003d segment[\u0027id\u0027]"},{"line_number":326,"context_line":"        query \u003d context.session.query(models_v2.Port)"},{"line_number":327,"context_line":"        query \u003d query.join("}],"source_content_type":"text/x-python","patch_set":69,"id":"3f79a3b5_342381a9","side":"PARENT","line":324,"range":{"start_line":324,"start_character":3,"end_line":324,"end_character":54},"updated":"2018-08-23 21:36:42.000000000","message":"so what happens to the reader DB transaction? I don\u0027t see that we have a with statement in https://review.openstack.org/#/c/382037/69/neutron/objects/ports.py@411. If we are assuming the caller will provide the DB isolation, I suggest we document that assumption with a comment here","commit_id":"4d767a78763f2252b9bf78286cc5b5bbf26af509"},{"author":{"_account_id":11975,"name":"Slawek Kaplonski","email":"skaplons@redhat.com","username":"slaweq"},"change_message_id":"5f739572dc4770d70f2cb2adeb48a19c13f44dd0","unresolved":false,"context_lines":[{"line_number":321,"context_line":"        # don\u0027t check for network deletes"},{"line_number":322,"context_line":"        return"},{"line_number":323,"context_line":""},{"line_number":324,"context_line":"    with db_api.context_manager.reader.using(context):"},{"line_number":325,"context_line":"        segment_id \u003d segment[\u0027id\u0027]"},{"line_number":326,"context_line":"        query \u003d context.session.query(models_v2.Port)"},{"line_number":327,"context_line":"        query \u003d query.join("}],"source_content_type":"text/x-python","patch_set":69,"id":"3f79a3b5_1041a339","side":"PARENT","line":324,"range":{"start_line":324,"start_character":3,"end_line":324,"end_character":54},"in_reply_to":"3f79a3b5_342381a9","updated":"2018-08-24 13:14:39.000000000","message":"You\u0027re right. I added decorator with reader context_manager","commit_id":"4d767a78763f2252b9bf78286cc5b5bbf26af509"},{"author":{"_account_id":17120,"name":"Manjeet Singh Bhatia","email":"manjeet.s.bhatia@intel.com","username":"manjeets"},"change_message_id":"350d2c80dac94489bc954a57d30e26264faca50a","unresolved":false,"context_lines":[{"line_number":52,"context_line":""},{"line_number":53,"context_line":""},{"line_number":54,"context_line":"@db_api.context_manager.writer"},{"line_number":55,"context_line":"def set_binding_levels(context, levels):"},{"line_number":56,"context_line":"    if levels:"},{"line_number":57,"context_line":"        for level in levels:"},{"line_number":58,"context_line":"            level.create()"}],"source_content_type":"text/x-python","patch_set":70,"id":"3f79a3b5_332dbffd","line":55,"range":{"start_line":55,"start_character":23,"end_line":55,"end_character":30},"updated":"2018-08-24 18:42:04.000000000","message":"is this argument still needed ?","commit_id":"fe91af43d07394e0ad06fe67a74e1a0363c88e24"},{"author":{"_account_id":11975,"name":"Slawek Kaplonski","email":"skaplons@redhat.com","username":"slaweq"},"change_message_id":"8e06e94766bf33fd51d7288cdfd4fd984f4ae02d","unresolved":false,"context_lines":[{"line_number":52,"context_line":""},{"line_number":53,"context_line":""},{"line_number":54,"context_line":"@db_api.context_manager.writer"},{"line_number":55,"context_line":"def set_binding_levels(context, levels):"},{"line_number":56,"context_line":"    if levels:"},{"line_number":57,"context_line":"        for level in levels:"},{"line_number":58,"context_line":"            level.create()"}],"source_content_type":"text/x-python","patch_set":70,"id":"3f79a3b5_0ac15254","line":55,"range":{"start_line":55,"start_character":23,"end_line":55,"end_character":30},"in_reply_to":"3f79a3b5_332dbffd","updated":"2018-08-27 09:48:28.000000000","message":"yes, for writer decorator","commit_id":"fe91af43d07394e0ad06fe67a74e1a0363c88e24"},{"author":{"_account_id":1131,"name":"Brian Haley","email":"haleyb.dev@gmail.com","username":"brian-haley"},"change_message_id":"c6fd3ca688492d4337764963c0af6f0e5f457431","unresolved":false,"context_lines":[{"line_number":65,"context_line":"        LOG.debug(\"Attempted to set empty binding levels\")"},{"line_number":66,"context_line":""},{"line_number":67,"context_line":""},{"line_number":68,"context_line":"@removals.remove("},{"line_number":69,"context_line":"    message\u003d\"Function get_binding_levels is deprecated. Please use \""},{"line_number":70,"context_line":"            \"get_binding_level_objs instead as it makes use of OVOs.\")"},{"line_number":71,"context_line":"@db_api.context_manager.reader"}],"source_content_type":"text/x-python","patch_set":72,"id":"3f79a3b5_912f4787","line":68,"updated":"2018-09-02 03:00:39.000000000","message":"There should actually be a:\n\nversion\u003d\u0027Stein\u0027, removal_version\u003d\u0027T\u0027\n\nThat way we\u0027ll know when it\u0027s safe to remove it.","commit_id":"d6409594020297c0265c08cc4a55ffea5b6a7448"},{"author":{"_account_id":11975,"name":"Slawek Kaplonski","email":"skaplons@redhat.com","username":"slaweq"},"change_message_id":"f27b4449c6a94c65917dfa6346340429c98d2c23","unresolved":false,"context_lines":[{"line_number":65,"context_line":"        LOG.debug(\"Attempted to set empty binding levels\")"},{"line_number":66,"context_line":""},{"line_number":67,"context_line":""},{"line_number":68,"context_line":"@removals.remove("},{"line_number":69,"context_line":"    message\u003d\"Function get_binding_levels is deprecated. Please use \""},{"line_number":70,"context_line":"            \"get_binding_level_objs instead as it makes use of OVOs.\")"},{"line_number":71,"context_line":"@db_api.context_manager.reader"}],"source_content_type":"text/x-python","patch_set":72,"id":"3f79a3b5_785cb94a","line":68,"in_reply_to":"3f79a3b5_912f4787","updated":"2018-09-04 07:51:00.000000000","message":"Good point. Added","commit_id":"d6409594020297c0265c08cc4a55ffea5b6a7448"}],"neutron/plugins/ml2/driver_context.py":[{"author":{"_account_id":15518,"name":"Artur Korzeniewski","email":"artur.korzen@wp.pl","username":"akorzeni"},"change_message_id":"00ae12c37911684d45b3081b3486572bc8c62f6e","unresolved":false,"context_lines":[{"line_number":158,"context_line":"        if self._binding_levels:"},{"line_number":159,"context_line":"            return [{"},{"line_number":160,"context_line":"                api.BOUND_DRIVER: level.driver,"},{"line_number":161,"context_line":"                api.BOUND_SEGMENT: self._expand_segment(level.segment.id)"},{"line_number":162,"context_line":"            } for level in self._binding_levels]"},{"line_number":163,"context_line":""},{"line_number":164,"context_line":"    @property"}],"source_content_type":"text/x-python","patch_set":23,"id":"5a74a57a_d294fce9","line":161,"updated":"2016-11-23 14:20:57.000000000","message":"It is something that is failing without this change? \nAfter introduction of segment_id to Port Binding Level?","commit_id":"fbdbd0d47f48de9db9ccb4f4c230cd090ae3c954"},{"author":{"_account_id":22774,"name":"Shashank Kumar Shankar","email":"shashank.kumar.shankar@intel.com","username":"skshankar"},"change_message_id":"fff6e26320e237f9976efa56ab41ee662d666c36","unresolved":false,"context_lines":[{"line_number":158,"context_line":"        if self._binding_levels:"},{"line_number":159,"context_line":"            return [{"},{"line_number":160,"context_line":"                api.BOUND_DRIVER: level.driver,"},{"line_number":161,"context_line":"                api.BOUND_SEGMENT: self._expand_segment(level.segment.id)"},{"line_number":162,"context_line":"            } for level in self._binding_levels]"},{"line_number":163,"context_line":""},{"line_number":164,"context_line":"    @property"}],"source_content_type":"text/x-python","patch_set":23,"id":"5a74a57a_f662b5d7","line":161,"in_reply_to":"5a74a57a_d294fce9","updated":"2016-11-23 17:38:11.000000000","message":"Done. Replaced back to segment_id since it was introduced in the OVO. But it makes me wonder, what\u0027s the point of having the synthetic field anyway.","commit_id":"fbdbd0d47f48de9db9ccb4f4c230cd090ae3c954"},{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"2811360781ebd447d2924b9011432611133fe73d","unresolved":false,"context_lines":[{"line_number":158,"context_line":"        if self._binding_levels:"},{"line_number":159,"context_line":"            return [{"},{"line_number":160,"context_line":"                api.BOUND_DRIVER: level.driver,"},{"line_number":161,"context_line":"                api.BOUND_SEGMENT: self._expand_segment(level.segment.id)"},{"line_number":162,"context_line":"            } for level in self._binding_levels]"},{"line_number":163,"context_line":""},{"line_number":164,"context_line":"    @property"}],"source_content_type":"text/x-python","patch_set":27,"id":"3a71b18c_59d45cbc","line":161,"updated":"2016-12-08 18:21:53.000000000","message":"Yep! Thanks!","commit_id":"fc5e999ea1a31ee6f6b4641d01ac8e49d43c697e"},{"author":{"_account_id":27654,"name":"Hongbin Lu","email":"kira034@163.com","username":"hongbin.lu"},"change_message_id":"3db7d38fd49f8b82fb20430bc235c2c818036d19","unresolved":false,"context_lines":[{"line_number":131,"context_line":"                plugin, plugin_context, network) if network else None"},{"line_number":132,"context_line":"        # NOTE(kevinbenton): InstanceSnapshot can go away once we are working"},{"line_number":133,"context_line":"        # with OVO objects instead of native SQLA objects."},{"line_number":134,"context_line":"        self._binding \u003d InstanceSnapshot(binding)"},{"line_number":135,"context_line":"        self._binding_levels \u003d binding_levels or []"},{"line_number":136,"context_line":"        self._segments_to_bind \u003d None"},{"line_number":137,"context_line":"        self._new_bound_segment \u003d None"}],"source_content_type":"text/x-python","patch_set":63,"id":"3f79a3b5_a0a68552","line":134,"range":{"start_line":134,"start_character":24,"end_line":134,"end_character":40},"updated":"2018-08-10 22:40:55.000000000","message":"Just wondering. Could we let the InstanceSnapshot go away in here as well?","commit_id":"24fc794a97200dd0a4fc3ad02cef4c0bb2341315"},{"author":{"_account_id":11975,"name":"Slawek Kaplonski","email":"skaplons@redhat.com","username":"slaweq"},"change_message_id":"6371049c0bae85394a46168e1716b48daad549f2","unresolved":false,"context_lines":[{"line_number":131,"context_line":"                plugin, plugin_context, network) if network else None"},{"line_number":132,"context_line":"        # NOTE(kevinbenton): InstanceSnapshot can go away once we are working"},{"line_number":133,"context_line":"        # with OVO objects instead of native SQLA objects."},{"line_number":134,"context_line":"        self._binding \u003d InstanceSnapshot(binding)"},{"line_number":135,"context_line":"        self._binding_levels \u003d binding_levels or []"},{"line_number":136,"context_line":"        self._segments_to_bind \u003d None"},{"line_number":137,"context_line":"        self._new_bound_segment \u003d None"}],"source_content_type":"text/x-python","patch_set":63,"id":"3f79a3b5_71903644","line":134,"range":{"start_line":134,"start_character":24,"end_line":134,"end_character":40},"in_reply_to":"3f79a3b5_a0a68552","updated":"2018-08-13 13:23:48.000000000","message":"this patch switches binding_levels to OVO, not binding. So I think that this will be changed in patch which will switch to use \"binding\" OVO","commit_id":"24fc794a97200dd0a4fc3ad02cef4c0bb2341315"},{"author":{"_account_id":4694,"name":"Miguel Lavalle","email":"miguel@mlavalle.com","username":"minsel"},"change_message_id":"b8495c8c4a59e29eacbf418966aadc684ccd4313","unresolved":false,"context_lines":[{"line_number":132,"context_line":"        # NOTE(kevinbenton): InstanceSnapshot can go away once we are working"},{"line_number":133,"context_line":"        # with OVO objects instead of native SQLA objects."},{"line_number":134,"context_line":"        self._binding \u003d InstanceSnapshot(binding)"},{"line_number":135,"context_line":"        self._binding_levels \u003d [InstanceSnapshot(l)"},{"line_number":136,"context_line":"                                for l in (binding_levels or [])]"},{"line_number":137,"context_line":"        self._segments_to_bind \u003d None"},{"line_number":138,"context_line":"        self._new_bound_segment \u003d None"}],"source_content_type":"text/x-python","patch_set":69,"id":"3f79a3b5_d44a4d25","side":"PARENT","line":135,"range":{"start_line":135,"start_character":32,"end_line":135,"end_character":47},"updated":"2018-08-23 21:36:42.000000000","message":"Please see comment to https://github.com/openstack/neutron/blob/master/neutron/plugins/ml2/driver_context.py#L29. I get that now we are going to be adding port binding level objects, but are we sure those objects don\u0027t hold references to DB objects?","commit_id":"4d767a78763f2252b9bf78286cc5b5bbf26af509"},{"author":{"_account_id":11975,"name":"Slawek Kaplonski","email":"skaplons@redhat.com","username":"slaweq"},"change_message_id":"5f739572dc4770d70f2cb2adeb48a19c13f44dd0","unresolved":false,"context_lines":[{"line_number":132,"context_line":"        # NOTE(kevinbenton): InstanceSnapshot can go away once we are working"},{"line_number":133,"context_line":"        # with OVO objects instead of native SQLA objects."},{"line_number":134,"context_line":"        self._binding \u003d InstanceSnapshot(binding)"},{"line_number":135,"context_line":"        self._binding_levels \u003d [InstanceSnapshot(l)"},{"line_number":136,"context_line":"                                for l in (binding_levels or [])]"},{"line_number":137,"context_line":"        self._segments_to_bind \u003d None"},{"line_number":138,"context_line":"        self._new_bound_segment \u003d None"}],"source_content_type":"text/x-python","patch_set":69,"id":"3f79a3b5_b0e22fd4","side":"PARENT","line":135,"range":{"start_line":135,"start_character":32,"end_line":135,"end_character":47},"in_reply_to":"3f79a3b5_d44a4d25","updated":"2018-08-24 13:14:39.000000000","message":"I think that InstanceSnapshot object is not designed to work with OVO objects at all. Where it can have such references?\n\nBut I see other problem here now. We can break groupbasedpolicy project with this change because of: http://git.openstack.org/cgit/openstack/group-based-policy/tree/gbpservice/neutron/plugins/ml2plus/drivers/apic_aim/mechanism_driver.py#n3969\n\nDo You think I should add here \"if\" conditions to check if it\u0027s db object or OVO?","commit_id":"4d767a78763f2252b9bf78286cc5b5bbf26af509"},{"author":{"_account_id":4694,"name":"Miguel Lavalle","email":"miguel@mlavalle.com","username":"minsel"},"change_message_id":"b8495c8c4a59e29eacbf418966aadc684ccd4313","unresolved":false,"context_lines":[{"line_number":159,"context_line":"        self._binding_levels \u003d []"},{"line_number":160,"context_line":""},{"line_number":161,"context_line":"    def _push_binding_level(self, binding_level):"},{"line_number":162,"context_line":"        self._binding_levels.append(InstanceSnapshot(binding_level))"},{"line_number":163,"context_line":""},{"line_number":164,"context_line":"    def _pop_binding_level(self):"},{"line_number":165,"context_line":"        return self._binding_levels.pop()"}],"source_content_type":"text/x-python","patch_set":69,"id":"3f79a3b5_945055d7","side":"PARENT","line":162,"updated":"2018-08-23 21:36:42.000000000","message":"Based on http://codesearch.openstack.org/?q\u003d_push_binding_level\u0026i\u003dnope\u0026files\u003d\u0026repos\u003d, this one seems safe because this method is only called from https://review.openstack.org/#/c/382037/69/neutron/plugins/ml2/managers.py@794 and we haven\u0027t performed DB operations yet in the OVO involved. However, maybe we need to add a comment to the method, warning callers that binding_level is an OVO with no reference to DB objects","commit_id":"4d767a78763f2252b9bf78286cc5b5bbf26af509"},{"author":{"_account_id":11975,"name":"Slawek Kaplonski","email":"skaplons@redhat.com","username":"slaweq"},"change_message_id":"5f739572dc4770d70f2cb2adeb48a19c13f44dd0","unresolved":false,"context_lines":[{"line_number":159,"context_line":"        self._binding_levels \u003d []"},{"line_number":160,"context_line":""},{"line_number":161,"context_line":"    def _push_binding_level(self, binding_level):"},{"line_number":162,"context_line":"        self._binding_levels.append(InstanceSnapshot(binding_level))"},{"line_number":163,"context_line":""},{"line_number":164,"context_line":"    def _pop_binding_level(self):"},{"line_number":165,"context_line":"        return self._binding_levels.pop()"}],"source_content_type":"text/x-python","patch_set":69,"id":"3f79a3b5_cb55c01f","side":"PARENT","line":162,"in_reply_to":"3f79a3b5_945055d7","updated":"2018-08-24 13:14:39.000000000","message":"Done","commit_id":"4d767a78763f2252b9bf78286cc5b5bbf26af509"},{"author":{"_account_id":17120,"name":"Manjeet Singh Bhatia","email":"manjeet.s.bhatia@intel.com","username":"manjeets"},"change_message_id":"350d2c80dac94489bc954a57d30e26264faca50a","unresolved":false,"context_lines":[{"line_number":129,"context_line":"        else:"},{"line_number":130,"context_line":"            self._network_context \u003d NetworkContext("},{"line_number":131,"context_line":"                plugin, plugin_context, network) if network else None"},{"line_number":132,"context_line":"        # NOTE(kevinbenton): InstanceSnapshot can go away once we are working"},{"line_number":133,"context_line":"        # with OVO objects instead of native SQLA objects."},{"line_number":134,"context_line":"        self._binding \u003d InstanceSnapshot(binding)"},{"line_number":135,"context_line":"        self._binding_levels \u003d binding_levels or []"},{"line_number":136,"context_line":"        self._segments_to_bind \u003d None"}],"source_content_type":"text/x-python","patch_set":70,"id":"3f79a3b5_f3c987ab","line":133,"range":{"start_line":132,"start_character":7,"end_line":133,"end_character":58},"updated":"2018-08-24 18:42:04.000000000","message":"and this Note should also go away now that Instance Snapshot are not in use ? or a Note can be changed to reflect that change has been done for future reference","commit_id":"fe91af43d07394e0ad06fe67a74e1a0363c88e24"},{"author":{"_account_id":11975,"name":"Slawek Kaplonski","email":"skaplons@redhat.com","username":"slaweq"},"change_message_id":"8e06e94766bf33fd51d7288cdfd4fd984f4ae02d","unresolved":false,"context_lines":[{"line_number":129,"context_line":"        else:"},{"line_number":130,"context_line":"            self._network_context \u003d NetworkContext("},{"line_number":131,"context_line":"                plugin, plugin_context, network) if network else None"},{"line_number":132,"context_line":"        # NOTE(kevinbenton): InstanceSnapshot can go away once we are working"},{"line_number":133,"context_line":"        # with OVO objects instead of native SQLA objects."},{"line_number":134,"context_line":"        self._binding \u003d InstanceSnapshot(binding)"},{"line_number":135,"context_line":"        self._binding_levels \u003d binding_levels or []"},{"line_number":136,"context_line":"        self._segments_to_bind \u003d None"}],"source_content_type":"text/x-python","patch_set":70,"id":"3f79a3b5_efde680f","line":133,"range":{"start_line":132,"start_character":7,"end_line":133,"end_character":58},"in_reply_to":"3f79a3b5_f3c987ab","updated":"2018-08-27 09:48:28.000000000","message":"But for self._binding it is still used so IMO this comment is perfectly valid here.","commit_id":"fe91af43d07394e0ad06fe67a74e1a0363c88e24"},{"author":{"_account_id":17120,"name":"Manjeet Singh Bhatia","email":"manjeet.s.bhatia@intel.com","username":"manjeets"},"change_message_id":"350d2c80dac94489bc954a57d30e26264faca50a","unresolved":false,"context_lines":[{"line_number":158,"context_line":"        self._binding_levels \u003d []"},{"line_number":159,"context_line":""},{"line_number":160,"context_line":"    def _push_binding_level(self, binding_level):"},{"line_number":161,"context_line":"        # NOTE(slaweq): bindin_level should be always OVO with no reference to"},{"line_number":162,"context_line":"        # DB object"},{"line_number":163,"context_line":"        self._binding_levels.append(binding_level)"},{"line_number":164,"context_line":""}],"source_content_type":"text/x-python","patch_set":70,"id":"3f79a3b5_b3c78f96","line":161,"range":{"start_line":161,"start_character":24,"end_line":161,"end_character":30},"updated":"2018-08-24 18:42:04.000000000","message":"binding ?","commit_id":"fe91af43d07394e0ad06fe67a74e1a0363c88e24"},{"author":{"_account_id":11975,"name":"Slawek Kaplonski","email":"skaplons@redhat.com","username":"slaweq"},"change_message_id":"8e06e94766bf33fd51d7288cdfd4fd984f4ae02d","unresolved":false,"context_lines":[{"line_number":158,"context_line":"        self._binding_levels \u003d []"},{"line_number":159,"context_line":""},{"line_number":160,"context_line":"    def _push_binding_level(self, binding_level):"},{"line_number":161,"context_line":"        # NOTE(slaweq): bindin_level should be always OVO with no reference to"},{"line_number":162,"context_line":"        # DB object"},{"line_number":163,"context_line":"        self._binding_levels.append(binding_level)"},{"line_number":164,"context_line":""}],"source_content_type":"text/x-python","patch_set":70,"id":"3f79a3b5_4ac2ea54","line":161,"range":{"start_line":161,"start_character":24,"end_line":161,"end_character":30},"in_reply_to":"3f79a3b5_b3c78f96","updated":"2018-08-27 09:48:28.000000000","message":"Done","commit_id":"fe91af43d07394e0ad06fe67a74e1a0363c88e24"}],"neutron/plugins/ml2/managers.py":[{"author":{"_account_id":4694,"name":"Miguel Lavalle","email":"miguel@mlavalle.com","username":"minsel"},"change_message_id":"029930af0e3a696afe40589292fbf494f3e8dc0d","unresolved":false,"context_lines":[{"line_number":788,"context_line":"                driver.obj.bind_port(context)"},{"line_number":789,"context_line":"                segment \u003d context._new_bound_segment"},{"line_number":790,"context_line":"                if segment:"},{"line_number":791,"context_line":"                    pbl_obj \u003d ports.PortBindingLevel.get_object(context,"},{"line_number":792,"context_line":"                                                      port_id\u003dport_id,"},{"line_number":793,"context_line":"                                                      host\u003dcontext.host,"},{"line_number":794,"context_line":"                                                      level\u003dlevel,"}],"source_content_type":"text/x-python","patch_set":7,"id":"1a95cdbc_4d51c035","line":791,"range":{"start_line":791,"start_character":64,"end_line":791,"end_character":72},"updated":"2016-10-06 22:51:35.000000000","message":"Looking at this makes me wonder is the scope of your patcshet is the right one. These are the facts that lead me to conclude this:\n\n1) This method is called by bind_port in L738 above. This latter method is called from the ML2 plugin here https://github.com/openstack/neutron/blob/master/neutron/plugins/ml2/plugin.py#L428\n\n2) We then return to https://github.com/openstack/neutron/blob/master/neutron/plugins/ml2/plugin.py#L397\n\n3) Which returns to https://github.com/openstack/neutron/blob/master/neutron/plugins/ml2/plugin.py#L363. At this point, if the binding was successful, the binding is committed to the DB: https://github.com/openstack/neutron/blob/master/neutron/plugins/ml2/plugin.py#L363\n\n4) Only then then, the binding levels are written to the DB: https://github.com/openstack/neutron/blob/master/neutron/plugins/ml2/plugin.py#L509, by calling db.set_binding_levels. This is the only call in the whole code base to db.set_binding_levels and it happens after the code you are changing here. So if you get the binding levels here, you are going to get None (I ran one of the unit test cases)\n\nI think you patchset also needs to contemplate modifying https://github.com/openstack/neutron/blob/master/neutron/plugins/ml2/db.py#L100. Otherwise, the binding levels will never get to the DB.\n\nAm I missing something?","commit_id":"79a256fc5bfcea9a9cff3ba1dd3b2c29bc8114f0"},{"author":{"_account_id":4694,"name":"Miguel Lavalle","email":"miguel@mlavalle.com","username":"minsel"},"change_message_id":"125dbc66e9cc56a9400e34cb3d45aa763c051009","unresolved":false,"context_lines":[{"line_number":788,"context_line":"                driver.obj.bind_port(context)"},{"line_number":789,"context_line":"                segment \u003d context._new_bound_segment"},{"line_number":790,"context_line":"                if segment:"},{"line_number":791,"context_line":"                    pbl_obj \u003d ports.PortBindingLevel.get_object(context,"},{"line_number":792,"context_line":"                                                      port_id\u003dport_id,"},{"line_number":793,"context_line":"                                                      host\u003dcontext.host,"},{"line_number":794,"context_line":"                                                      level\u003dlevel,"}],"source_content_type":"text/x-python","patch_set":7,"id":"1a95cdbc_1eed1cef","line":791,"range":{"start_line":791,"start_character":64,"end_line":791,"end_character":72},"in_reply_to":"1a95cdbc_4d51c035","updated":"2016-10-07 00:08:20.000000000","message":"To clarify further, here you just need to create the PortBindingLevel object so it gets pushed to the PortContext in L797. From there, the port binding levels will be written to the DB when the port binding is committed to the DB here: https://github.com/openstack/neutron/blob/master/neutron/plugins/ml2/plugin.py#L509.","commit_id":"79a256fc5bfcea9a9cff3ba1dd3b2c29bc8114f0"},{"author":{"_account_id":4694,"name":"Miguel Lavalle","email":"miguel@mlavalle.com","username":"minsel"},"change_message_id":"20029cc918a08f10747eef1b288b8c6cb62478b8","unresolved":false,"context_lines":[{"line_number":794,"context_line":"                        host\u003dcontext.host,"},{"line_number":795,"context_line":"                        level\u003dlevel,"},{"line_number":796,"context_line":"                        driver\u003ddriver.name,"},{"line_number":797,"context_line":"                        segment\u003dsegments_to_bind)"},{"line_number":798,"context_line":"                    context._push_binding_level(pbl_obj)"},{"line_number":799,"context_line":"                    next_segments \u003d context._next_segments_to_bind"},{"line_number":800,"context_line":"                    if next_segments:"}],"source_content_type":"text/x-python","patch_set":10,"id":"fa6399be_a31108b2","line":797,"updated":"2016-10-10 21:09:43.000000000","message":"segments_to_bind contains a list of segments that looks like this:\n\n[{\u0027segmentation_id\u0027: None, \u0027physical_network\u0027: None, \u0027id\u0027: u\u0027a224b90e-3cf1-4990-8314-ca103b13a2d8\u0027, \u0027network_type\u0027: u\u0027local\u0027}]\n\nSo here, when you try to assign segments_to_bind to the segment attribute of PortBindingLevel you get this traceback (don\u0027t pay attention to the lines number because I added some LOG statements for debugging purposes): http://paste.openstack.org/show/585245/\n\nWhat you need to assign here is a NetworkSegment object. Right before L791 (inside the if statement) I created one as follows: \n\n                    segment_obj \u003d network_obj.NetworkSegment(\n                          id\u003dsegment,\n                          network_id\u003dcontext._network_context._network[\u0027id\u0027],\n                          network_type\u003dsegments_to_bind_dict[segment][\n                              \u0027network_type\u0027],\n                          physical_network\u003dsegments_to_bind_dict[segment][\n                              \u0027physical_network\u0027],\n                          segmentation_id\u003dsegments_to_bind_dict[segment][\n                              \u0027segmentation_id\u0027])\n\nPlease note that to be able to do this, I think a change is required here: https://github.com/openstack/neutron/blob/master/neutron/objects/network.py#L43. name should be nullable, just as it is in the DB model: https://github.com/openstack/neutron/blob/master/neutron/db/models/segment.py#L50\n\nWith this, you can change L797 to:\n\nsegment\u003dsegment_obj)","commit_id":"24246c0282451e4afc07670ef3c753e9e162db06"},{"author":{"_account_id":22774,"name":"Shashank Kumar Shankar","email":"shashank.kumar.shankar@intel.com","username":"skshankar"},"change_message_id":"6760bcda4bc9b0e1e8df69c62455ecb3db1c0110","unresolved":false,"context_lines":[{"line_number":794,"context_line":"                        host\u003dcontext.host,"},{"line_number":795,"context_line":"                        level\u003dlevel,"},{"line_number":796,"context_line":"                        driver\u003ddriver.name,"},{"line_number":797,"context_line":"                        segment\u003dsegments_to_bind)"},{"line_number":798,"context_line":"                    context._push_binding_level(pbl_obj)"},{"line_number":799,"context_line":"                    next_segments \u003d context._next_segments_to_bind"},{"line_number":800,"context_line":"                    if next_segments:"}],"source_content_type":"text/x-python","patch_set":10,"id":"fa6399be_479acd15","line":797,"in_reply_to":"fa6399be_a31108b2","updated":"2016-10-11 16:52:24.000000000","message":"Done","commit_id":"24246c0282451e4afc07670ef3c753e9e162db06"},{"author":{"_account_id":6951,"name":"Brandon Logan","email":"brandon.logan@rackspace.com","username":"brandon-logan"},"change_message_id":"ac11b7448691f918c654a0cb058de465de4dd966","unresolved":false,"context_lines":[{"line_number":804,"context_line":"                        level\u003dlevel,"},{"line_number":805,"context_line":"                        driver\u003ddriver.name,"},{"line_number":806,"context_line":"                        segment\u003dsegment_obj)"},{"line_number":807,"context_line":"                    context._push_binding_level(pbl_obj)"},{"line_number":808,"context_line":"                    next_segments \u003d context._next_segments_to_bind"},{"line_number":809,"context_line":"                    if next_segments:"},{"line_number":810,"context_line":"                        # Continue binding another level."}],"source_content_type":"text/x-python","patch_set":11,"id":"fa6399be_ed81ff4b","line":807,"updated":"2016-10-11 18:38:35.000000000","message":"I am not a fan of changing this code to use segments_to_bind[0] instead of just filtering by segment_id.  Is there anyway to just create the NetworkSegment with only the id field populated?\n\nIf not, I wonder if we should revisit the decision to have the PortBindingLevel object have segment where the PortBindingLevel sqlalchemy model has segment_id.","commit_id":"dd438113f7035be2706723eaa0247f939d29aead"},{"author":{"_account_id":6951,"name":"Brandon Logan","email":"brandon.logan@rackspace.com","username":"brandon-logan"},"change_message_id":"f72830e8a39f8cb1791f1c69de17d7099400be8c","unresolved":false,"context_lines":[{"line_number":804,"context_line":"                        level\u003dlevel,"},{"line_number":805,"context_line":"                        driver\u003ddriver.name,"},{"line_number":806,"context_line":"                        segment\u003dsegment_obj)"},{"line_number":807,"context_line":"                    context._push_binding_level(pbl_obj)"},{"line_number":808,"context_line":"                    next_segments \u003d context._next_segments_to_bind"},{"line_number":809,"context_line":"                    if next_segments:"},{"line_number":810,"context_line":"                        # Continue binding another level."}],"source_content_type":"text/x-python","patch_set":11,"id":"fa6399be_c13cd8e4","line":807,"in_reply_to":"fa6399be_397899f2","updated":"2016-10-12 16:49:27.000000000","message":"Yeah, I think the best way would be to just make the object have segment_id just like the model, but I\u0027m not sure if there was some reason I\u0027m unaware of for doing this.\n\nI\u0027d rather explore doing that first before resorting to this particular change.","commit_id":"dd438113f7035be2706723eaa0247f939d29aead"},{"author":{"_account_id":22774,"name":"Shashank Kumar Shankar","email":"shashank.kumar.shankar@intel.com","username":"skshankar"},"change_message_id":"1ba65efeab27f0c1fc46794c400501b72500b038","unresolved":false,"context_lines":[{"line_number":804,"context_line":"                        level\u003dlevel,"},{"line_number":805,"context_line":"                        driver\u003ddriver.name,"},{"line_number":806,"context_line":"                        segment\u003dsegment_obj)"},{"line_number":807,"context_line":"                    context._push_binding_level(pbl_obj)"},{"line_number":808,"context_line":"                    next_segments \u003d context._next_segments_to_bind"},{"line_number":809,"context_line":"                    if next_segments:"},{"line_number":810,"context_line":"                        # Continue binding another level."}],"source_content_type":"text/x-python","patch_set":11,"id":"fa6399be_d413ad0b","line":807,"in_reply_to":"fa6399be_c13cd8e4","updated":"2016-10-12 21:50:28.000000000","message":"I have introduced the segment_id in PS12. But it seems like the ml2 plugin unit test errors are similar to when the NetworkSegment synthetic field was present.","commit_id":"dd438113f7035be2706723eaa0247f939d29aead"},{"author":{"_account_id":4694,"name":"Miguel Lavalle","email":"miguel@mlavalle.com","username":"minsel"},"change_message_id":"d632befdfcf7d131c133c78f48e17c157a49643f","unresolved":false,"context_lines":[{"line_number":804,"context_line":"                        level\u003dlevel,"},{"line_number":805,"context_line":"                        driver\u003ddriver.name,"},{"line_number":806,"context_line":"                        segment\u003dsegment_obj)"},{"line_number":807,"context_line":"                    context._push_binding_level(pbl_obj)"},{"line_number":808,"context_line":"                    next_segments \u003d context._next_segments_to_bind"},{"line_number":809,"context_line":"                    if next_segments:"},{"line_number":810,"context_line":"                        # Continue binding another level."}],"source_content_type":"text/x-python","patch_set":11,"id":"fa6399be_397899f2","line":807,"in_reply_to":"fa6399be_ed81ff4b","updated":"2016-10-11 20:54:08.000000000","message":"Based on the object definition for NetworkSegment (https://github.com/openstack/neutron/blob/master/neutron/objects/network.py#L34) the minimum you need is id, network_id, and network_type. I suggested the change in https://review.openstack.org/#/c/382037/11/neutron/objects/network.py@43 to remove name from this required minimum.\n\nIn an earlier review, I already suggested reviewing the decision to store the segment in PortBindingLevel and store segment_id instead, precisely to minimize the impact on code that uses this object. I still favor that approach","commit_id":"dd438113f7035be2706723eaa0247f939d29aead"},{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"e68b882ca7fdd6acc870df1ddaf10ec72bc822e3","unresolved":false,"context_lines":[{"line_number":793,"context_line":"                        host\u003dcontext.host,"},{"line_number":794,"context_line":"                        level\u003dlevel,"},{"line_number":795,"context_line":"                        driver\u003ddriver.name,"},{"line_number":796,"context_line":"                        segment_id\u003dsegment)"},{"line_number":797,"context_line":"                    context._push_binding_level(pbl_obj)"},{"line_number":798,"context_line":"                    next_segments \u003d context._next_segments_to_bind"},{"line_number":799,"context_line":"                    if next_segments:"}],"source_content_type":"text/x-python","patch_set":19,"id":"fa6399be_2ef20a9b","line":796,"range":{"start_line":796,"start_character":24,"end_line":796,"end_character":42},"updated":"2016-10-18 17:03:34.000000000","message":"segment\u003dnetwork.NetworkSegment(context._plugin_context, id\u003dsegment)?","commit_id":"1fe78f1b808363b990242dbfa2286a7185449bde"},{"author":{"_account_id":22774,"name":"Shashank Kumar Shankar","email":"shashank.kumar.shankar@intel.com","username":"skshankar"},"change_message_id":"f347e5c24e6b8b5aa37bfd1572e16f03aaeed12b","unresolved":false,"context_lines":[{"line_number":793,"context_line":"                        host\u003dcontext.host,"},{"line_number":794,"context_line":"                        level\u003dlevel,"},{"line_number":795,"context_line":"                        driver\u003ddriver.name,"},{"line_number":796,"context_line":"                        segment_id\u003dsegment)"},{"line_number":797,"context_line":"                    context._push_binding_level(pbl_obj)"},{"line_number":798,"context_line":"                    next_segments \u003d context._next_segments_to_bind"},{"line_number":799,"context_line":"                    if next_segments:"}],"source_content_type":"text/x-python","patch_set":19,"id":"fa6399be_fc5d21ed","line":796,"range":{"start_line":796,"start_character":24,"end_line":796,"end_character":42},"in_reply_to":"fa6399be_2ef20a9b","updated":"2016-10-18 22:57:59.000000000","message":"Done","commit_id":"1fe78f1b808363b990242dbfa2286a7185449bde"},{"author":{"_account_id":6951,"name":"Brandon Logan","email":"brandon.logan@rackspace.com","username":"brandon-logan"},"change_message_id":"55a33a0686e432b443a0a93893a92239928b9b72","unresolved":false,"context_lines":[{"line_number":35,"context_line":"from neutron.plugins.ml2.common import exceptions as ml2_exc"},{"line_number":36,"context_line":"from neutron.plugins.ml2 import driver_api as api"},{"line_number":37,"context_line":"from neutron.services.qos import qos_consts"},{"line_number":38,"context_line":""},{"line_number":39,"context_line":""},{"line_number":40,"context_line":"LOG \u003d log.getLogger(__name__)"},{"line_number":41,"context_line":""}],"source_content_type":"text/x-python","patch_set":21,"id":"ba5da102_85bc48bc","line":38,"updated":"2016-11-02 22:46:59.000000000","message":"unnecessary line","commit_id":"524a7c9510c65aa5d2010aa47957b5dc79a5d29f"},{"author":{"_account_id":27654,"name":"Hongbin Lu","email":"kira034@163.com","username":"hongbin.lu"},"change_message_id":"3db7d38fd49f8b82fb20430bc235c2c818036d19","unresolved":false,"context_lines":[{"line_number":782,"context_line":"                context._prepare_to_bind(segments_to_bind)"},{"line_number":783,"context_line":"                driver.obj.bind_port(context)"},{"line_number":784,"context_line":"                segment \u003d context._new_bound_segment"},{"line_number":785,"context_line":"                if segment and segment is not constants.ATTR_NOT_SPECIFIED:"},{"line_number":786,"context_line":"                    pbl_obj \u003d ports.PortBindingLevel("},{"line_number":787,"context_line":"                        context._plugin_context,"},{"line_number":788,"context_line":"                        port_id\u003dport_id,"}],"source_content_type":"text/x-python","patch_set":63,"id":"3f79a3b5_f3e455e2","line":785,"range":{"start_line":785,"start_character":56,"end_line":785,"end_character":74},"updated":"2018-08-10 22:40:55.000000000","message":"I couldn\u0027t figure out why segment can be ATTR_NOT_SPECIFIED, but I assume somewhere breaks the compatibility after switching to OVO? I have a feeling that the value of segment should be the same as before so that we don\u0027t need to add a new condition to handle this case.","commit_id":"24fc794a97200dd0a4fc3ad02cef4c0bb2341315"},{"author":{"_account_id":11975,"name":"Slawek Kaplonski","email":"skaplons@redhat.com","username":"slaweq"},"change_message_id":"ef73670d5912565ef2e60cdd613e4f439f714727","unresolved":false,"context_lines":[{"line_number":782,"context_line":"                context._prepare_to_bind(segments_to_bind)"},{"line_number":783,"context_line":"                driver.obj.bind_port(context)"},{"line_number":784,"context_line":"                segment \u003d context._new_bound_segment"},{"line_number":785,"context_line":"                if segment and segment is not constants.ATTR_NOT_SPECIFIED:"},{"line_number":786,"context_line":"                    pbl_obj \u003d ports.PortBindingLevel("},{"line_number":787,"context_line":"                        context._plugin_context,"},{"line_number":788,"context_line":"                        port_id\u003dport_id,"}],"source_content_type":"text/x-python","patch_set":63,"id":"3f79a3b5_72d498e9","line":785,"range":{"start_line":785,"start_character":56,"end_line":785,"end_character":74},"in_reply_to":"3f79a3b5_5a7c271e","updated":"2018-08-14 07:49:46.000000000","message":"Looks now that it wasn\u0027t necessary :)","commit_id":"24fc794a97200dd0a4fc3ad02cef4c0bb2341315"},{"author":{"_account_id":11975,"name":"Slawek Kaplonski","email":"skaplons@redhat.com","username":"slaweq"},"change_message_id":"6371049c0bae85394a46168e1716b48daad549f2","unresolved":false,"context_lines":[{"line_number":782,"context_line":"                context._prepare_to_bind(segments_to_bind)"},{"line_number":783,"context_line":"                driver.obj.bind_port(context)"},{"line_number":784,"context_line":"                segment \u003d context._new_bound_segment"},{"line_number":785,"context_line":"                if segment and segment is not constants.ATTR_NOT_SPECIFIED:"},{"line_number":786,"context_line":"                    pbl_obj \u003d ports.PortBindingLevel("},{"line_number":787,"context_line":"                        context._plugin_context,"},{"line_number":788,"context_line":"                        port_id\u003dport_id,"}],"source_content_type":"text/x-python","patch_set":63,"id":"3f79a3b5_5a7c271e","line":785,"range":{"start_line":785,"start_character":56,"end_line":785,"end_character":74},"in_reply_to":"3f79a3b5_f3e455e2","updated":"2018-08-13 13:23:48.000000000","message":"To be honest I don\u0027t know exactly why it\u0027s here. I\u0027m third person who is working on this patch and this was probably added before I jumped into it :)\nIt looks now for me that it\u0027s not necessary so I removed it and lets see CI results now :)","commit_id":"24fc794a97200dd0a4fc3ad02cef4c0bb2341315"}],"neutron/plugins/ml2/plugin.py":[{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"e68b882ca7fdd6acc870df1ddaf10ec72bc822e3","unresolved":false,"context_lines":[{"line_number":1458,"context_line":"                dist_binding_list \u003d db.get_distributed_port_bindings(session,"},{"line_number":1459,"context_line":"                                                                     id)"},{"line_number":1460,"context_line":"                for dist_binding in dist_binding_list:"},{"line_number":1461,"context_line":"                    levels \u003d db.get_binding_levels(context, id,"},{"line_number":1462,"context_line":"                                                   dist_binding.host)"},{"line_number":1463,"context_line":"                    dist_mech_context \u003d driver_context.PortContext("},{"line_number":1464,"context_line":"                        self, context, updated_port, network,"}],"source_content_type":"text/x-python","patch_set":19,"id":"fa6399be_415f0f0e","line":1461,"range":{"start_line":1461,"start_character":20,"end_line":1461,"end_character":26},"updated":"2016-10-18 17:03:34.000000000","message":"that levels list is passed in line 1455 into driver context. Here is how the binding_levels property is described in ml2 driver context abstract class:\n\n\"Return dictionaries describing the current binding levels.\"\n\nTo reflect that requirement, we may need to convert level objects to_dict() before returning from binding_levels() context property. Other properties like original_binding_levels are probably affected too.","commit_id":"1fe78f1b808363b990242dbfa2286a7185449bde"},{"author":{"_account_id":22774,"name":"Shashank Kumar Shankar","email":"shashank.kumar.shankar@intel.com","username":"skshankar"},"change_message_id":"f347e5c24e6b8b5aa37bfd1572e16f03aaeed12b","unresolved":false,"context_lines":[{"line_number":1458,"context_line":"                dist_binding_list \u003d db.get_distributed_port_bindings(session,"},{"line_number":1459,"context_line":"                                                                     id)"},{"line_number":1460,"context_line":"                for dist_binding in dist_binding_list:"},{"line_number":1461,"context_line":"                    levels \u003d db.get_binding_levels(context, id,"},{"line_number":1462,"context_line":"                                                   dist_binding.host)"},{"line_number":1463,"context_line":"                    dist_mech_context \u003d driver_context.PortContext("},{"line_number":1464,"context_line":"                        self, context, updated_port, network,"}],"source_content_type":"text/x-python","patch_set":19,"id":"fa6399be_3c0f99e2","line":1461,"range":{"start_line":1461,"start_character":20,"end_line":1461,"end_character":26},"in_reply_to":"fa6399be_415f0f0e","updated":"2016-10-18 22:57:59.000000000","message":"I was of the opinion that it is take care here: https://github.com/openstack/neutron/blob/90eaf71ba140d9a48d96375f4865f8b89568a147/neutron/plugins/ml2/driver_context.py#L159","commit_id":"1fe78f1b808363b990242dbfa2286a7185449bde"},{"author":{"_account_id":8726,"name":"Victor Morales","email":"chipahuac@hotmail.com","username":"electrocucaracha"},"change_message_id":"0a7b3f7db8fe911ad9da47356a27c64203c198e1","unresolved":false,"context_lines":[{"line_number":329,"context_line":"        if changes:"},{"line_number":330,"context_line":"            binding.vif_type \u003d portbindings.VIF_TYPE_UNBOUND"},{"line_number":331,"context_line":"            binding.vif_details \u003d \u0027\u0027"},{"line_number":332,"context_line":"            db.clear_binding_levels("},{"line_number":333,"context_line":"                mech_context._plugin_context,"},{"line_number":334,"context_line":"                port_id,"},{"line_number":335,"context_line":"                original_host)"},{"line_number":336,"context_line":"            mech_context._clear_binding_levels()"},{"line_number":337,"context_line":"            port[\u0027status\u0027] \u003d const.PORT_STATUS_DOWN"},{"line_number":338,"context_line":"            super(Ml2Plugin, self).update_port("}],"source_content_type":"text/x-python","patch_set":26,"id":"3a71b18c_34b9d3cc","line":335,"range":{"start_line":332,"start_character":12,"end_line":335,"end_character":30},"updated":"2016-12-06 18:25:00.000000000","message":"nit:\n            db.clear_binding_levels(\n                mech_context._plugin_context, port_id, original_host)","commit_id":"8cc56aad623305091f432577ec3ccb2bf25417ff"},{"author":{"_account_id":8726,"name":"Victor Morales","email":"chipahuac@hotmail.com","username":"electrocucaracha"},"change_message_id":"0a7b3f7db8fe911ad9da47356a27c64203c198e1","unresolved":false,"context_lines":[{"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("},{"line_number":346,"context_line":"                mech_context._plugin_context,"},{"line_number":347,"context_line":"                port_id,"},{"line_number":348,"context_line":"                original_host)"},{"line_number":349,"context_line":"            mech_context._clear_binding_levels()"},{"line_number":350,"context_line":"            binding.host \u003d \u0027\u0027"},{"line_number":351,"context_line":""}],"source_content_type":"text/x-python","patch_set":26,"id":"3a71b18c_34071383","line":348,"range":{"start_line":345,"start_character":0,"end_line":348,"end_character":30},"updated":"2016-12-06 18:25:00.000000000","message":"nit:\n             db.clear_binding_levels(\n                mech_context._plugin_context, port_id, original_host)","commit_id":"8cc56aad623305091f432577ec3ccb2bf25417ff"},{"author":{"_account_id":8726,"name":"Victor Morales","email":"chipahuac@hotmail.com","username":"electrocucaracha"},"change_message_id":"0a7b3f7db8fe911ad9da47356a27c64203c198e1","unresolved":false,"context_lines":[{"line_number":1524,"context_line":"            binding.vif_details \u003d \u0027\u0027"},{"line_number":1525,"context_line":"            binding.vif_type \u003d portbindings.VIF_TYPE_UNBOUND"},{"line_number":1526,"context_line":"            if binding.host:"},{"line_number":1527,"context_line":"                db.clear_binding_levels("},{"line_number":1528,"context_line":"                    mech_context._plugin_context,"},{"line_number":1529,"context_line":"                    port_id,"},{"line_number":1530,"context_line":"                    binding.host)"},{"line_number":1531,"context_line":"            binding.host \u003d \u0027\u0027"},{"line_number":1532,"context_line":""},{"line_number":1533,"context_line":"        self._update_port_dict_binding(port, binding)"}],"source_content_type":"text/x-python","patch_set":26,"id":"3a71b18c_74342b49","line":1530,"range":{"start_line":1527,"start_character":16,"end_line":1530,"end_character":33},"updated":"2016-12-06 18:25:00.000000000","message":"nit:\n                db.clear_binding_levels(\n                    mech_context._plugin_context, port_id, binding.host)","commit_id":"8cc56aad623305091f432577ec3ccb2bf25417ff"},{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"2934884b8a7ef931bec54b9dce14da010484dd38","unresolved":false,"context_lines":[{"line_number":1615,"context_line":"                bindings \u003d db.get_distributed_port_bindings(context.session,"},{"line_number":1616,"context_line":"                                                            id)"},{"line_number":1617,"context_line":"                for bind in bindings:"},{"line_number":1618,"context_line":"                    levels \u003d db.get_binding_levels_objs(context, id,"},{"line_number":1619,"context_line":"                                                   bind.host)"},{"line_number":1620,"context_line":"                    mech_context \u003d driver_context.PortContext("},{"line_number":1621,"context_line":"                        self, context, port, network, bind, levels)"}],"source_content_type":"text/x-python","patch_set":26,"id":"3a71b18c_3c5dd979","line":1618,"updated":"2016-12-08 15:07:20.000000000","message":"indent","commit_id":"8cc56aad623305091f432577ec3ccb2bf25417ff"},{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"2934884b8a7ef931bec54b9dce14da010484dd38","unresolved":false,"context_lines":[{"line_number":1623,"context_line":"                    bound_mech_contexts.append(mech_context)"},{"line_number":1624,"context_line":"            else:"},{"line_number":1625,"context_line":"                levels \u003d db.get_binding_levels_objs(context, id,"},{"line_number":1626,"context_line":"                                               binding.host)"},{"line_number":1627,"context_line":"                mech_context \u003d driver_context.PortContext("},{"line_number":1628,"context_line":"                    self, context, port, network, binding, levels)"},{"line_number":1629,"context_line":"                self.mechanism_manager.delete_port_precommit(mech_context)"}],"source_content_type":"text/x-python","patch_set":26,"id":"3a71b18c_fc62813c","line":1626,"updated":"2016-12-08 15:07:20.000000000","message":"indent properly","commit_id":"8cc56aad623305091f432577ec3ccb2bf25417ff"},{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"2934884b8a7ef931bec54b9dce14da010484dd38","unresolved":false,"context_lines":[{"line_number":1710,"context_line":"                             port_id)"},{"line_number":1711,"context_line":"                    return"},{"line_number":1712,"context_line":"                levels \u003d db.get_binding_levels_objs(plugin_context, port_db.id,"},{"line_number":1713,"context_line":"                                               port_db.port_binding.host)"},{"line_number":1714,"context_line":"                port_context \u003d driver_context.PortContext("},{"line_number":1715,"context_line":"                    self, plugin_context, port, network, binding, levels)"},{"line_number":1716,"context_line":""}],"source_content_type":"text/x-python","patch_set":26,"id":"3a71b18c_dc5f8573","line":1713,"updated":"2016-12-08 15:07:20.000000000","message":"indentation broken here","commit_id":"8cc56aad623305091f432577ec3ccb2bf25417ff"},{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"2934884b8a7ef931bec54b9dce14da010484dd38","unresolved":false,"context_lines":[{"line_number":1744,"context_line":"                updated_port \u003d self._make_port_dict(port)"},{"line_number":1745,"context_line":"                network \u003d network or self.get_network("},{"line_number":1746,"context_line":"                    context, original_port[\u0027network_id\u0027])"},{"line_number":1747,"context_line":"                levels \u003d db.get_binding_levels_objs(context, port.id,"},{"line_number":1748,"context_line":"                                               port.port_binding.host)"},{"line_number":1749,"context_line":"                mech_context \u003d driver_context.PortContext("},{"line_number":1750,"context_line":"                    self, context, updated_port, network, port.port_binding,"}],"source_content_type":"text/x-python","patch_set":26,"id":"3a71b18c_7c4f51be","line":1747,"updated":"2016-12-08 15:07:20.000000000","message":"indent","commit_id":"8cc56aad623305091f432577ec3ccb2bf25417ff"},{"author":{"_account_id":22220,"name":"Anindita Das","email":"anindita.das@utexas.edu","username":"anudas"},"change_message_id":"573e5bd00d93d46acad4b6eed466738086576ac0","unresolved":false,"context_lines":[{"line_number":505,"context_line":"                # results."},{"line_number":506,"context_line":"                cur_binding.vif_type \u003d new_binding.vif_type"},{"line_number":507,"context_line":"                cur_binding.vif_details \u003d new_binding.vif_details"},{"line_number":508,"context_line":"                db.clear_binding_levels("},{"line_number":509,"context_line":"                    plugin_context, port_id, cur_binding.host)"},{"line_number":510,"context_line":"                db.set_binding_levels(bind_context._binding_levels)"},{"line_number":511,"context_line":"                cur_context._binding_levels \u003d bind_context._binding_levels"},{"line_number":512,"context_line":""}],"source_content_type":"text/x-python","patch_set":32,"id":"ba5201f7_2cd9e122","line":509,"range":{"start_line":508,"start_character":0,"end_line":509,"end_character":62},"updated":"2017-01-11 21:05:57.000000000","message":"nit: There is no code change in this line except for the spaces. It would be good to have it in the original format to avoid confusion.","commit_id":"79392779e8424e3b9baaa49ba74c98912b5b341e"},{"author":{"_account_id":22774,"name":"Shashank Kumar Shankar","email":"shashank.kumar.shankar@intel.com","username":"skshankar"},"change_message_id":"c9a7b31c7e7ac3d1fb77bc54e344c6be52f922e0","unresolved":false,"context_lines":[{"line_number":505,"context_line":"                # results."},{"line_number":506,"context_line":"                cur_binding.vif_type \u003d new_binding.vif_type"},{"line_number":507,"context_line":"                cur_binding.vif_details \u003d new_binding.vif_details"},{"line_number":508,"context_line":"                db.clear_binding_levels("},{"line_number":509,"context_line":"                    plugin_context, port_id, cur_binding.host)"},{"line_number":510,"context_line":"                db.set_binding_levels(bind_context._binding_levels)"},{"line_number":511,"context_line":"                cur_context._binding_levels \u003d bind_context._binding_levels"},{"line_number":512,"context_line":""}],"source_content_type":"text/x-python","patch_set":32,"id":"9a57fde8_9f87bf0e","line":509,"range":{"start_line":508,"start_character":0,"end_line":509,"end_character":62},"in_reply_to":"ba5201f7_2cd9e122","updated":"2017-01-12 19:53:21.000000000","message":"Done","commit_id":"79392779e8424e3b9baaa49ba74c98912b5b341e"},{"author":{"_account_id":14611,"name":"dasm","display_name":"dasm","email":"dsmigiel@redhat.com","username":"dasm"},"change_message_id":"9a76559c9a2ca1e781ccebd337e7b67e907dc3a0","unresolved":false,"context_lines":[{"line_number":506,"context_line":"                cur_binding.vif_details \u003d new_binding.vif_details"},{"line_number":507,"context_line":"                db.clear_binding_levels(plugin_context, port_id,"},{"line_number":508,"context_line":"                                        cur_binding.host)"},{"line_number":509,"context_line":"                db.set_binding_levels(bind_context._binding_levels)"},{"line_number":510,"context_line":"                cur_context._binding_levels \u003d bind_context._binding_levels"},{"line_number":511,"context_line":""},{"line_number":512,"context_line":"                # Update PortContext\u0027s port dictionary to reflect the"}],"source_content_type":"text/x-python","patch_set":50,"id":"dfeb2761_48910147","line":509,"updated":"2017-04-04 19:52:53.000000000","message":"Why did you remove this `plugin_context`?","commit_id":"5f1ad38296bd757cc21b2b196c3dcac31fc169a1"},{"author":{"_account_id":22774,"name":"Shashank Kumar Shankar","email":"shashank.kumar.shankar@intel.com","username":"skshankar"},"change_message_id":"efa4245e8e562d5cf0fdeb5c4dc245b0f4626f18","unresolved":false,"context_lines":[{"line_number":506,"context_line":"                cur_binding.vif_details \u003d new_binding.vif_details"},{"line_number":507,"context_line":"                db.clear_binding_levels(plugin_context, port_id,"},{"line_number":508,"context_line":"                                        cur_binding.host)"},{"line_number":509,"context_line":"                db.set_binding_levels(bind_context._binding_levels)"},{"line_number":510,"context_line":"                cur_context._binding_levels \u003d bind_context._binding_levels"},{"line_number":511,"context_line":""},{"line_number":512,"context_line":"                # Update PortContext\u0027s port dictionary to reflect the"}],"source_content_type":"text/x-python","patch_set":50,"id":"dfeb2761_c8b3d197","line":509,"in_reply_to":"dfeb2761_48910147","updated":"2017-04-04 20:04:01.000000000","message":"Since level object is passed [1], the context is not required.\n\n[1] - https://review.openstack.org/#/c/382037/50/neutron/plugins/ml2/db.py@85","commit_id":"5f1ad38296bd757cc21b2b196c3dcac31fc169a1"},{"author":{"_account_id":11975,"name":"Slawek Kaplonski","email":"skaplons@redhat.com","username":"slaweq"},"change_message_id":"fe62cd41a1a319e3c4494a1753ce80118c92b309","unresolved":false,"context_lines":[{"line_number":586,"context_line":"                else:"},{"line_number":587,"context_line":"                    cur_context_binding.vif_type \u003d new_binding.vif_type"},{"line_number":588,"context_line":"                    cur_context_binding.vif_details \u003d new_binding.vif_details"},{"line_number":589,"context_line":"                if update_binding_levels:"},{"line_number":590,"context_line":"                    db.clear_binding_levels(plugin_context, port_id,"},{"line_number":591,"context_line":"                                            cur_binding.host)"},{"line_number":592,"context_line":"                    db.set_binding_levels(plugin_context,"}],"source_content_type":"text/x-python","patch_set":63,"id":"3f79a3b5_7a67ed26","line":589,"updated":"2018-08-09 10:10:41.000000000","message":"this helps me to pass UT for activate_bindings,\nbefore this change it was failing like in http://paste.openstack.org/show/727580/\n\nWhat I found was that it was failing because of no changed fields in PortBindingLevel OVO in this case, see:\nhttps://etherpad.openstack.org/p/binding_levels_debug\n\nBut I\u0027m not sure if this change will be fine and will not break anything. Proably Miguel will have to take a look on that as \"multiple port bindings expert\" :)","commit_id":"24fc794a97200dd0a4fc3ad02cef4c0bb2341315"},{"author":{"_account_id":27654,"name":"Hongbin Lu","email":"kira034@163.com","username":"hongbin.lu"},"change_message_id":"3db7d38fd49f8b82fb20430bc235c2c818036d19","unresolved":false,"context_lines":[{"line_number":592,"context_line":"                    db.set_binding_levels(plugin_context,"},{"line_number":593,"context_line":"                                          bind_context._binding_levels)"},{"line_number":594,"context_line":"                # refresh context with a snapshot of updated state"},{"line_number":595,"context_line":"                cur_context._binding \u003d driver_context.InstanceSnapshot("},{"line_number":596,"context_line":"                    cur_context_binding)"},{"line_number":597,"context_line":"                cur_context._binding_levels \u003d bind_context._binding_levels"},{"line_number":598,"context_line":""}],"source_content_type":"text/x-python","patch_set":63,"id":"3f79a3b5_e0879db4","line":595,"range":{"start_line":595,"start_character":54,"end_line":595,"end_character":70},"updated":"2018-08-10 22:40:55.000000000","message":"Just wondering. After switching to OVO, do you still need to wrap the object with InstanceSnapshot? Perhaps you can directly assign without InstanceSnapshot?","commit_id":"24fc794a97200dd0a4fc3ad02cef4c0bb2341315"},{"author":{"_account_id":11975,"name":"Slawek Kaplonski","email":"skaplons@redhat.com","username":"slaweq"},"change_message_id":"6371049c0bae85394a46168e1716b48daad549f2","unresolved":false,"context_lines":[{"line_number":592,"context_line":"                    db.set_binding_levels(plugin_context,"},{"line_number":593,"context_line":"                                          bind_context._binding_levels)"},{"line_number":594,"context_line":"                # refresh context with a snapshot of updated state"},{"line_number":595,"context_line":"                cur_context._binding \u003d driver_context.InstanceSnapshot("},{"line_number":596,"context_line":"                    cur_context_binding)"},{"line_number":597,"context_line":"                cur_context._binding_levels \u003d bind_context._binding_levels"},{"line_number":598,"context_line":""}],"source_content_type":"text/x-python","patch_set":63,"id":"3f79a3b5_9195d235","line":595,"range":{"start_line":595,"start_character":54,"end_line":595,"end_character":70},"in_reply_to":"3f79a3b5_e0879db4","updated":"2018-08-13 13:23:48.000000000","message":"IMO this should be changed in patch which will switch \"binding\" to OVO","commit_id":"24fc794a97200dd0a4fc3ad02cef4c0bb2341315"},{"author":{"_account_id":13995,"name":"Nate Johnston","email":"nate.johnston@redhat.com","username":"natejohnston"},"change_message_id":"7650b79cb9acd8e2529da1f0b45bd52ee596093b","unresolved":false,"context_lines":[{"line_number":1595,"context_line":"                    self.mechanism_manager.delete_port_precommit(mech_context)"},{"line_number":1596,"context_line":"                    bound_mech_contexts.append(mech_context)"},{"line_number":1597,"context_line":"            else:"},{"line_number":1598,"context_line":"                # TODO(sshank): Using separate context here prevents"},{"line_number":1599,"context_line":"                # \"sqlalchemy.exc.InvalidRequestError: Can\u0027t attach"},{"line_number":1600,"context_line":"                # instance \u003cPortBindingLevel at 0x7fcd34547110\u003e; another"},{"line_number":1601,"context_line":"                # instance with key"}],"source_content_type":"text/x-python","patch_set":65,"id":"3f79a3b5_09bad66c","line":1598,"range":{"start_line":1598,"start_character":16,"end_line":1598,"end_character":30},"updated":"2018-08-14 15:06:33.000000000","message":"I\u0027m not really clear what the TODO is here; this seems like more of a comment than a future action item.  I\u0027m also not clear if sshank should still own whatever action item there is...","commit_id":"3af64a3f9817896f917950e0940cb8de8c957b2f"},{"author":{"_account_id":22774,"name":"Shashank Kumar Shankar","email":"shashank.kumar.shankar@intel.com","username":"skshankar"},"change_message_id":"1503bd3ab6822b637534aad697ec8c9516ab1289","unresolved":false,"context_lines":[{"line_number":1595,"context_line":"                    self.mechanism_manager.delete_port_precommit(mech_context)"},{"line_number":1596,"context_line":"                    bound_mech_contexts.append(mech_context)"},{"line_number":1597,"context_line":"            else:"},{"line_number":1598,"context_line":"                # TODO(sshank): Using separate context here prevents"},{"line_number":1599,"context_line":"                # \"sqlalchemy.exc.InvalidRequestError: Can\u0027t attach"},{"line_number":1600,"context_line":"                # instance \u003cPortBindingLevel at 0x7fcd34547110\u003e; another"},{"line_number":1601,"context_line":"                # instance with key"}],"source_content_type":"text/x-python","patch_set":65,"id":"3f79a3b5_423423fc","line":1598,"range":{"start_line":1598,"start_character":16,"end_line":1598,"end_character":30},"in_reply_to":"3f79a3b5_09bad66c","updated":"2018-08-14 17:00:20.000000000","message":"Yes, its not a TODO but more of a comment. I added it a while back to help debug and justify why a new admin context is used.","commit_id":"3af64a3f9817896f917950e0940cb8de8c957b2f"},{"author":{"_account_id":11975,"name":"Slawek Kaplonski","email":"skaplons@redhat.com","username":"slaweq"},"change_message_id":"3d784100702fc99ff99ce42fabc162fc5c4ca79d","unresolved":false,"context_lines":[{"line_number":1595,"context_line":"                    self.mechanism_manager.delete_port_precommit(mech_context)"},{"line_number":1596,"context_line":"                    bound_mech_contexts.append(mech_context)"},{"line_number":1597,"context_line":"            else:"},{"line_number":1598,"context_line":"                # TODO(sshank): Using separate context here prevents"},{"line_number":1599,"context_line":"                # \"sqlalchemy.exc.InvalidRequestError: Can\u0027t attach"},{"line_number":1600,"context_line":"                # instance \u003cPortBindingLevel at 0x7fcd34547110\u003e; another"},{"line_number":1601,"context_line":"                # instance with key"}],"source_content_type":"text/x-python","patch_set":65,"id":"3f79a3b5_fc4ccb42","line":1598,"range":{"start_line":1598,"start_character":16,"end_line":1598,"end_character":30},"in_reply_to":"3f79a3b5_423423fc","updated":"2018-08-16 08:23:25.000000000","message":"Thx. Changed","commit_id":"3af64a3f9817896f917950e0940cb8de8c957b2f"},{"author":{"_account_id":13995,"name":"Nate Johnston","email":"nate.johnston@redhat.com","username":"natejohnston"},"change_message_id":"7650b79cb9acd8e2529da1f0b45bd52ee596093b","unresolved":false,"context_lines":[{"line_number":1618,"context_line":""},{"line_number":1619,"context_line":"            LOG.debug(\"Calling delete_port for %(port_id)s owned by %(owner)s\","},{"line_number":1620,"context_line":"                      {\"port_id\": id, \"owner\": device_owner})"},{"line_number":1621,"context_line":"            # TODO(sshank): Failing below if same context.session used"},{"line_number":1622,"context_line":"            # in get_binding_level_objs is passed here. This is further"},{"line_number":1623,"context_line":"            # passed around and fails in neutron/db/ipam_backend_mixin.py"},{"line_number":1624,"context_line":"            super(Ml2Plugin, self).delete_port(context, id)"}],"source_content_type":"text/x-python","patch_set":65,"id":"3f79a3b5_096f36fc","line":1621,"range":{"start_line":1621,"start_character":12,"end_line":1621,"end_character":26},"updated":"2018-08-14 15:06:33.000000000","message":"Same comment as above.","commit_id":"3af64a3f9817896f917950e0940cb8de8c957b2f"},{"author":{"_account_id":11975,"name":"Slawek Kaplonski","email":"skaplons@redhat.com","username":"slaweq"},"change_message_id":"3d784100702fc99ff99ce42fabc162fc5c4ca79d","unresolved":false,"context_lines":[{"line_number":1618,"context_line":""},{"line_number":1619,"context_line":"            LOG.debug(\"Calling delete_port for %(port_id)s owned by %(owner)s\","},{"line_number":1620,"context_line":"                      {\"port_id\": id, \"owner\": device_owner})"},{"line_number":1621,"context_line":"            # TODO(sshank): Failing below if same context.session used"},{"line_number":1622,"context_line":"            # in get_binding_level_objs is passed here. This is further"},{"line_number":1623,"context_line":"            # passed around and fails in neutron/db/ipam_backend_mixin.py"},{"line_number":1624,"context_line":"            super(Ml2Plugin, self).delete_port(context, id)"}],"source_content_type":"text/x-python","patch_set":65,"id":"3f79a3b5_5c429f10","line":1621,"range":{"start_line":1621,"start_character":12,"end_line":1621,"end_character":26},"in_reply_to":"3f79a3b5_02138b67","updated":"2018-08-16 08:23:25.000000000","message":"Thx, I missed it somehow","commit_id":"3af64a3f9817896f917950e0940cb8de8c957b2f"},{"author":{"_account_id":22774,"name":"Shashank Kumar Shankar","email":"shashank.kumar.shankar@intel.com","username":"skshankar"},"change_message_id":"1503bd3ab6822b637534aad697ec8c9516ab1289","unresolved":false,"context_lines":[{"line_number":1618,"context_line":""},{"line_number":1619,"context_line":"            LOG.debug(\"Calling delete_port for %(port_id)s owned by %(owner)s\","},{"line_number":1620,"context_line":"                      {\"port_id\": id, \"owner\": device_owner})"},{"line_number":1621,"context_line":"            # TODO(sshank): Failing below if same context.session used"},{"line_number":1622,"context_line":"            # in get_binding_level_objs is passed here. This is further"},{"line_number":1623,"context_line":"            # passed around and fails in neutron/db/ipam_backend_mixin.py"},{"line_number":1624,"context_line":"            super(Ml2Plugin, self).delete_port(context, id)"}],"source_content_type":"text/x-python","patch_set":65,"id":"3f79a3b5_02138b67","line":1621,"range":{"start_line":1621,"start_character":12,"end_line":1621,"end_character":26},"in_reply_to":"3f79a3b5_096f36fc","updated":"2018-08-14 17:00:20.000000000","message":"I guess this can be removed.","commit_id":"3af64a3f9817896f917950e0940cb8de8c957b2f"},{"author":{"_account_id":27654,"name":"Hongbin Lu","email":"kira034@163.com","username":"hongbin.lu"},"change_message_id":"af2c648e18927d9334ee64764030146aafb2cf70","unresolved":false,"context_lines":[{"line_number":1483,"context_line":"            binding.vif_details \u003d \u0027\u0027"},{"line_number":1484,"context_line":"            binding.vif_type \u003d portbindings.VIF_TYPE_UNBOUND"},{"line_number":1485,"context_line":"            if binding.host:"},{"line_number":1486,"context_line":"                db.clear_binding_levels(context, port_id, binding.host)"},{"line_number":1487,"context_line":"            binding.host \u003d \u0027\u0027"},{"line_number":1488,"context_line":""},{"line_number":1489,"context_line":"        self._update_port_dict_binding(port, binding)"}],"source_content_type":"text/x-python","patch_set":67,"id":"3f79a3b5_3518e373","line":1486,"range":{"start_line":1486,"start_character":40,"end_line":1486,"end_character":47},"updated":"2018-08-17 22:57:51.000000000","message":"Any reason for making this change?","commit_id":"ee5b8b1025d0dde2acc933b4bd017c946f83794a"},{"author":{"_account_id":11975,"name":"Slawek Kaplonski","email":"skaplons@redhat.com","username":"slaweq"},"change_message_id":"23074fe8e33bd14a6b49a2e992f7c9af7baf8414","unresolved":false,"context_lines":[{"line_number":1483,"context_line":"            binding.vif_details \u003d \u0027\u0027"},{"line_number":1484,"context_line":"            binding.vif_type \u003d portbindings.VIF_TYPE_UNBOUND"},{"line_number":1485,"context_line":"            if binding.host:"},{"line_number":1486,"context_line":"                db.clear_binding_levels(context, port_id, binding.host)"},{"line_number":1487,"context_line":"            binding.host \u003d \u0027\u0027"},{"line_number":1488,"context_line":""},{"line_number":1489,"context_line":"        self._update_port_dict_binding(port, binding)"}],"source_content_type":"text/x-python","patch_set":67,"id":"3f79a3b5_1c213d4e","line":1486,"range":{"start_line":1486,"start_character":40,"end_line":1486,"end_character":47},"in_reply_to":"3f79a3b5_3518e373","updated":"2018-08-20 14:06:18.000000000","message":"TBH: I don\u0027t know :)","commit_id":"ee5b8b1025d0dde2acc933b4bd017c946f83794a"},{"author":{"_account_id":27654,"name":"Hongbin Lu","email":"kira034@163.com","username":"hongbin.lu"},"change_message_id":"af2c648e18927d9334ee64764030146aafb2cf70","unresolved":false,"context_lines":[{"line_number":1600,"context_line":"                # instance \u003cPortBindingLevel at 0x7fcd34547110\u003e; another"},{"line_number":1601,"context_line":"                # instance with key"},{"line_number":1602,"context_line":"                # (\u003cclass \u0027neutron.plugins.ml2.models.PortBindingLevel\u0027\u003e"},{"line_number":1603,"context_line":"                # is already present in this session\" error in the below"},{"line_number":1604,"context_line":"                # Ml2Plugin delete_port()"},{"line_number":1605,"context_line":"                levels \u003d db.get_binding_level_objs("},{"line_number":1606,"context_line":"                    n_context.get_admin_context(), id, binding.host)"}],"source_content_type":"text/x-python","patch_set":67,"id":"3f79a3b5_35b46335","line":1603,"range":{"start_line":1603,"start_character":54,"end_line":1603,"end_character":59},"updated":"2018-08-17 22:57:51.000000000","message":"Could you share more details about this error. It happened in the gate or locally? What is the root cause of this error? I asked that because I cannot reproduce this error locally.","commit_id":"ee5b8b1025d0dde2acc933b4bd017c946f83794a"},{"author":{"_account_id":11975,"name":"Slawek Kaplonski","email":"skaplons@redhat.com","username":"slaweq"},"change_message_id":"23074fe8e33bd14a6b49a2e992f7c9af7baf8414","unresolved":false,"context_lines":[{"line_number":1600,"context_line":"                # instance \u003cPortBindingLevel at 0x7fcd34547110\u003e; another"},{"line_number":1601,"context_line":"                # instance with key"},{"line_number":1602,"context_line":"                # (\u003cclass \u0027neutron.plugins.ml2.models.PortBindingLevel\u0027\u003e"},{"line_number":1603,"context_line":"                # is already present in this session\" error in the below"},{"line_number":1604,"context_line":"                # Ml2Plugin delete_port()"},{"line_number":1605,"context_line":"                levels \u003d db.get_binding_level_objs("},{"line_number":1606,"context_line":"                    n_context.get_admin_context(), id, binding.host)"}],"source_content_type":"text/x-python","patch_set":67,"id":"3f79a3b5_5cb575ed","line":1603,"range":{"start_line":1603,"start_character":54,"end_line":1603,"end_character":59},"in_reply_to":"3f79a3b5_35b46335","updated":"2018-08-20 14:06:18.000000000","message":"It wasn\u0027t my comment and I\u0027m not sure what was this error. Let\u0027s move it back to old code and remove this comment :)","commit_id":"ee5b8b1025d0dde2acc933b4bd017c946f83794a"},{"author":{"_account_id":27654,"name":"Hongbin Lu","email":"kira034@163.com","username":"hongbin.lu"},"change_message_id":"af2c648e18927d9334ee64764030146aafb2cf70","unresolved":false,"context_lines":[{"line_number":1603,"context_line":"                # is already present in this session\" error in the below"},{"line_number":1604,"context_line":"                # Ml2Plugin delete_port()"},{"line_number":1605,"context_line":"                levels \u003d db.get_binding_level_objs("},{"line_number":1606,"context_line":"                    n_context.get_admin_context(), id, binding.host)"},{"line_number":1607,"context_line":"                kwargs[\u0027bind\u0027] \u003d None"},{"line_number":1608,"context_line":"                kwargs[\u0027levels\u0027] \u003d levels"},{"line_number":1609,"context_line":"                registry.notify(resources.PORT, events.PRECOMMIT_DELETE,"}],"source_content_type":"text/x-python","patch_set":67,"id":"3f79a3b5_351783f0","line":1606,"range":{"start_line":1606,"start_character":30,"end_line":1606,"end_character":47},"updated":"2018-08-17 22:57:51.000000000","message":"Just wondering. Why we need to make this change? It looks the original context was working and what is changed after switching to OVO that breaks this call?","commit_id":"ee5b8b1025d0dde2acc933b4bd017c946f83794a"},{"author":{"_account_id":11975,"name":"Slawek Kaplonski","email":"skaplons@redhat.com","username":"slaweq"},"change_message_id":"23074fe8e33bd14a6b49a2e992f7c9af7baf8414","unresolved":false,"context_lines":[{"line_number":1603,"context_line":"                # is already present in this session\" error in the below"},{"line_number":1604,"context_line":"                # Ml2Plugin delete_port()"},{"line_number":1605,"context_line":"                levels \u003d db.get_binding_level_objs("},{"line_number":1606,"context_line":"                    n_context.get_admin_context(), id, binding.host)"},{"line_number":1607,"context_line":"                kwargs[\u0027bind\u0027] \u003d None"},{"line_number":1608,"context_line":"                kwargs[\u0027levels\u0027] \u003d levels"},{"line_number":1609,"context_line":"                registry.notify(resources.PORT, events.PRECOMMIT_DELETE,"}],"source_content_type":"text/x-python","patch_set":67,"id":"3f79a3b5_7cb871e4","line":1606,"range":{"start_line":1606,"start_character":30,"end_line":1606,"end_character":47},"in_reply_to":"3f79a3b5_351783f0","updated":"2018-08-20 14:06:18.000000000","message":"Same here","commit_id":"ee5b8b1025d0dde2acc933b4bd017c946f83794a"},{"author":{"_account_id":27654,"name":"Hongbin Lu","email":"kira034@163.com","username":"hongbin.lu"},"change_message_id":"af2c648e18927d9334ee64764030146aafb2cf70","unresolved":false,"context_lines":[{"line_number":2216,"context_line":"        for count in range(MAX_BIND_TRIES):"},{"line_number":2217,"context_line":"            cur_context, _, try_again \u003d self._commit_port_binding("},{"line_number":2218,"context_line":"                original_context, bind_context, need_notify\u003dTrue,"},{"line_number":2219,"context_line":"                try_again\u003dTrue, update_binding_levels\u003dFalse)"},{"line_number":2220,"context_line":"            if not try_again:"},{"line_number":2221,"context_line":"                self.notifier.binding_deactivate(context, port_id,"},{"line_number":2222,"context_line":"                                                 active_binding.host,"}],"source_content_type":"text/x-python","patch_set":67,"id":"3f79a3b5_55e55f09","line":2219,"range":{"start_line":2219,"start_character":32,"end_line":2219,"end_character":53},"updated":"2018-08-17 22:57:51.000000000","message":"In here, we do the equivalent of changing \u0027update_binding_levels\u0027 from True to False? If yes, what are the rationales of this change?","commit_id":"ee5b8b1025d0dde2acc933b4bd017c946f83794a"},{"author":{"_account_id":11975,"name":"Slawek Kaplonski","email":"skaplons@redhat.com","username":"slaweq"},"change_message_id":"23074fe8e33bd14a6b49a2e992f7c9af7baf8414","unresolved":false,"context_lines":[{"line_number":2216,"context_line":"        for count in range(MAX_BIND_TRIES):"},{"line_number":2217,"context_line":"            cur_context, _, try_again \u003d self._commit_port_binding("},{"line_number":2218,"context_line":"                original_context, bind_context, need_notify\u003dTrue,"},{"line_number":2219,"context_line":"                try_again\u003dTrue, update_binding_levels\u003dFalse)"},{"line_number":2220,"context_line":"            if not try_again:"},{"line_number":2221,"context_line":"                self.notifier.binding_deactivate(context, port_id,"},{"line_number":2222,"context_line":"                                                 active_binding.host,"}],"source_content_type":"text/x-python","patch_set":67,"id":"3f79a3b5_1fae0fe7","line":2219,"range":{"start_line":2219,"start_character":32,"end_line":2219,"end_character":53},"in_reply_to":"3f79a3b5_55e55f09","updated":"2018-08-20 14:06:18.000000000","message":"Yes, here it is in fact change to not update Port binding levels as it\u0027s only update of active port binding - both of them active and inactive port binding already have port binding levels saved properly and it should be changed during this activation process.\nI added it because in fact some multiple port bindings tests were failing without it.","commit_id":"ee5b8b1025d0dde2acc933b4bd017c946f83794a"}],"neutron/tests/unit/objects/test_objects.py":[{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"2934884b8a7ef931bec54b9dce14da010484dd38","unresolved":false,"context_lines":[{"line_number":43,"context_line":"    \u0027NetworkSegment\u0027: \u00271.0-40707ef6bd9a0bf095038158d995cc7d\u0027,"},{"line_number":44,"context_line":"    \u0027Port\u0027: \u00271.0-638f6b09a3809ebd8b2b46293f56871b\u0027,"},{"line_number":45,"context_line":"    \u0027PortBinding\u0027: \u00271.0-f5d3048bec0ac58f08a758427581dff9\u0027,"},{"line_number":46,"context_line":"    \u0027PortBindingLevel\u0027: \u00271.0-83c02a0db7e1fcbd111ed2ccef33d8f3\u0027,"},{"line_number":47,"context_line":"    \u0027PortDNS\u0027: \u00271.0-201cf6d057fde75539c3d1f2bbf05902\u0027,"},{"line_number":48,"context_line":"    \u0027PortSecurity\u0027: \u00271.0-b30802391a87945ee9c07582b4ff95e3\u0027,"},{"line_number":49,"context_line":"    \u0027ProviderResourceAssociation\u0027: \u00271.0-05ab2d5a3017e5ce9dd381328f285f34\u0027,"}],"source_content_type":"text/x-python","patch_set":26,"id":"3a71b18c_3cd4f9bb","line":46,"updated":"2016-12-08 15:07:20.000000000","message":"I don\u0027t think this is needed, it\u0027s a result of segment_id addition, and I don\u0027t think it\u0027s really needed","commit_id":"8cc56aad623305091f432577ec3ccb2bf25417ff"}],"neutron/tests/unit/objects/test_ports.py":[{"author":{"_account_id":4694,"name":"Miguel Lavalle","email":"miguel@mlavalle.com","username":"minsel"},"change_message_id":"f95e3fe108024e170bb907a4b95c9547f228e2e0","unresolved":false,"context_lines":[{"line_number":218,"context_line":"        return obj_db_api.create_object("},{"line_number":219,"context_line":"            self.context, sg_models.SecurityGroup, {})"},{"line_number":220,"context_line":""},{"line_number":221,"context_line":"    def setUp(self):"},{"line_number":222,"context_line":"        super(PortDbObjectTestCase, self).setUp()"},{"line_number":223,"context_line":"        self._create_test_network()"},{"line_number":224,"context_line":"        self._create_test_subnet(self._network)"}],"source_content_type":"text/x-python","patch_set":16,"id":"fa6399be_aa84a60a","line":221,"updated":"2016-10-15 01:48:46.000000000","message":"You need to modify this setUp method to look like this: https://gist.github.com/miguellavalle/8d7b35e6e46bddf2a3d7bd64fba07948","commit_id":"d5fc1a218cfd96eac57c3e5e624a42faf9cbfe10"},{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"2934884b8a7ef931bec54b9dce14da010484dd38","unresolved":false,"context_lines":[{"line_number":184,"context_line":""},{"line_number":185,"context_line":"    def setUp(self):"},{"line_number":186,"context_line":"        super(PortBindingLevelIfaceObjTestCase, self).setUp()"},{"line_number":187,"context_line":"        # for this object, the model contains segment_id but we expose it"},{"line_number":188,"context_line":"        # through an ObjectField that is loaded without a relationship"},{"line_number":189,"context_line":"        for obj in self.db_objs:"},{"line_number":190,"context_line":"            obj[\u0027segment_id\u0027] \u003d None"}],"source_content_type":"text/x-python","patch_set":26,"id":"3a71b18c_3ceb197a","side":"PARENT","line":187,"updated":"2016-12-08 15:07:20.000000000","message":"This comment belongs to the code you killed","commit_id":"5fbe5212ce5f4d3ba8ae3d8e74f2b0f6509bd82d"},{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"2811360781ebd447d2924b9011432611133fe73d","unresolved":false,"context_lines":[{"line_number":223,"context_line":"    def setUp(self):"},{"line_number":224,"context_line":"        super(PortDbObjectTestCase, self).setUp()"},{"line_number":225,"context_line":"        self._create_test_network()"},{"line_number":226,"context_line":"        self._create_test_segment(self._network)"},{"line_number":227,"context_line":"        self._create_test_subnet(self._network)"},{"line_number":228,"context_line":"        self.update_obj_fields("},{"line_number":229,"context_line":"            {\u0027network_id\u0027: self._network.id,"}],"source_content_type":"text/x-python","patch_set":27,"id":"3a71b18c_792598c0","line":226,"updated":"2016-12-08 18:21:53.000000000","message":"I believe there is no need for the changes anymore. I reverted them, and the test passes fine.","commit_id":"fc5e999ea1a31ee6f6b4641d01ac8e49d43c697e"},{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"3fba99ca6e3cfa43129b4af2d208d5a80a33cf5f","unresolved":false,"context_lines":[{"line_number":190,"context_line":""},{"line_number":191,"context_line":""},{"line_number":192,"context_line":"class PortBindingLevelDbObjectTestCase("},{"line_number":193,"context_line":"        obj_test_base.BaseDbObjectTestCase, testlib_api.SqlTestCase):"},{"line_number":194,"context_line":""},{"line_number":195,"context_line":"    _test_class \u003d ports.PortBindingLevel"},{"line_number":196,"context_line":""}],"source_content_type":"text/x-python","patch_set":34,"id":"7a3c09a3_a4300bea","line":193,"updated":"2017-01-18 21:31:49.000000000","message":"oops","commit_id":"3e7ae4a3381792bebd366b041f1790f4159d27e2"},{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"3fba99ca6e3cfa43129b4af2d208d5a80a33cf5f","unresolved":false,"context_lines":[{"line_number":204,"context_line":"            return self._port[\u0027id\u0027]"},{"line_number":205,"context_line":""},{"line_number":206,"context_line":"        self.update_obj_fields({\u0027port_id\u0027: getter,"},{"line_number":207,"context_line":"                                \u0027host\u0027: \u0027host\u0027,"},{"line_number":208,"context_line":"                                \u0027level\u0027: 1,"},{"line_number":209,"context_line":"                                \u0027segment_id\u0027: self._segment[\u0027id\u0027]})"},{"line_number":210,"context_line":""},{"line_number":211,"context_line":""}],"source_content_type":"text/x-python","patch_set":34,"id":"7a3c09a3_a4472b4a","line":208,"range":{"start_line":207,"start_character":32,"end_line":208,"end_character":43},"updated":"2017-01-18 21:31:49.000000000","message":"why can\u0027t we leave those two fields randomly generated?","commit_id":"3e7ae4a3381792bebd366b041f1790f4159d27e2"},{"author":{"_account_id":22774,"name":"Shashank Kumar Shankar","email":"shashank.kumar.shankar@intel.com","username":"skshankar"},"change_message_id":"d71c6520d37ccc425a74976af2210ab8ae56bbdf","unresolved":false,"context_lines":[{"line_number":204,"context_line":"            return self._port[\u0027id\u0027]"},{"line_number":205,"context_line":""},{"line_number":206,"context_line":"        self.update_obj_fields({\u0027port_id\u0027: getter,"},{"line_number":207,"context_line":"                                \u0027host\u0027: \u0027host\u0027,"},{"line_number":208,"context_line":"                                \u0027level\u0027: 1,"},{"line_number":209,"context_line":"                                \u0027segment_id\u0027: self._segment[\u0027id\u0027]})"},{"line_number":210,"context_line":""},{"line_number":211,"context_line":""}],"source_content_type":"text/x-python","patch_set":34,"id":"7a3c09a3_3ca35351","line":208,"range":{"start_line":207,"start_character":32,"end_line":208,"end_character":43},"in_reply_to":"7a3c09a3_a4472b4a","updated":"2017-01-18 22:41:20.000000000","message":"Done","commit_id":"3e7ae4a3381792bebd366b041f1790f4159d27e2"},{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"741cb58922de5c575418fc5d301d829bd469bd71","unresolved":false,"context_lines":[{"line_number":204,"context_line":"            return self._port[\u0027id\u0027]"},{"line_number":205,"context_line":""},{"line_number":206,"context_line":"        self.update_obj_fields({\u0027port_id\u0027: getter,"},{"line_number":207,"context_line":"                                \u0027host\u0027: tools.get_random_string_list()[0],"},{"line_number":208,"context_line":"                                \u0027level\u0027: tools.get_random_integer(0, 10),"},{"line_number":209,"context_line":"                                \u0027segment_id\u0027: self._segment[\u0027id\u0027]})"},{"line_number":210,"context_line":""},{"line_number":211,"context_line":""}],"source_content_type":"text/x-python","patch_set":36,"id":"5a3905b3_2cf7a68d","line":208,"range":{"start_line":207,"start_character":31,"end_line":208,"end_character":73},"updated":"2017-01-24 20:56:37.000000000","message":"I think you can remove those two lines and leave the values already generated by base test class setUp() in place.","commit_id":"bf3a212bbcece83e753a092cb19ebd7ac14041c5"},{"author":{"_account_id":22774,"name":"Shashank Kumar Shankar","email":"shashank.kumar.shankar@intel.com","username":"skshankar"},"change_message_id":"790cdae43a31acd3166e844ac791d34aa07d85d4","unresolved":false,"context_lines":[{"line_number":204,"context_line":"            return self._port[\u0027id\u0027]"},{"line_number":205,"context_line":""},{"line_number":206,"context_line":"        self.update_obj_fields({\u0027port_id\u0027: getter,"},{"line_number":207,"context_line":"                                \u0027host\u0027: tools.get_random_string_list()[0],"},{"line_number":208,"context_line":"                                \u0027level\u0027: tools.get_random_integer(0, 10),"},{"line_number":209,"context_line":"                                \u0027segment_id\u0027: self._segment[\u0027id\u0027]})"},{"line_number":210,"context_line":""},{"line_number":211,"context_line":""}],"source_content_type":"text/x-python","patch_set":36,"id":"3a461143_a7c5715c","line":208,"range":{"start_line":207,"start_character":31,"end_line":208,"end_character":73},"in_reply_to":"5a3905b3_2cf7a68d","updated":"2017-01-25 16:57:10.000000000","message":"Done","commit_id":"bf3a212bbcece83e753a092cb19ebd7ac14041c5"}],"releasenotes/notes/deprecate-get_binding_levels-function-84012e104ac572a1.yaml":[{"author":{"_account_id":17120,"name":"Manjeet Singh Bhatia","email":"manjeet.s.bhatia@intel.com","username":"manjeets"},"change_message_id":"c22581941166706d712f51904358a6a6bfda1f57","unresolved":false,"context_lines":[{"line_number":4,"context_line":"    Function ``get_binding_levels`` from ``neutron.plugins.ml2.db`` module is"},{"line_number":5,"context_line":"    deprecated and will be removed in the future."},{"line_number":6,"context_line":"    New function ``get_binding_levels_objs`` should be used instead."},{"line_number":7,"context_line":"    This new function returns ``PortBindinLevel`` OVO objects."}],"source_content_type":"text/x-yaml","patch_set":71,"id":"3f79a3b5_ae38f69e","line":7,"range":{"start_line":7,"start_character":32,"end_line":7,"end_character":47},"updated":"2018-08-31 15:50:28.000000000","message":"PortBindingLevel","commit_id":"6fdd6a7008bf122ca4136d4c73f2c92a68e13b67"},{"author":{"_account_id":11975,"name":"Slawek Kaplonski","email":"skaplons@redhat.com","username":"slaweq"},"change_message_id":"b4ade0cecb17d745cdd29f5169c4e0be41d83f70","unresolved":false,"context_lines":[{"line_number":4,"context_line":"    Function ``get_binding_levels`` from ``neutron.plugins.ml2.db`` module is"},{"line_number":5,"context_line":"    deprecated and will be removed in the future."},{"line_number":6,"context_line":"    New function ``get_binding_levels_objs`` should be used instead."},{"line_number":7,"context_line":"    This new function returns ``PortBindinLevel`` OVO objects."}],"source_content_type":"text/x-yaml","patch_set":71,"id":"3f79a3b5_ca70b0dd","line":7,"range":{"start_line":7,"start_character":32,"end_line":7,"end_character":47},"in_reply_to":"3f79a3b5_ae38f69e","updated":"2018-09-01 08:26:55.000000000","message":"Done","commit_id":"6fdd6a7008bf122ca4136d4c73f2c92a68e13b67"}]}
