)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":16800,"name":"Rawlin Peters","email":"rawlin.peters@hpe.com","username":"rawlin"},"change_message_id":"656f7d12839364efe165598acb3957576cc945b7","unresolved":false,"context_lines":[{"line_number":11,"context_line":"callback registry to send/receive trunk and subports OVOs over the wire."},{"line_number":12,"context_line":""},{"line_number":13,"context_line":"More patches will follow up to complete the RPC integration; some stuff is"},{"line_number":14,"context_line":"still work in progress, but there is enough substance that make this"},{"line_number":15,"context_line":"patch worth on its own."},{"line_number":16,"context_line":""},{"line_number":17,"context_line":"Partially-implements: blueprint vlan-aware-vms"},{"line_number":18,"context_line":""}],"source_content_type":"text/x-gerrit-commit-message","patch_set":26,"id":"9ad45d7e_8494008b","line":15,"range":{"start_line":14,"start_character":54,"end_line":15,"end_character":11},"updated":"2016-08-11 22:13:24.000000000","message":"nit: \"that makes this patch worth it\"","commit_id":"31a4a66dcae0698e91640bc5eaf110425e304371"},{"author":{"_account_id":13770,"name":"Adolfo Duarte","email":"adduarte@redhat.com","username":"adolfoduarte"},"change_message_id":"abf8b21e4961175bcc85845401aba2176cda3e29","unresolved":false,"context_lines":[{"line_number":11,"context_line":"callback registry to send/receive trunk and subports OVOs over the wire."},{"line_number":12,"context_line":""},{"line_number":13,"context_line":"More patches will follow up to complete the RPC integration; some stuff is"},{"line_number":14,"context_line":"still work in progress, but there is enough substance that make this"},{"line_number":15,"context_line":"patch worth on its own."},{"line_number":16,"context_line":""},{"line_number":17,"context_line":"Partially-implements: blueprint vlan-aware-vms"},{"line_number":18,"context_line":""}],"source_content_type":"text/x-gerrit-commit-message","patch_set":26,"id":"9ad45d7e_38641148","line":15,"range":{"start_line":14,"start_character":54,"end_line":15,"end_character":11},"in_reply_to":"9ad45d7e_8494008b","updated":"2016-08-12 20:45:30.000000000","message":"Done","commit_id":"31a4a66dcae0698e91640bc5eaf110425e304371"}],"neutron/api/rpc/callbacks/resources.py":[{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"88793d135290c4269cd14559ee812881b2f685ee","unresolved":false,"context_lines":[{"line_number":14,"context_line":"from neutron.objects import trunk"},{"line_number":15,"context_line":""},{"line_number":16,"context_line":""},{"line_number":17,"context_line":"_TRUNK_CLS \u003d trunk.Trunk"},{"line_number":18,"context_line":"_QOS_POLICY_CLS \u003d policy.QosPolicy"},{"line_number":19,"context_line":"_SUBPORT_CLS \u003d trunk.SubPort"},{"line_number":20,"context_line":""}],"source_content_type":"text/x-python","patch_set":3,"id":"bacf61ea_a6e2ad9d","line":17,"updated":"2016-07-28 02:06:31.000000000","message":"these additions would allow trunk and subports to show up in resource_versions","commit_id":"b24a43d86086793180364a305a3c45f078c8a3d8"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"change_message_id":"107419ceb81046cbcb2da0206330cf6562951d31","unresolved":false,"context_lines":[{"line_number":12,"context_line":""},{"line_number":13,"context_line":"from neutron.objects.qos import policy"},{"line_number":14,"context_line":"from neutron.objects import trunk"},{"line_number":15,"context_line":""},{"line_number":16,"context_line":""},{"line_number":17,"context_line":"_TRUNK_CLS \u003d trunk.Trunk"},{"line_number":18,"context_line":"_QOS_POLICY_CLS \u003d policy.QosPolicy"}],"source_content_type":"text/x-python","patch_set":17,"id":"bacf61ea_19e017fa","line":15,"updated":"2016-08-03 13:13:36.000000000","message":"you only need 2 lines with the first function not the global vars","commit_id":"124d59e8a167663da2a5369bb5a684bfe1886bd5"},{"author":{"_account_id":13770,"name":"Adolfo Duarte","email":"adduarte@redhat.com","username":"adolfoduarte"},"change_message_id":"fbc6557d1c5a87da449890f0222c62f032e89c6c","unresolved":false,"context_lines":[{"line_number":12,"context_line":""},{"line_number":13,"context_line":"from neutron.objects.qos import policy"},{"line_number":14,"context_line":"from neutron.objects import trunk"},{"line_number":15,"context_line":""},{"line_number":16,"context_line":""},{"line_number":17,"context_line":"_TRUNK_CLS \u003d trunk.Trunk"},{"line_number":18,"context_line":"_QOS_POLICY_CLS \u003d policy.QosPolicy"}],"source_content_type":"text/x-python","patch_set":17,"id":"bacf61ea_704f9dbe","line":15,"in_reply_to":"bacf61ea_19e017fa","updated":"2016-08-03 15:48:26.000000000","message":"Done","commit_id":"124d59e8a167663da2a5369bb5a684bfe1886bd5"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"c4add22771f25b6448ac2a82257f1faa095c0a46","unresolved":false,"context_lines":[{"line_number":12,"context_line":""},{"line_number":13,"context_line":"from neutron.objects.qos import policy"},{"line_number":14,"context_line":"from neutron.objects import trunk"},{"line_number":15,"context_line":""},{"line_number":16,"context_line":""},{"line_number":17,"context_line":"_TRUNK_CLS \u003d trunk.Trunk"},{"line_number":18,"context_line":"_QOS_POLICY_CLS \u003d policy.QosPolicy"}],"source_content_type":"text/x-python","patch_set":17,"id":"bacf61ea_ccc98a27","line":15,"in_reply_to":"bacf61ea_704f9dbe","updated":"2016-08-03 19:51:31.000000000","message":"that\u0027s how it was, let\u0027s not screw up the diff for silly reasons.","commit_id":"124d59e8a167663da2a5369bb5a684bfe1886bd5"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"891327523647e50470a1c37116c56870c0b361ee","unresolved":false,"context_lines":[{"line_number":22,"context_line":"    _TRUNK_CLS,"},{"line_number":23,"context_line":"    _QOS_POLICY_CLS,"},{"line_number":24,"context_line":"    _SUBPORT_CLS,"},{"line_number":25,"context_line":")"},{"line_number":26,"context_line":""},{"line_number":27,"context_line":"_VALID_TYPES \u003d [cls.obj_name() for cls in _VALID_CLS]"},{"line_number":28,"context_line":""}],"source_content_type":"text/x-python","patch_set":22,"id":"9ad45d7e_86a5e805","line":25,"updated":"2016-08-08 20:54:05.000000000","message":"Aside: I don\u0027t get why we need all of these private intermediate values. It just seems like a lot for a code reviewer to read through. IMO, sometimes avoiding all duplication in code can be detrimental. But, it isn\u0027t this patch\u0027s fault. So, ignore me. ;) I just made a note here because I had to read through all of this.\n\n _VALID_TYPES \u003d _TYPE_TO_CLS_MAP.keys()\n\nIf you do that, the three values on L17-L19 aren\u0027t quite as compelling, they\u0027re just thin aliases for THING_CLS.obj_name()","commit_id":"e512d27a030f0c0ff23a52ab38d5ada83522413a"},{"author":{"_account_id":13770,"name":"Adolfo Duarte","email":"adduarte@redhat.com","username":"adolfoduarte"},"change_message_id":"35f902ed48596d527de2930b2fb9ebc8754bc481","unresolved":false,"context_lines":[{"line_number":22,"context_line":"    _TRUNK_CLS,"},{"line_number":23,"context_line":"    _QOS_POLICY_CLS,"},{"line_number":24,"context_line":"    _SUBPORT_CLS,"},{"line_number":25,"context_line":")"},{"line_number":26,"context_line":""},{"line_number":27,"context_line":"_VALID_TYPES \u003d [cls.obj_name() for cls in _VALID_CLS]"},{"line_number":28,"context_line":""}],"source_content_type":"text/x-python","patch_set":22,"id":"9ad45d7e_1f39b2d7","line":25,"in_reply_to":"9ad45d7e_6a894e26","updated":"2016-08-10 22:48:52.000000000","message":"Done","commit_id":"e512d27a030f0c0ff23a52ab38d5ada83522413a"},{"author":{"_account_id":8788,"name":"Miguel Angel Ajo","email":"mangelajo@redhat.com","username":"mangelajo"},"change_message_id":"ad97606a7264b54e393053a75d8edfbc43c31bae","unresolved":false,"context_lines":[{"line_number":22,"context_line":"    _TRUNK_CLS,"},{"line_number":23,"context_line":"    _QOS_POLICY_CLS,"},{"line_number":24,"context_line":"    _SUBPORT_CLS,"},{"line_number":25,"context_line":")"},{"line_number":26,"context_line":""},{"line_number":27,"context_line":"_VALID_TYPES \u003d [cls.obj_name() for cls in _VALID_CLS]"},{"line_number":28,"context_line":""}],"source_content_type":"text/x-python","patch_set":22,"id":"9ad45d7e_7cb10ae1","line":25,"in_reply_to":"9ad45d7e_6a894e26","updated":"2016-08-10 08:16:29.000000000","message":"Yes, it\u0027s a separate concern. This is not your patch\u0027s issue.","commit_id":"e512d27a030f0c0ff23a52ab38d5ada83522413a"},{"author":{"_account_id":8788,"name":"Miguel Angel Ajo","email":"mangelajo@redhat.com","username":"mangelajo"},"change_message_id":"4cb6881b3a442d1c079995ac885539aa60318e1c","unresolved":false,"context_lines":[{"line_number":22,"context_line":"    _TRUNK_CLS,"},{"line_number":23,"context_line":"    _QOS_POLICY_CLS,"},{"line_number":24,"context_line":"    _SUBPORT_CLS,"},{"line_number":25,"context_line":")"},{"line_number":26,"context_line":""},{"line_number":27,"context_line":"_VALID_TYPES \u003d [cls.obj_name() for cls in _VALID_CLS]"},{"line_number":28,"context_line":""}],"source_content_type":"text/x-python","patch_set":22,"id":"9ad45d7e_84ff8e00","line":25,"in_reply_to":"9ad45d7e_6cdd2e42","updated":"2016-08-09 12:31:54.000000000","message":"Not only that, IMHO (and as co-author of this code :P), I believe we should stop using \"whatever\".obj_name() or having an static _TYPE_TO_CLS_MAP, in favor of a dynamic registry of such objects \n\n@resources.pushable\nWhateverClassObject(NeutronObject)\n\nfor example.\n\nThis would avoid a lot of issues with circular dependencies in this module.\n\nThe initial intent of all those declarations, was to make sure we had tight control over which objects can be sent over the wire, since the interface was experimental and not well proven initially. But now that it\u0027s ready for rolling upgrades, we should probably move away from this model.\n\nI have a pending patch in that regard, but I will tackle it when ocata opens do avoid extra noise now.","commit_id":"e512d27a030f0c0ff23a52ab38d5ada83522413a"},{"author":{"_account_id":13770,"name":"Adolfo Duarte","email":"adduarte@redhat.com","username":"adolfoduarte"},"change_message_id":"d0e9872bd37f395bb7f05117a6676025964af55c","unresolved":false,"context_lines":[{"line_number":22,"context_line":"    _TRUNK_CLS,"},{"line_number":23,"context_line":"    _QOS_POLICY_CLS,"},{"line_number":24,"context_line":"    _SUBPORT_CLS,"},{"line_number":25,"context_line":")"},{"line_number":26,"context_line":""},{"line_number":27,"context_line":"_VALID_TYPES \u003d [cls.obj_name() for cls in _VALID_CLS]"},{"line_number":28,"context_line":""}],"source_content_type":"text/x-python","patch_set":22,"id":"9ad45d7e_6cdd2e42","line":25,"in_reply_to":"9ad45d7e_86a5e805","updated":"2016-08-08 22:51:14.000000000","message":"I agree","commit_id":"e512d27a030f0c0ff23a52ab38d5ada83522413a"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"3df55de40db90c7c13bb37897c89d5f12cdcad5c","unresolved":false,"context_lines":[{"line_number":22,"context_line":"    _TRUNK_CLS,"},{"line_number":23,"context_line":"    _QOS_POLICY_CLS,"},{"line_number":24,"context_line":"    _SUBPORT_CLS,"},{"line_number":25,"context_line":")"},{"line_number":26,"context_line":""},{"line_number":27,"context_line":"_VALID_TYPES \u003d [cls.obj_name() for cls in _VALID_CLS]"},{"line_number":28,"context_line":""}],"source_content_type":"text/x-python","patch_set":22,"id":"9ad45d7e_9bbfc95f","line":25,"in_reply_to":"9ad45d7e_86a5e805","updated":"2016-08-09 15:56:33.000000000","message":"I had the same thought, but I suppose we went we what we got and refactor later.","commit_id":"e512d27a030f0c0ff23a52ab38d5ada83522413a"},{"author":{"_account_id":13770,"name":"Adolfo Duarte","email":"adduarte@redhat.com","username":"adolfoduarte"},"change_message_id":"a5a9642380a2f3b2a0e0c5312054161ba6ab780a","unresolved":false,"context_lines":[{"line_number":22,"context_line":"    _TRUNK_CLS,"},{"line_number":23,"context_line":"    _QOS_POLICY_CLS,"},{"line_number":24,"context_line":"    _SUBPORT_CLS,"},{"line_number":25,"context_line":")"},{"line_number":26,"context_line":""},{"line_number":27,"context_line":"_VALID_TYPES \u003d [cls.obj_name() for cls in _VALID_CLS]"},{"line_number":28,"context_line":""}],"source_content_type":"text/x-python","patch_set":22,"id":"9ad45d7e_6a894e26","line":25,"in_reply_to":"9ad45d7e_9bbfc95f","updated":"2016-08-09 23:47:36.000000000","message":"so perhaps we leave as is and miguel can address in the patch he mentioned above.","commit_id":"e512d27a030f0c0ff23a52ab38d5ada83522413a"}],"neutron/cmd/sanity/checks.py":[{"author":{"_account_id":8788,"name":"Miguel Angel Ajo","email":"mangelajo@redhat.com","username":"mangelajo"},"change_message_id":"0400cf597a5ba21fa6f086c12ce5095ec6d3caca","unresolved":false,"context_lines":[{"line_number":379,"context_line":"    # If ML2 is the core plugin, check if the mech_drivers are"},{"line_number":380,"context_line":"    # enabled and compatible with existing trunk support."},{"line_number":381,"context_line":"    if cfg.CONF.ml2.mechanism_drivers:"},{"line_number":382,"context_line":"        return \u0027openvswitch\u0027 in cfg.CONF.ml2.mechanism_drivers"},{"line_number":383,"context_line":""},{"line_number":384,"context_line":""},{"line_number":385,"context_line":"def get_minimal_dibbler_version_supported():"}],"source_content_type":"text/x-python","patch_set":5,"id":"bacf61ea_5dcc4635","line":382,"updated":"2016-07-28 14:17:04.000000000","message":"Yeah, may be we can add some flag (or a is_trunk_supported attribute) to the existing mechanism drivers, so we can iterate over them and check if the flag is ON for any of them. That way any out-of-tree mechanism driver can declare it\u0027s support for is_trunk_supported.","commit_id":"0a9f320f1f38a36f80ef1564308f4f678d7931b7"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"83ccb42f79c61bab4bb0c847ed2b53c40541a159","unresolved":false,"context_lines":[{"line_number":379,"context_line":"    # If ML2 is the core plugin, check if the mech_drivers are"},{"line_number":380,"context_line":"    # enabled and compatible with existing trunk support."},{"line_number":381,"context_line":"    if cfg.CONF.ml2.mechanism_drivers:"},{"line_number":382,"context_line":"        return \u0027openvswitch\u0027 in cfg.CONF.ml2.mechanism_drivers"},{"line_number":383,"context_line":""},{"line_number":384,"context_line":""},{"line_number":385,"context_line":"def get_minimal_dibbler_version_supported():"}],"source_content_type":"text/x-python","patch_set":5,"id":"bacf61ea_795f9341","line":382,"in_reply_to":"bacf61ea_5dcc4635","updated":"2016-07-28 15:28:06.000000000","message":"Let me think about this a little more because I would like to keep things decoupled if I can.","commit_id":"0a9f320f1f38a36f80ef1564308f4f678d7931b7"},{"author":{"_account_id":19999,"name":"Trinath Somanchi","email":"trinaths.dev@gmail.com","username":"trinath-somanchi"},"change_message_id":"0e670b1c3fbb89bbc8b3ef030643302a0a19c887","unresolved":false,"context_lines":[{"line_number":380,"context_line":"    # enabled and compatible with existing trunk support."},{"line_number":381,"context_line":"    if cfg.CONF.ml2.mechanism_drivers:"},{"line_number":382,"context_line":"        return \u0027openvswitch\u0027 in cfg.CONF.ml2.mechanism_drivers"},{"line_number":383,"context_line":""},{"line_number":384,"context_line":""},{"line_number":385,"context_line":"def get_minimal_dibbler_version_supported():"},{"line_number":386,"context_line":"    return MINIMUM_DIBBLER_VERSION"}],"source_content_type":"text/x-python","patch_set":5,"id":"bacf61ea_59f2a1d3","line":383,"updated":"2016-07-28 10:54:26.000000000","message":"above, it is means that OVS mech-driver is compatible with trunk port. So how to handle with some other mech-driver?\nMight be that these compatible drivers to form config option.","commit_id":"0a9f320f1f38a36f80ef1564308f4f678d7931b7"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"045db7239a15bcd3f3413abdca44faa9c829bb41","unresolved":false,"context_lines":[{"line_number":378,"context_line":"def is_trunk_supported():"},{"line_number":379,"context_line":"    # If ML2 is the core plugin, check if the mech_drivers are"},{"line_number":380,"context_line":"    # enabled and compatible with existing trunk support."},{"line_number":381,"context_line":"    # TODO(armax): provide a more comphrensive way to validate"},{"line_number":382,"context_line":"    # support from out of tree drivers"},{"line_number":383,"context_line":"    if cfg.CONF.ml2.mechanism_drivers:"},{"line_number":384,"context_line":"        return \u0027openvswitch\u0027 in cfg.CONF.ml2.mechanism_drivers"}],"source_content_type":"text/x-python","patch_set":7,"id":"bacf61ea_5564f2e2","line":381,"updated":"2016-07-29 03:51:32.000000000","message":"I am going to try something else.","commit_id":"36447a4ca30737d80167ba2d1edc63d59dd92b2b"}],"neutron/cmd/sanity_check.py":[{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"16e85ab0de11471e0988cc8a0523e595b6b08837","unresolved":false,"context_lines":[{"line_number":228,"context_line":"                      \u0027is installed.\u0027))"},{"line_number":229,"context_line":"    return result"},{"line_number":230,"context_line":""},{"line_number":231,"context_line":""},{"line_number":232,"context_line":"# Define CLI opts to test specific features, with a callback for the test"},{"line_number":233,"context_line":"OPTS \u003d ["},{"line_number":234,"context_line":"    BoolOptCallback(\u0027ovs_vxlan\u0027, check_ovs_vxlan, default\u003dFalse,"}],"source_content_type":"text/x-python","patch_set":8,"id":"bacf61ea_a1009002","line":231,"updated":"2016-07-29 06:30:50.000000000","message":"doh!","commit_id":"7935ee1009ad81c80523466baba17bd3da6c5246"}],"neutron/plugins/ml2/drivers/agent/capabilities.py":[{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"88793d135290c4269cd14559ee812881b2f685ee","unresolved":false,"context_lines":[{"line_number":22,"context_line":"def subscribe_init_event(agent_type):"},{"line_number":23,"context_line":"    \"\"\"Subscribe to init event for the specified agent.\"\"\""},{"line_number":24,"context_line":"    # Add here subscriptions to init event for the specified agent;"},{"line_number":25,"context_line":"    # an agent may be capable to support more than one agent type."},{"line_number":26,"context_line":"    registry.subscribe(driver.init_handler, agent_type, events.AFTER_INIT)"}],"source_content_type":"text/x-python","patch_set":3,"id":"bacf61ea_e6f2e56e","line":25,"updated":"2016-07-28 02:06:31.000000000","message":"agent -\u003e handler","commit_id":"b24a43d86086793180364a305a3c45f078c8a3d8"},{"author":{"_account_id":7787,"name":"Kevin Benton","email":"kevin@benton.pub","username":"blak111"},"change_message_id":"418d6b72aaf3c37ff2d5106b1120f1778c4396cf","unresolved":false,"context_lines":[{"line_number":25,"context_line":"    # Add here subscriptions to init event for the specified agent;"},{"line_number":26,"context_line":"    # an handler may be capable to support more than one agent type."},{"line_number":27,"context_line":"    registry.subscribe("},{"line_number":28,"context_line":"        ovs_trunk_driver.init_handler, agent_type, events.AFTER_INIT)"}],"source_content_type":"text/x-python","patch_set":4,"id":"bacf61ea_0d4ab5c5","line":28,"updated":"2016-07-28 04:39:00.000000000","message":"this is in a generic l2 agent directory, but it has a direct reference to the ovs trunk driver here. Shouldn\u0027t the agent pass this in or something? I\u0027m not sure I understand how this is supposed to be used...","commit_id":"696c4a7ebdf455308f371a3cdfd2f2f0c67f1904"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"67324385b2dd71ed18cd34db44439972100fa003","unresolved":false,"context_lines":[{"line_number":25,"context_line":"    # Add here subscriptions to init event for the specified agent;"},{"line_number":26,"context_line":"    # an handler may be capable to support more than one agent type."},{"line_number":27,"context_line":"    registry.subscribe("},{"line_number":28,"context_line":"        ovs_trunk_driver.init_handler, agent_type, events.AFTER_INIT)"}],"source_content_type":"text/x-python","patch_set":4,"id":"bacf61ea_1807911d","line":28,"in_reply_to":"bacf61ea_0d4ab5c5","updated":"2016-07-28 05:39:30.000000000","message":"This is subscribing callbacks and it is ineffective until there\u0027s a notification for it [1], which is agent specific. I think I mixed things up a bit, let me revisit because this is not what I intended.\n\n[1] https://review.openstack.org/#/c/347662/4/neutron/plugins/ml2/drivers/openvswitch/agent/ovs_neutron_agent.py@2157","commit_id":"696c4a7ebdf455308f371a3cdfd2f2f0c67f1904"},{"author":{"_account_id":8788,"name":"Miguel Angel Ajo","email":"mangelajo@redhat.com","username":"mangelajo"},"change_message_id":"0400cf597a5ba21fa6f086c12ce5095ec6d3caca","unresolved":false,"context_lines":[{"line_number":13,"context_line":"from neutron.callbacks import registry"},{"line_number":14,"context_line":""},{"line_number":15,"context_line":""},{"line_number":16,"context_line":"def notify_init_event(agent_type, agent_handle):"},{"line_number":17,"context_line":"    \"\"\"Notify init event for the specified agent.\"\"\""},{"line_number":18,"context_line":"    registry.notify(agent_type, events.AFTER_INIT, agent_handle)"},{"line_number":19,"context_line":""}],"source_content_type":"text/x-python","patch_set":5,"id":"bacf61ea_003b85d2","line":16,"range":{"start_line":16,"start_character":34,"end_line":16,"end_character":46},"updated":"2016-07-28 14:17:04.000000000","message":"nit weaving: may be agent_object is more correct?, a handle is like an ID that can be translated into the real think (file descriptor), or a pointer sometimes. But this is the agent object as I see in neutron_ovs_agent","commit_id":"0a9f320f1f38a36f80ef1564308f4f678d7931b7"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"83ccb42f79c61bab4bb0c847ed2b53c40541a159","unresolved":false,"context_lines":[{"line_number":13,"context_line":"from neutron.callbacks import registry"},{"line_number":14,"context_line":""},{"line_number":15,"context_line":""},{"line_number":16,"context_line":"def notify_init_event(agent_type, agent_handle):"},{"line_number":17,"context_line":"    \"\"\"Notify init event for the specified agent.\"\"\""},{"line_number":18,"context_line":"    registry.notify(agent_type, events.AFTER_INIT, agent_handle)"},{"line_number":19,"context_line":""}],"source_content_type":"text/x-python","patch_set":5,"id":"bacf61ea_99540722","line":16,"range":{"start_line":16,"start_character":34,"end_line":16,"end_character":46},"in_reply_to":"bacf61ea_003b85d2","updated":"2016-07-28 15:28:06.000000000","message":"ack","commit_id":"0a9f320f1f38a36f80ef1564308f4f678d7931b7"},{"author":{"_account_id":13770,"name":"Adolfo Duarte","email":"adduarte@redhat.com","username":"adolfoduarte"},"change_message_id":"1469c956bb6067a11cd7c3491f7c6511986a8b28","unresolved":false,"context_lines":[{"line_number":14,"context_line":""},{"line_number":15,"context_line":""},{"line_number":16,"context_line":"def notify_init_event(agent_type, agent_handle):"},{"line_number":17,"context_line":"    \"\"\"Notify init event for the specified agent.\"\"\""},{"line_number":18,"context_line":"    registry.notify(agent_type, events.AFTER_INIT, agent_handle)"},{"line_number":19,"context_line":""},{"line_number":20,"context_line":""}],"source_content_type":"text/x-python","patch_set":5,"id":"bacf61ea_6e5884fb","line":17,"range":{"start_line":17,"start_character":4,"end_line":17,"end_character":52},"updated":"2016-07-28 09:10:19.000000000","message":"Perhaps : \"\"\" Notify all subscribed agent callbacks of event\"\"\"","commit_id":"0a9f320f1f38a36f80ef1564308f4f678d7931b7"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"83ccb42f79c61bab4bb0c847ed2b53c40541a159","unresolved":false,"context_lines":[{"line_number":14,"context_line":""},{"line_number":15,"context_line":""},{"line_number":16,"context_line":"def notify_init_event(agent_type, agent_handle):"},{"line_number":17,"context_line":"    \"\"\"Notify init event for the specified agent.\"\"\""},{"line_number":18,"context_line":"    registry.notify(agent_type, events.AFTER_INIT, agent_handle)"},{"line_number":19,"context_line":""},{"line_number":20,"context_line":""}],"source_content_type":"text/x-python","patch_set":5,"id":"bacf61ea_d934bffc","line":17,"range":{"start_line":17,"start_character":4,"end_line":17,"end_character":52},"in_reply_to":"bacf61ea_1d912ef1","updated":"2016-07-28 15:28:06.000000000","message":"ack","commit_id":"0a9f320f1f38a36f80ef1564308f4f678d7931b7"},{"author":{"_account_id":8788,"name":"Miguel Angel Ajo","email":"mangelajo@redhat.com","username":"mangelajo"},"change_message_id":"0400cf597a5ba21fa6f086c12ce5095ec6d3caca","unresolved":false,"context_lines":[{"line_number":14,"context_line":""},{"line_number":15,"context_line":""},{"line_number":16,"context_line":"def notify_init_event(agent_type, agent_handle):"},{"line_number":17,"context_line":"    \"\"\"Notify init event for the specified agent.\"\"\""},{"line_number":18,"context_line":"    registry.notify(agent_type, events.AFTER_INIT, agent_handle)"},{"line_number":19,"context_line":""},{"line_number":20,"context_line":""}],"source_content_type":"text/x-python","patch_set":5,"id":"bacf61ea_1d912ef1","line":17,"range":{"start_line":17,"start_character":4,"end_line":17,"end_character":52},"in_reply_to":"bacf61ea_6e5884fb","updated":"2016-07-28 14:17:04.000000000","message":"Can we document in docstring what\u0027s supposed to be in agent_type and agent_handle?","commit_id":"0a9f320f1f38a36f80ef1564308f4f678d7931b7"}],"neutron/plugins/ml2/drivers/openvswitch/agent/ovs_capabilities.py":[{"author":{"_account_id":13770,"name":"Adolfo Duarte","email":"adduarte@redhat.com","username":"adolfoduarte"},"change_message_id":"13d61b52b2552d118a50f89bff9c817db6d79047","unresolved":false,"context_lines":[{"line_number":18,"context_line":"def register():"},{"line_number":19,"context_line":"    \"\"\"Register OVS capabilities.\"\"\""},{"line_number":20,"context_line":"    # Add capabilities to be loaded during agent initialization"},{"line_number":21,"context_line":"    capabilities.register(driver.init_handler, constants.AGENT_TYPE_OVS)"}],"source_content_type":"text/x-python","patch_set":6,"id":"bacf61ea_97667c27","line":21,"range":{"start_line":21,"start_character":2,"end_line":21,"end_character":72},"updated":"2016-07-29 00:17:06.000000000","message":"This parameters are transposed I think. the prototype for neutron.plugins.ml2.drivers.agent.capabilities.register()\nis of the form def register(agent_type, callback)\nhttps://review.openstack.org/#/c/347662/6/neutron/plugins/ml2/drivers/agent/capabilities.py@21","commit_id":"564125af592a93ce17dd4765fb4bc0d5584db6a9"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"9d366b9056dc45e72f79d5e0b04eb1c12654d815","unresolved":false,"context_lines":[{"line_number":18,"context_line":"def register():"},{"line_number":19,"context_line":"    \"\"\"Register OVS capabilities.\"\"\""},{"line_number":20,"context_line":"    # Add capabilities to be loaded during agent initialization"},{"line_number":21,"context_line":"    capabilities.register(driver.init_handler, constants.AGENT_TYPE_OVS)"}],"source_content_type":"text/x-python","patch_set":6,"id":"bacf61ea_58fa70be","line":21,"range":{"start_line":21,"start_character":2,"end_line":21,"end_character":72},"in_reply_to":"bacf61ea_97667c27","updated":"2016-07-29 00:26:57.000000000","message":"good catch","commit_id":"564125af592a93ce17dd4765fb4bc0d5584db6a9"}],"neutron/plugins/ml2/drivers/openvswitch/agent/ovs_neutron_agent.py":[{"author":{"_account_id":13770,"name":"Adolfo Duarte","email":"adduarte@redhat.com","username":"adolfoduarte"},"change_message_id":"1469c956bb6067a11cd7c3491f7c6511986a8b28","unresolved":false,"context_lines":[{"line_number":58,"context_line":"from neutron.plugins.ml2.drivers.openvswitch.agent \\"},{"line_number":59,"context_line":"    import ovs_agent_extension_api as ovs_ext_api"},{"line_number":60,"context_line":"from neutron.plugins.ml2.drivers.openvswitch.agent \\"},{"line_number":61,"context_line":"     import ovs_capabilities"},{"line_number":62,"context_line":"from neutron.plugins.ml2.drivers.openvswitch.agent \\"},{"line_number":63,"context_line":"    import ovs_dvr_neutron_agent"},{"line_number":64,"context_line":""}],"source_content_type":"text/x-python","patch_set":5,"id":"bacf61ea_aeca7c4d","line":61,"range":{"start_line":61,"start_character":5,"end_line":61,"end_character":28},"updated":"2016-07-28 09:10:19.000000000","message":"? this module does not seem to be present.","commit_id":"0a9f320f1f38a36f80ef1564308f4f678d7931b7"},{"author":{"_account_id":19999,"name":"Trinath Somanchi","email":"trinaths.dev@gmail.com","username":"trinath-somanchi"},"change_message_id":"0e670b1c3fbb89bbc8b3ef030643302a0a19c887","unresolved":false,"context_lines":[{"line_number":58,"context_line":"from neutron.plugins.ml2.drivers.openvswitch.agent \\"},{"line_number":59,"context_line":"    import ovs_agent_extension_api as ovs_ext_api"},{"line_number":60,"context_line":"from neutron.plugins.ml2.drivers.openvswitch.agent \\"},{"line_number":61,"context_line":"     import ovs_capabilities"},{"line_number":62,"context_line":"from neutron.plugins.ml2.drivers.openvswitch.agent \\"},{"line_number":63,"context_line":"    import ovs_dvr_neutron_agent"},{"line_number":64,"context_line":""}],"source_content_type":"text/x-python","patch_set":5,"id":"bacf61ea_f96a7519","line":61,"range":{"start_line":61,"start_character":5,"end_line":61,"end_character":28},"in_reply_to":"bacf61ea_aeca7c4d","updated":"2016-07-28 10:54:26.000000000","message":"+1","commit_id":"0a9f320f1f38a36f80ef1564308f4f678d7931b7"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"83ccb42f79c61bab4bb0c847ed2b53c40541a159","unresolved":false,"context_lines":[{"line_number":58,"context_line":"from neutron.plugins.ml2.drivers.openvswitch.agent \\"},{"line_number":59,"context_line":"    import ovs_agent_extension_api as ovs_ext_api"},{"line_number":60,"context_line":"from neutron.plugins.ml2.drivers.openvswitch.agent \\"},{"line_number":61,"context_line":"     import ovs_capabilities"},{"line_number":62,"context_line":"from neutron.plugins.ml2.drivers.openvswitch.agent \\"},{"line_number":63,"context_line":"    import ovs_dvr_neutron_agent"},{"line_number":64,"context_line":""}],"source_content_type":"text/x-python","patch_set":5,"id":"bacf61ea_b930eb02","line":61,"range":{"start_line":61,"start_character":5,"end_line":61,"end_character":28},"in_reply_to":"bacf61ea_f96a7519","updated":"2016-07-28 15:28:06.000000000","message":"forgot git add .","commit_id":"0a9f320f1f38a36f80ef1564308f4f678d7931b7"},{"author":{"_account_id":13770,"name":"Adolfo Duarte","email":"adduarte@redhat.com","username":"adolfoduarte"},"change_message_id":"1469c956bb6067a11cd7c3491f7c6511986a8b28","unresolved":false,"context_lines":[{"line_number":2155,"context_line":""},{"line_number":2156,"context_line":"def main(bridge_classes):"},{"line_number":2157,"context_line":"    prepare_xen_compute()"},{"line_number":2158,"context_line":"    ovs_capabilities.register()"},{"line_number":2159,"context_line":"    validate_tunnel_config(cfg.CONF.AGENT.tunnel_types, cfg.CONF.OVS.local_ip)"},{"line_number":2160,"context_line":""},{"line_number":2161,"context_line":"    try:"}],"source_content_type":"text/x-python","patch_set":5,"id":"bacf61ea_4e1140ac","line":2158,"range":{"start_line":2158,"start_character":4,"end_line":2158,"end_character":31},"updated":"2016-07-28 09:10:19.000000000","message":"is this supposed to be capabilities.register(), or is ovs_capabilities not implemented jet?","commit_id":"0a9f320f1f38a36f80ef1564308f4f678d7931b7"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"83ccb42f79c61bab4bb0c847ed2b53c40541a159","unresolved":false,"context_lines":[{"line_number":2155,"context_line":""},{"line_number":2156,"context_line":"def main(bridge_classes):"},{"line_number":2157,"context_line":"    prepare_xen_compute()"},{"line_number":2158,"context_line":"    ovs_capabilities.register()"},{"line_number":2159,"context_line":"    validate_tunnel_config(cfg.CONF.AGENT.tunnel_types, cfg.CONF.OVS.local_ip)"},{"line_number":2160,"context_line":""},{"line_number":2161,"context_line":"    try:"}],"source_content_type":"text/x-python","patch_set":5,"id":"bacf61ea_5908cf2d","line":2158,"range":{"start_line":2158,"start_character":4,"end_line":2158,"end_character":31},"in_reply_to":"bacf61ea_4e1140ac","updated":"2016-07-28 15:28:06.000000000","message":"once I add the file this should be clear.","commit_id":"0a9f320f1f38a36f80ef1564308f4f678d7931b7"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"16e85ab0de11471e0988cc8a0523e595b6b08837","unresolved":false,"context_lines":[{"line_number":58,"context_line":"    import ovs_agent_extension_api as ovs_ext_api"},{"line_number":59,"context_line":"from neutron.plugins.ml2.drivers.openvswitch.agent \\"},{"line_number":60,"context_line":"    import ovs_dvr_neutron_agent"},{"line_number":61,"context_line":""},{"line_number":62,"context_line":""},{"line_number":63,"context_line":"LOG \u003d logging.getLogger(__name__)"},{"line_number":64,"context_line":"cfg.CONF.import_group(\u0027AGENT\u0027, \u0027neutron.plugins.ml2.drivers.openvswitch.\u0027"}],"source_content_type":"text/x-python","patch_set":8,"id":"bacf61ea_8103cc0c","side":"PARENT","line":61,"updated":"2016-07-29 06:30:50.000000000","message":"doh!","commit_id":"d07efa6b1e2ac2dc358f853a725c85a13a80e32a"},{"author":{"_account_id":7787,"name":"Kevin Benton","email":"kevin@benton.pub","username":"blak111"},"change_message_id":"0399ec1dc91713c5086c55bf57e4f79f58b1cef7","unresolved":false,"context_lines":[{"line_number":2161,"context_line":""},{"line_number":2162,"context_line":"    try:"},{"line_number":2163,"context_line":"        agent \u003d OVSNeutronAgent(bridge_classes, cfg.CONF)"},{"line_number":2164,"context_line":"        capabilities.notify_init_event(n_const.AGENT_TYPE_OVS, agent)"},{"line_number":2165,"context_line":"    except (RuntimeError, ValueError) as e:"},{"line_number":2166,"context_line":"        LOG.error(_LE(\"%s Agent terminated!\"), e)"},{"line_number":2167,"context_line":"        sys.exit(1)"}],"source_content_type":"text/x-python","patch_set":13,"id":"bacf61ea_ed2968e7","line":2164,"updated":"2016-08-01 19:34:16.000000000","message":"consume_in_threads() is called on the agent\u0027s connection during __init__. I think that will preclude the driver from correctly using the same connection if this notification happens afterwards.","commit_id":"f52710e4c44fb51ff149bbbf1074182652525646"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"01b81c12a28decf7fa9c07aa3b61c11d52492e19","unresolved":false,"context_lines":[{"line_number":2161,"context_line":""},{"line_number":2162,"context_line":"    try:"},{"line_number":2163,"context_line":"        agent \u003d OVSNeutronAgent(bridge_classes, cfg.CONF)"},{"line_number":2164,"context_line":"        capabilities.notify_init_event(n_const.AGENT_TYPE_OVS, agent)"},{"line_number":2165,"context_line":"    except (RuntimeError, ValueError) as e:"},{"line_number":2166,"context_line":"        LOG.error(_LE(\"%s Agent terminated!\"), e)"},{"line_number":2167,"context_line":"        sys.exit(1)"}],"source_content_type":"text/x-python","patch_set":13,"id":"bacf61ea_83a19b48","line":2164,"in_reply_to":"bacf61ea_ed2968e7","updated":"2016-08-01 20:26:37.000000000","message":"solved differently, as far as I can tell creating a new connection is not consuming any more resources than sharing one and I think it\u0027s better to decouple the code.","commit_id":"f52710e4c44fb51ff149bbbf1074182652525646"}],"neutron/services/trunk/drivers/__init__.py":[{"author":{"_account_id":7787,"name":"Kevin Benton","email":"kevin@benton.pub","username":"blak111"},"change_message_id":"418d6b72aaf3c37ff2d5106b1120f1778c4396cf","unresolved":false,"context_lines":[{"line_number":18,"context_line":""},{"line_number":19,"context_line":"def register():"},{"line_number":20,"context_line":"    \"\"\"Load the drivers for the service plugin.\"\"\""},{"line_number":21,"context_line":"    ovs_driver.register()"}],"source_content_type":"text/x-python","patch_set":4,"id":"bacf61ea_8d0ce595","line":21,"updated":"2016-07-28 04:39:00.000000000","message":"shouldn\u0027t the OVS mech driver do this? we might not want it registered if the OVS driver isn\u0027t running.","commit_id":"696c4a7ebdf455308f371a3cdfd2f2f0c67f1904"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"67324385b2dd71ed18cd34db44439972100fa003","unresolved":false,"context_lines":[{"line_number":18,"context_line":""},{"line_number":19,"context_line":"def register():"},{"line_number":20,"context_line":"    \"\"\"Load the drivers for the service plugin.\"\"\""},{"line_number":21,"context_line":"    ovs_driver.register()"}],"source_content_type":"text/x-python","patch_set":4,"id":"bacf61ea_98442175","line":21,"in_reply_to":"bacf61ea_8d0ce595","updated":"2016-07-28 05:39:30.000000000","message":"This is enabling the trunk service plugin to work with the open vswitch mech driver. It\u0027s a capability that the plugin has whether or not the mech_driver is configured, and therefore does not depend on whether the mech driver is registered. Now, let\u0027s assume that the mech driver is not registered, the handler associated to it is basically a no-op in that no agent would be correctly running and no trunk could be bound to the mech_driver technology.\n\nIn a nutshell, we don\u0027t have to tie the trunk plugin driver initialization to the mech driver initialization. The trunk driver support is ineffective if the driver is not configured, and the system is capable of dealing with the situation, or that\u0027s intention anyway :)","commit_id":"696c4a7ebdf455308f371a3cdfd2f2f0c67f1904"}],"neutron/services/trunk/drivers/base.py":[{"author":{"_account_id":7787,"name":"Kevin Benton","email":"kevin@benton.pub","username":"blak111"},"change_message_id":"18f29cd31ff684023bf6d15032ed8e8ebbd8e8ba","unresolved":false,"context_lines":[{"line_number":71,"context_line":"        trigger.register_driver(self)"},{"line_number":72,"context_line":"        # Set up the server-side RPC backend if the driver is loaded,"},{"line_number":73,"context_line":"        # it is agent based, and the RPC backend is not already initialized."},{"line_number":74,"context_line":"        if self.is_loaded and self.agent_type and not trigger.is_rpc_enabled():"},{"line_number":75,"context_line":"            trigger.set_rpc_backend(backend.ServerSideRpcBackend())"}],"source_content_type":"text/x-python","patch_set":13,"id":"bacf61ea_28ad2e88","line":74,"updated":"2016-08-01 19:53:06.000000000","message":"much nicer!","commit_id":"f52710e4c44fb51ff149bbbf1074182652525646"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"01b81c12a28decf7fa9c07aa3b61c11d52492e19","unresolved":false,"context_lines":[{"line_number":71,"context_line":"        trigger.register_driver(self)"},{"line_number":72,"context_line":"        # Set up the server-side RPC backend if the driver is loaded,"},{"line_number":73,"context_line":"        # it is agent based, and the RPC backend is not already initialized."},{"line_number":74,"context_line":"        if self.is_loaded and self.agent_type and not trigger.is_rpc_enabled():"},{"line_number":75,"context_line":"            trigger.set_rpc_backend(backend.ServerSideRpcBackend())"}],"source_content_type":"text/x-python","patch_set":13,"id":"bacf61ea_6366272b","line":74,"in_reply_to":"bacf61ea_28ad2e88","updated":"2016-08-01 20:26:37.000000000","message":"I know right? It takes me time to converge ;)","commit_id":"f52710e4c44fb51ff149bbbf1074182652525646"},{"author":{"_account_id":8788,"name":"Miguel Angel Ajo","email":"mangelajo@redhat.com","username":"mangelajo"},"change_message_id":"4cb6881b3a442d1c079995ac885539aa60318e1c","unresolved":false,"context_lines":[{"line_number":68,"context_line":"        register() method invocation."},{"line_number":69,"context_line":"        \"\"\""},{"line_number":70,"context_line":"        # Advertise yourself!"},{"line_number":71,"context_line":"        trigger.register_driver(self)"},{"line_number":72,"context_line":"        # Set up the server-side RPC backend if the driver is loaded,"},{"line_number":73,"context_line":"        # it is agent based, and the RPC backend is not already initialized."},{"line_number":74,"context_line":"        if self.is_loaded and self.agent_type and not trigger.is_rpc_enabled():"}],"source_content_type":"text/x-python","patch_set":22,"id":"9ad45d7e_640a5ad4","line":71,"updated":"2016-08-09 12:31:54.000000000","message":"I know trigger is the parameter name for callbacks, but in this case it becomes un-obvious to the reader what that object is specifically supposed to be.\n\nCan we change trigger parameter name for whatever the trigger is specifically in this callback (trunk_plugin) ? \n\nAlternatively can we explain that in the docstring by documenting the parameters?","commit_id":"e512d27a030f0c0ff23a52ab38d5ada83522413a"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"3df55de40db90c7c13bb37897c89d5f12cdcad5c","unresolved":false,"context_lines":[{"line_number":68,"context_line":"        register() method invocation."},{"line_number":69,"context_line":"        \"\"\""},{"line_number":70,"context_line":"        # Advertise yourself!"},{"line_number":71,"context_line":"        trigger.register_driver(self)"},{"line_number":72,"context_line":"        # Set up the server-side RPC backend if the driver is loaded,"},{"line_number":73,"context_line":"        # it is agent based, and the RPC backend is not already initialized."},{"line_number":74,"context_line":"        if self.is_loaded and self.agent_type and not trigger.is_rpc_enabled():"}],"source_content_type":"text/x-python","patch_set":22,"id":"9ad45d7e_b6e9041d","line":71,"in_reply_to":"9ad45d7e_640a5ad4","updated":"2016-08-09 15:56:33.000000000","message":"we could, but trigger is a well known parameter of the registry API [1], I am not sure it makes any difference. I\u0027d personally leave it also because the docstring is pretty self-explanatory and does mention the trunk plugin as the sender of the event.\n\n[1] https://github.com/openstack/neutron/blob/master/neutron/callbacks/manager.py#L118","commit_id":"e512d27a030f0c0ff23a52ab38d5ada83522413a"},{"author":{"_account_id":13770,"name":"Adolfo Duarte","email":"adduarte@redhat.com","username":"adolfoduarte"},"change_message_id":"35f902ed48596d527de2930b2fb9ebc8754bc481","unresolved":false,"context_lines":[{"line_number":68,"context_line":"        register() method invocation."},{"line_number":69,"context_line":"        \"\"\""},{"line_number":70,"context_line":"        # Advertise yourself!"},{"line_number":71,"context_line":"        trigger.register_driver(self)"},{"line_number":72,"context_line":"        # Set up the server-side RPC backend if the driver is loaded,"},{"line_number":73,"context_line":"        # it is agent based, and the RPC backend is not already initialized."},{"line_number":74,"context_line":"        if self.is_loaded and self.agent_type and not trigger.is_rpc_enabled():"}],"source_content_type":"text/x-python","patch_set":22,"id":"9ad45d7e_9f05a212","line":71,"in_reply_to":"9ad45d7e_8619edd9","updated":"2016-08-10 22:48:52.000000000","message":"Done","commit_id":"e512d27a030f0c0ff23a52ab38d5ada83522413a"},{"author":{"_account_id":8788,"name":"Miguel Angel Ajo","email":"mangelajo@redhat.com","username":"mangelajo"},"change_message_id":"ad97606a7264b54e393053a75d8edfbc43c31bae","unresolved":false,"context_lines":[{"line_number":68,"context_line":"        register() method invocation."},{"line_number":69,"context_line":"        \"\"\""},{"line_number":70,"context_line":"        # Advertise yourself!"},{"line_number":71,"context_line":"        trigger.register_driver(self)"},{"line_number":72,"context_line":"        # Set up the server-side RPC backend if the driver is loaded,"},{"line_number":73,"context_line":"        # it is agent based, and the RPC backend is not already initialized."},{"line_number":74,"context_line":"        if self.is_loaded and self.agent_type and not trigger.is_rpc_enabled():"}],"source_content_type":"text/x-python","patch_set":22,"id":"9ad45d7e_bcf9c282","line":71,"in_reply_to":"9ad45d7e_b6e9041d","updated":"2016-08-10 08:16:29.000000000","message":"First time I read this patch I had to go through the code to see where was the callback being sent to figure out what \"trigger\" was. \n\nCan I beg for \"params\" in docstring? :)","commit_id":"e512d27a030f0c0ff23a52ab38d5ada83522413a"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"fb31cb35b1b55b772424f4f788499604ec5e096e","unresolved":false,"context_lines":[{"line_number":68,"context_line":"        register() method invocation."},{"line_number":69,"context_line":"        \"\"\""},{"line_number":70,"context_line":"        # Advertise yourself!"},{"line_number":71,"context_line":"        trigger.register_driver(self)"},{"line_number":72,"context_line":"        # Set up the server-side RPC backend if the driver is loaded,"},{"line_number":73,"context_line":"        # it is agent based, and the RPC backend is not already initialized."},{"line_number":74,"context_line":"        if self.is_loaded and self.agent_type and not trigger.is_rpc_enabled():"}],"source_content_type":"text/x-python","patch_set":22,"id":"9ad45d7e_8619edd9","line":71,"in_reply_to":"9ad45d7e_bcf9c282","updated":"2016-08-10 17:44:13.000000000","message":"No need to beg, that\u0027s a more than sensible request! But you must admit, the documentation in these patches is way above average ;)","commit_id":"e512d27a030f0c0ff23a52ab38d5ada83522413a"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"9eeb0415b2c29b7e28944da2564baeb5f10a32ae","unresolved":false,"context_lines":[{"line_number":75,"context_line":"        trunk plugin so that they can integrate without an explicit"},{"line_number":76,"context_line":"        register() method invocation."},{"line_number":77,"context_line":""},{"line_number":78,"context_line":"        :param resource: resource (unused)"},{"line_number":79,"context_line":"        :param event: event (unused)"},{"line_number":80,"context_line":"        :param trigger: TrunkPlugin."},{"line_number":81,"context_line":"        \"\"\""}],"source_content_type":"text/x-python","patch_set":26,"id":"9ad45d7e_29b240e5","line":78,"updated":"2016-08-12 01:01:47.000000000","message":"this is constants.TRUNK_PLUGIN","commit_id":"31a4a66dcae0698e91640bc5eaf110425e304371"},{"author":{"_account_id":13770,"name":"Adolfo Duarte","email":"adduarte@redhat.com","username":"adolfoduarte"},"change_message_id":"8e5d9264debee026def7e7fd88c0530efbda9e67","unresolved":false,"context_lines":[{"line_number":75,"context_line":"        trunk plugin so that they can integrate without an explicit"},{"line_number":76,"context_line":"        register() method invocation."},{"line_number":77,"context_line":""},{"line_number":78,"context_line":"        :param resource: resource (unused)"},{"line_number":79,"context_line":"        :param event: event (unused)"},{"line_number":80,"context_line":"        :param trigger: TrunkPlugin."},{"line_number":81,"context_line":"        \"\"\""}],"source_content_type":"text/x-python","patch_set":26,"id":"9ad45d7e_b23b0238","line":78,"in_reply_to":"9ad45d7e_29b240e5","updated":"2016-08-12 19:01:07.000000000","message":"Done","commit_id":"31a4a66dcae0698e91640bc5eaf110425e304371"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"9eeb0415b2c29b7e28944da2564baeb5f10a32ae","unresolved":false,"context_lines":[{"line_number":76,"context_line":"        register() method invocation."},{"line_number":77,"context_line":""},{"line_number":78,"context_line":"        :param resource: resource (unused)"},{"line_number":79,"context_line":"        :param event: event (unused)"},{"line_number":80,"context_line":"        :param trigger: TrunkPlugin."},{"line_number":81,"context_line":"        \"\"\""},{"line_number":82,"context_line":"        # Register this driver with plugin !"}],"source_content_type":"text/x-python","patch_set":26,"id":"9ad45d7e_a9be30ab","line":79,"updated":"2016-08-12 01:01:47.000000000","message":"this is AFTER_INIT.","commit_id":"31a4a66dcae0698e91640bc5eaf110425e304371"},{"author":{"_account_id":13770,"name":"Adolfo Duarte","email":"adduarte@redhat.com","username":"adolfoduarte"},"change_message_id":"8e5d9264debee026def7e7fd88c0530efbda9e67","unresolved":false,"context_lines":[{"line_number":76,"context_line":"        register() method invocation."},{"line_number":77,"context_line":""},{"line_number":78,"context_line":"        :param resource: resource (unused)"},{"line_number":79,"context_line":"        :param event: event (unused)"},{"line_number":80,"context_line":"        :param trigger: TrunkPlugin."},{"line_number":81,"context_line":"        \"\"\""},{"line_number":82,"context_line":"        # Register this driver with plugin !"}],"source_content_type":"text/x-python","patch_set":26,"id":"9ad45d7e_f24a9aab","line":79,"in_reply_to":"9ad45d7e_a9be30ab","updated":"2016-08-12 19:01:07.000000000","message":"Done","commit_id":"31a4a66dcae0698e91640bc5eaf110425e304371"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"9eeb0415b2c29b7e28944da2564baeb5f10a32ae","unresolved":false,"context_lines":[{"line_number":79,"context_line":"        :param event: event (unused)"},{"line_number":80,"context_line":"        :param trigger: TrunkPlugin."},{"line_number":81,"context_line":"        \"\"\""},{"line_number":82,"context_line":"        # Register this driver with plugin !"},{"line_number":83,"context_line":"        trigger.register_driver(self)"},{"line_number":84,"context_line":"        # Set up the server-side RPC backend if the driver is loaded,"},{"line_number":85,"context_line":"        # it is agent based, and the RPC backend is not already initialized."}],"source_content_type":"text/x-python","patch_set":26,"id":"9ad45d7e_89a6ccab","line":82,"updated":"2016-08-12 01:01:47.000000000","message":"suggestion: just drop the comment.","commit_id":"31a4a66dcae0698e91640bc5eaf110425e304371"},{"author":{"_account_id":13770,"name":"Adolfo Duarte","email":"adduarte@redhat.com","username":"adolfoduarte"},"change_message_id":"8e5d9264debee026def7e7fd88c0530efbda9e67","unresolved":false,"context_lines":[{"line_number":79,"context_line":"        :param event: event (unused)"},{"line_number":80,"context_line":"        :param trigger: TrunkPlugin."},{"line_number":81,"context_line":"        \"\"\""},{"line_number":82,"context_line":"        # Register this driver with plugin !"},{"line_number":83,"context_line":"        trigger.register_driver(self)"},{"line_number":84,"context_line":"        # Set up the server-side RPC backend if the driver is loaded,"},{"line_number":85,"context_line":"        # it is agent based, and the RPC backend is not already initialized."}],"source_content_type":"text/x-python","patch_set":26,"id":"9ad45d7e_d253166b","line":82,"in_reply_to":"9ad45d7e_89a6ccab","updated":"2016-08-12 19:01:07.000000000","message":"Done","commit_id":"31a4a66dcae0698e91640bc5eaf110425e304371"}],"neutron/services/trunk/drivers/openvswitch/agent/driver.py":[{"author":{"_account_id":8788,"name":"Miguel Angel Ajo","email":"mangelajo@redhat.com","username":"mangelajo"},"change_message_id":"0400cf597a5ba21fa6f086c12ce5095ec6d3caca","unresolved":false,"context_lines":[{"line_number":17,"context_line":"    def __init__(self, connection\u003dNone):"},{"line_number":18,"context_line":"        super(OVSTrunkSkeleton, self).__init__(connection)"},{"line_number":19,"context_line":""},{"line_number":20,"context_line":"    def handle_subports(self, subports, event_type):"},{"line_number":21,"context_line":"        # TODO(armax): call into TrunkManager to wire the subports"},{"line_number":22,"context_line":"        pass"},{"line_number":23,"context_line":""}],"source_content_type":"text/x-python","patch_set":5,"id":"bacf61ea_80d01555","line":20,"updated":"2016-07-28 14:17:04.000000000","message":"I suspect you could make this by creating an l2 extension that listens to TrunkPort objects \u0026 SubPort objects over the wire, and the handle_subports would be called by yourself when you receive such events.","commit_id":"0a9f320f1f38a36f80ef1564308f4f678d7931b7"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"83ccb42f79c61bab4bb0c847ed2b53c40541a159","unresolved":false,"context_lines":[{"line_number":17,"context_line":"    def __init__(self, connection\u003dNone):"},{"line_number":18,"context_line":"        super(OVSTrunkSkeleton, self).__init__(connection)"},{"line_number":19,"context_line":""},{"line_number":20,"context_line":"    def handle_subports(self, subports, event_type):"},{"line_number":21,"context_line":"        # TODO(armax): call into TrunkManager to wire the subports"},{"line_number":22,"context_line":"        pass"},{"line_number":23,"context_line":""}],"source_content_type":"text/x-python","patch_set":5,"id":"bacf61ea_04838e57","line":20,"in_reply_to":"bacf61ea_80d01555","updated":"2016-07-28 15:28:06.000000000","message":"I wanted to avoid using an L2 extension for a couple of reasons: a) simplify the deployment config required, whilst at the same time tighten the ability to customize the platform; b) decouple the trunk logic from the existing port processing logic as the nature of the elements involved is fundamentally different.","commit_id":"0a9f320f1f38a36f80ef1564308f4f678d7931b7"},{"author":{"_account_id":13770,"name":"Adolfo Duarte","email":"adduarte@redhat.com","username":"adolfoduarte"},"change_message_id":"13d61b52b2552d118a50f89bff9c817db6d79047","unresolved":false,"context_lines":[{"line_number":17,"context_line":"    def __init__(self, connection\u003dNone):"},{"line_number":18,"context_line":"        super(OVSTrunkSkeleton, self).__init__(connection)"},{"line_number":19,"context_line":""},{"line_number":20,"context_line":"    def handle_subports(self, subports, event_type):"},{"line_number":21,"context_line":"        # TODO(armax): call into TrunkManager to wire the subports"},{"line_number":22,"context_line":"        pass"},{"line_number":23,"context_line":""}],"source_content_type":"text/x-python","patch_set":6,"id":"bacf61ea_1d6e2a01","line":20,"range":{"start_line":20,"start_character":8,"end_line":20,"end_character":23},"updated":"2016-07-29 00:17:06.000000000","message":"This is probably \"handle_subport\" if we look at \nhttps://review.openstack.org/#/c/347662/6/neutron/services/trunk/rpc/agent.py@52, \nalthought once we have bulk_push from https://review.openstack.org/#/c/348476/1/neutron/api/rpc/handlers/resources_rpc.py we can probably add both handle_subport and handle_subports","commit_id":"564125af592a93ce17dd4765fb4bc0d5584db6a9"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"9d366b9056dc45e72f79d5e0b04eb1c12654d815","unresolved":false,"context_lines":[{"line_number":17,"context_line":"    def __init__(self, connection\u003dNone):"},{"line_number":18,"context_line":"        super(OVSTrunkSkeleton, self).__init__(connection)"},{"line_number":19,"context_line":""},{"line_number":20,"context_line":"    def handle_subports(self, subports, event_type):"},{"line_number":21,"context_line":"        # TODO(armax): call into TrunkManager to wire the subports"},{"line_number":22,"context_line":"        pass"},{"line_number":23,"context_line":""}],"source_content_type":"text/x-python","patch_set":6,"id":"bacf61ea_d805c0c2","line":20,"range":{"start_line":20,"start_character":8,"end_line":20,"end_character":23},"in_reply_to":"bacf61ea_1d6e2a01","updated":"2016-07-29 00:26:57.000000000","message":"correct","commit_id":"564125af592a93ce17dd4765fb4bc0d5584db6a9"},{"author":{"_account_id":13770,"name":"Adolfo Duarte","email":"adduarte@redhat.com","username":"adolfoduarte"},"change_message_id":"8c5de36bc2e605fd71024574cc36ae14a76ff809","unresolved":false,"context_lines":[{"line_number":17,"context_line":"    def __init__(self, connection\u003dNone):"},{"line_number":18,"context_line":"        super(OVSTrunkSkeleton, self).__init__(connection)"},{"line_number":19,"context_line":""},{"line_number":20,"context_line":"    def handle_subport(self, subports, event_type):"},{"line_number":21,"context_line":"        # TODO(fitoduarte): call into TrunkManager to wire single port"},{"line_number":22,"context_line":"        pass"},{"line_number":23,"context_line":""}],"source_content_type":"text/x-python","patch_set":7,"id":"bacf61ea_55afd280","line":20,"range":{"start_line":20,"start_character":29,"end_line":20,"end_character":37},"updated":"2016-07-29 05:53:40.000000000","message":"nit. should be singular not plural","commit_id":"36447a4ca30737d80167ba2d1edc63d59dd92b2b"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"9c60a882c3a2ed513dc2b58f89638d0cc865ff71","unresolved":false,"context_lines":[{"line_number":17,"context_line":"    def __init__(self, connection\u003dNone):"},{"line_number":18,"context_line":"        super(OVSTrunkSkeleton, self).__init__(connection)"},{"line_number":19,"context_line":""},{"line_number":20,"context_line":"    def handle_subport(self, subports, event_type):"},{"line_number":21,"context_line":"        # TODO(fitoduarte): call into TrunkManager to wire single port"},{"line_number":22,"context_line":"        pass"},{"line_number":23,"context_line":""}],"source_content_type":"text/x-python","patch_set":7,"id":"bacf61ea_06c1b280","line":20,"range":{"start_line":20,"start_character":29,"end_line":20,"end_character":37},"in_reply_to":"bacf61ea_55afd280","updated":"2016-07-29 05:59:58.000000000","message":"I would like to rebase on top of Ajo\u0027s patch and try a few things out, I think we should try and go back to bulk and see how it sticks.","commit_id":"36447a4ca30737d80167ba2d1edc63d59dd92b2b"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"change_message_id":"107419ceb81046cbcb2da0206330cf6562951d31","unresolved":false,"context_lines":[{"line_number":35,"context_line":""},{"line_number":36,"context_line":"    def handle_subports(self, subports, event_type):"},{"line_number":37,"context_line":"        # TODO(armax): call into TrunkManager to wire the subports"},{"line_number":38,"context_line":"        LOG.debug(\"Event %s for subports: %s\", (event_type, subports))"},{"line_number":39,"context_line":""},{"line_number":40,"context_line":""},{"line_number":41,"context_line":"def init_handler(resource, event, trigger, agent\u003dNone):"}],"source_content_type":"text/x-python","patch_set":17,"id":"bacf61ea_f9870310","line":38,"updated":"2016-08-03 13:13:36.000000000","message":"LOG.debug(\"Event %s for subports: %s\", event_type, subports)\n\nelse you will be printing a set to the first param","commit_id":"124d59e8a167663da2a5369bb5a684bfe1886bd5"},{"author":{"_account_id":13770,"name":"Adolfo Duarte","email":"adduarte@redhat.com","username":"adolfoduarte"},"change_message_id":"fbc6557d1c5a87da449890f0222c62f032e89c6c","unresolved":false,"context_lines":[{"line_number":35,"context_line":""},{"line_number":36,"context_line":"    def handle_subports(self, subports, event_type):"},{"line_number":37,"context_line":"        # TODO(armax): call into TrunkManager to wire the subports"},{"line_number":38,"context_line":"        LOG.debug(\"Event %s for subports: %s\", (event_type, subports))"},{"line_number":39,"context_line":""},{"line_number":40,"context_line":""},{"line_number":41,"context_line":"def init_handler(resource, event, trigger, agent\u003dNone):"}],"source_content_type":"text/x-python","patch_set":17,"id":"bacf61ea_f0beed62","line":38,"in_reply_to":"bacf61ea_f9870310","updated":"2016-08-03 15:48:26.000000000","message":"Done","commit_id":"124d59e8a167663da2a5369bb5a684bfe1886bd5"},{"author":{"_account_id":8655,"name":"Jakub Libosvar","email":"libosvar@redhat.com","username":"jlibosva"},"change_message_id":"314af9f5641bf0a4a84b31a5c13a9fb6888a7830","unresolved":false,"context_lines":[{"line_number":35,"context_line":""},{"line_number":36,"context_line":"    def handle_subports(self, subports, event_type):"},{"line_number":37,"context_line":"        # TODO(armax): call into TrunkManager to wire the subports"},{"line_number":38,"context_line":"        LOG.debug(\"Event %s for subports: %s\", (event_type, subports))"},{"line_number":39,"context_line":""},{"line_number":40,"context_line":""},{"line_number":41,"context_line":"def init_handler(resource, event, trigger, agent\u003dNone):"}],"source_content_type":"text/x-python","patch_set":17,"id":"bacf61ea_f0eb8d10","line":38,"in_reply_to":"bacf61ea_f9870310","updated":"2016-08-03 15:37:54.000000000","message":"Good catch :)","commit_id":"124d59e8a167663da2a5369bb5a684bfe1886bd5"}],"neutron/services/trunk/drivers/openvswitch/driver.py":[{"author":{"_account_id":16800,"name":"Rawlin Peters","email":"rawlin.peters@hpe.com","username":"rawlin"},"change_message_id":"1b189f1dd3820fc6461c57be32a854cefb3194a4","unresolved":false,"context_lines":[{"line_number":104,"context_line":"    :param **kwargs: contains context, trunk dict, and list of subports"},{"line_number":105,"context_line":"    \"\"\""},{"line_number":106,"context_line":""},{"line_number":107,"context_line":"    trunk \u003d kwargs[\u0027trunk\u0027]"},{"line_number":108,"context_line":"    context \u003d kwargs[\u0027context\u0027]"},{"line_number":109,"context_line":"    core_plugin \u003d manager.NeutronManager.get_plugin()"},{"line_number":110,"context_line":"    trunk_parent \u003d core_plugin.get_port(context, trunk[\u0027port_id\u0027])"}],"source_content_type":"text/x-python","patch_set":2,"id":"bacf61ea_80dddc72","line":107,"range":{"start_line":107,"start_character":4,"end_line":107,"end_character":27},"updated":"2016-07-27 19:32:00.000000000","message":"Just leaving a note here that this needs to be updated for the latest payload from [1]. I\u0027m sure it\u0027s already in the plan :)\n\n[1] https://review.openstack.org/#/c/341212/","commit_id":"ff6f4ae079db59efdb6bc4fbeb1ddc967eec54c9"},{"author":{"_account_id":4187,"name":"Ryan Tidwell","email":"rtidwell@suse.com","username":"ryan-tidwell"},"change_message_id":"afa73b830e8c6a69bbe2186510c66bba9fe8c6dd","unresolved":false,"context_lines":[{"line_number":104,"context_line":"    :param **kwargs: contains context, trunk dict, and list of subports"},{"line_number":105,"context_line":"    \"\"\""},{"line_number":106,"context_line":""},{"line_number":107,"context_line":"    trunk \u003d kwargs[\u0027trunk\u0027]"},{"line_number":108,"context_line":"    context \u003d kwargs[\u0027context\u0027]"},{"line_number":109,"context_line":"    core_plugin \u003d manager.NeutronManager.get_plugin()"},{"line_number":110,"context_line":"    trunk_parent \u003d core_plugin.get_port(context, trunk[\u0027port_id\u0027])"}],"source_content_type":"text/x-python","patch_set":2,"id":"bacf61ea_a3ee2aea","line":107,"range":{"start_line":107,"start_character":4,"end_line":107,"end_character":27},"in_reply_to":"bacf61ea_80dddc72","updated":"2016-07-27 19:56:08.000000000","message":"Done","commit_id":"ff6f4ae079db59efdb6bc4fbeb1ddc967eec54c9"},{"author":{"_account_id":4187,"name":"Ryan Tidwell","email":"rtidwell@suse.com","username":"ryan-tidwell"},"change_message_id":"6dab85aadf3052342714f18eb870a482fbb8b60e","unresolved":false,"context_lines":[{"line_number":33,"context_line":"def register():"},{"line_number":34,"context_line":"    \"\"\"Initialize the driver to process registry events.\"\"\""},{"line_number":35,"context_line":"    # To set up the server-side RPC backend as this driver needs it."},{"line_number":36,"context_line":"    registry.subscribe(backend.setup_rpc,"},{"line_number":37,"context_line":"                       trunk_consts.TRUNK_PLUGIN,"},{"line_number":38,"context_line":"                       events.AFTER_INIT)"},{"line_number":39,"context_line":"    # To advertise the driver capabilities."}],"source_content_type":"text/x-python","patch_set":7,"id":"bacf61ea_405272de","line":36,"range":{"start_line":36,"start_character":23,"end_line":36,"end_character":40},"updated":"2016-07-29 04:46:05.000000000","message":"It would seem the backend RPC is needed in general. Why would this not be setup by the plugin? It also would seem this driver lacks any sort meat to it. I wonder what the value of this is. Have we over-engineered this? I\u0027m not seeing anything that is truly OVS-specific server-side as we flesh this out. I\u0027d be curious to get some thoughts on how this driver fleshes out (if it indeed does)","commit_id":"36447a4ca30737d80167ba2d1edc63d59dd92b2b"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"bed84cde1f0dc97cb6acf8430bb59611986cc20d","unresolved":false,"context_lines":[{"line_number":33,"context_line":"def register():"},{"line_number":34,"context_line":"    \"\"\"Initialize the driver to process registry events.\"\"\""},{"line_number":35,"context_line":"    # To set up the server-side RPC backend as this driver needs it."},{"line_number":36,"context_line":"    registry.subscribe(backend.setup_rpc,"},{"line_number":37,"context_line":"                       trunk_consts.TRUNK_PLUGIN,"},{"line_number":38,"context_line":"                       events.AFTER_INIT)"},{"line_number":39,"context_line":"    # To advertise the driver capabilities."}],"source_content_type":"text/x-python","patch_set":7,"id":"bacf61ea_d2d0d421","line":36,"range":{"start_line":36,"start_character":23,"end_line":36,"end_character":40},"in_reply_to":"bacf61ea_2c2d9b95","updated":"2016-07-29 17:10:13.000000000","message":"Agreed indeed.","commit_id":"36447a4ca30737d80167ba2d1edc63d59dd92b2b"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"865f85b58a049d07dedc59e2e28436efa5f53d18","unresolved":false,"context_lines":[{"line_number":33,"context_line":"def register():"},{"line_number":34,"context_line":"    \"\"\"Initialize the driver to process registry events.\"\"\""},{"line_number":35,"context_line":"    # To set up the server-side RPC backend as this driver needs it."},{"line_number":36,"context_line":"    registry.subscribe(backend.setup_rpc,"},{"line_number":37,"context_line":"                       trunk_consts.TRUNK_PLUGIN,"},{"line_number":38,"context_line":"                       events.AFTER_INIT)"},{"line_number":39,"context_line":"    # To advertise the driver capabilities."}],"source_content_type":"text/x-python","patch_set":7,"id":"bacf61ea_fb919753","line":36,"range":{"start_line":36,"start_character":23,"end_line":36,"end_character":40},"in_reply_to":"bacf61ea_405272de","updated":"2016-07-29 05:34:43.000000000","message":"It is true that right now most of the server side logic turned out to be generic and I see nothing wrong about that. Rather than over engineering, this looks to me a very clean separation of concerns and encapsulation of OVS specifics like those at line 46. Besides this gives us room for growth in case the server side logic does need to become OVS specific. The modularity is already in place and we don\u0027t have to refactor later.\n\nAs for the  rpc backend registration at line 36, I can agree that this could be done explicitly in the plugin: that can save us a couple of calls and reduce one level of indirection, but is that really a cost worth saving? Perhaps we can consider moving it once all the dust settles and we can look at the bigger picture.","commit_id":"36447a4ca30737d80167ba2d1edc63d59dd92b2b"},{"author":{"_account_id":16800,"name":"Rawlin Peters","email":"rawlin.peters@hpe.com","username":"rawlin"},"change_message_id":"fef2a0ec80c83c44cd49c055b643b536bfddee8d","unresolved":false,"context_lines":[{"line_number":33,"context_line":"def register():"},{"line_number":34,"context_line":"    \"\"\"Initialize the driver to process registry events.\"\"\""},{"line_number":35,"context_line":"    # To set up the server-side RPC backend as this driver needs it."},{"line_number":36,"context_line":"    registry.subscribe(backend.setup_rpc,"},{"line_number":37,"context_line":"                       trunk_consts.TRUNK_PLUGIN,"},{"line_number":38,"context_line":"                       events.AFTER_INIT)"},{"line_number":39,"context_line":"    # To advertise the driver capabilities."}],"source_content_type":"text/x-python","patch_set":7,"id":"bacf61ea_2c2d9b95","line":36,"range":{"start_line":36,"start_character":23,"end_line":36,"end_character":40},"in_reply_to":"bacf61ea_666eae96","updated":"2016-07-29 16:37:13.000000000","message":"Keep in mind I\u0027m also putting some server-side OVS-specific logic into this file in [1]. Without this file, I don\u0027t know where else it would logically fit.\n\n[1] https://review.openstack.org/#/c/343816/","commit_id":"36447a4ca30737d80167ba2d1edc63d59dd92b2b"},{"author":{"_account_id":4187,"name":"Ryan Tidwell","email":"rtidwell@suse.com","username":"ryan-tidwell"},"change_message_id":"20e8b4adc77c0d36430abd5e6dbad3c7b4c9dacf","unresolved":false,"context_lines":[{"line_number":33,"context_line":"def register():"},{"line_number":34,"context_line":"    \"\"\"Initialize the driver to process registry events.\"\"\""},{"line_number":35,"context_line":"    # To set up the server-side RPC backend as this driver needs it."},{"line_number":36,"context_line":"    registry.subscribe(backend.setup_rpc,"},{"line_number":37,"context_line":"                       trunk_consts.TRUNK_PLUGIN,"},{"line_number":38,"context_line":"                       events.AFTER_INIT)"},{"line_number":39,"context_line":"    # To advertise the driver capabilities."}],"source_content_type":"text/x-python","patch_set":7,"id":"bacf61ea_fbfeb736","line":36,"range":{"start_line":36,"start_character":23,"end_line":36,"end_character":40},"in_reply_to":"bacf61ea_fb919753","updated":"2016-07-29 05:45:15.000000000","message":"The reason I bring this up is that the only interesting thing this does is at L36. I agree that the design is clean. I\u0027m just not seeing any OVS-specific logic yet. This leads me to ask if providing a driver at this stage adds any value.\n\nPerhaps the value of this module is derived simply by laying out a blueprint for future enhancement, even if functionally this doesn\u0027t really add much value at the moment. I\u0027m more pointing this out to ensure we\u0027re covering any blind spots we might have.","commit_id":"36447a4ca30737d80167ba2d1edc63d59dd92b2b"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"9c60a882c3a2ed513dc2b58f89638d0cc865ff71","unresolved":false,"context_lines":[{"line_number":33,"context_line":"def register():"},{"line_number":34,"context_line":"    \"\"\"Initialize the driver to process registry events.\"\"\""},{"line_number":35,"context_line":"    # To set up the server-side RPC backend as this driver needs it."},{"line_number":36,"context_line":"    registry.subscribe(backend.setup_rpc,"},{"line_number":37,"context_line":"                       trunk_consts.TRUNK_PLUGIN,"},{"line_number":38,"context_line":"                       events.AFTER_INIT)"},{"line_number":39,"context_line":"    # To advertise the driver capabilities."}],"source_content_type":"text/x-python","patch_set":7,"id":"bacf61ea_666eae96","line":36,"range":{"start_line":36,"start_character":23,"end_line":36,"end_character":40},"in_reply_to":"bacf61ea_fbfeb736","updated":"2016-07-29 05:59:58.000000000","message":"I appreciate it and I am with you. I am actually going to add a bit more beef here, and that helps justifying the usefulness of this bit.","commit_id":"36447a4ca30737d80167ba2d1edc63d59dd92b2b"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"95dd5a581e2afafea9566fcd9c8801d465bc68f9","unresolved":false,"context_lines":[{"line_number":38,"context_line":"                       trunk_consts.TRUNK_PLUGIN,"},{"line_number":39,"context_line":"                       events.AFTER_INIT)"},{"line_number":40,"context_line":"    # To advertise the driver capabilities."},{"line_number":41,"context_line":"    registry.subscribe(driver_setup,"},{"line_number":42,"context_line":"                       trunk_consts.TRUNK_PLUGIN,"},{"line_number":43,"context_line":"                       events.AFTER_INIT)"},{"line_number":44,"context_line":"    LOG.debug(\u0027Open vSwitch trunk driver registered\u0027)"}],"source_content_type":"text/x-python","patch_set":8,"id":"bacf61ea_e4fb8fbf","line":41,"updated":"2016-07-29 21:15:45.000000000","message":"I would move this subscribe ahead of the other one, it seems more logical to me.","commit_id":"7935ee1009ad81c80523466baba17bd3da6c5246"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"602ce79b3cfb279f1884111371287503a7efd87d","unresolved":false,"context_lines":[{"line_number":45,"context_line":""},{"line_number":46,"context_line":""},{"line_number":47,"context_line":"def driver_setup(resource, event, trigger, **kwargs):"},{"line_number":48,"context_line":"    \"\"\"Advertise interface and agent supported.\"\"\""},{"line_number":49,"context_line":"    driver \u003d {\u0027openvswitch\u0027: \u0027openvswitch\u0027 in cfg.CONF.ml2.mechanism_drivers}"},{"line_number":50,"context_line":"    trigger.add_driver_support("},{"line_number":51,"context_line":"        driver, constants.AGENT_TYPE_OVS, SUPPORTED_INTERFACES)"}],"source_content_type":"text/x-python","patch_set":8,"id":"bacf61ea_a19c10c1","line":48,"updated":"2016-07-29 06:33:14.000000000","message":"revise docstring","commit_id":"7935ee1009ad81c80523466baba17bd3da6c5246"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"602ce79b3cfb279f1884111371287503a7efd87d","unresolved":false,"context_lines":[{"line_number":46,"context_line":""},{"line_number":47,"context_line":"def driver_setup(resource, event, trigger, **kwargs):"},{"line_number":48,"context_line":"    \"\"\"Advertise interface and agent supported.\"\"\""},{"line_number":49,"context_line":"    driver \u003d {\u0027openvswitch\u0027: \u0027openvswitch\u0027 in cfg.CONF.ml2.mechanism_drivers}"},{"line_number":50,"context_line":"    trigger.add_driver_support("},{"line_number":51,"context_line":"        driver, constants.AGENT_TYPE_OVS, SUPPORTED_INTERFACES)"}],"source_content_type":"text/x-python","patch_set":8,"id":"bacf61ea_81862c63","line":49,"range":{"start_line":49,"start_character":29,"end_line":49,"end_character":76},"updated":"2016-07-29 06:33:14.000000000","message":"may want to wrap this into a util function, but meh...","commit_id":"7935ee1009ad81c80523466baba17bd3da6c5246"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"95dd5a581e2afafea9566fcd9c8801d465bc68f9","unresolved":false,"context_lines":[{"line_number":46,"context_line":""},{"line_number":47,"context_line":"def driver_setup(resource, event, trigger, **kwargs):"},{"line_number":48,"context_line":"    \"\"\"Advertise interface and agent supported.\"\"\""},{"line_number":49,"context_line":"    driver \u003d {\u0027openvswitch\u0027: \u0027openvswitch\u0027 in cfg.CONF.ml2.mechanism_drivers}"},{"line_number":50,"context_line":"    trigger.add_driver_support("},{"line_number":51,"context_line":"        driver, constants.AGENT_TYPE_OVS, SUPPORTED_INTERFACES)"}],"source_content_type":"text/x-python","patch_set":8,"id":"bacf61ea_440c1bed","line":49,"range":{"start_line":49,"start_character":29,"end_line":49,"end_character":76},"in_reply_to":"bacf61ea_81862c63","updated":"2016-07-29 21:15:45.000000000","message":"Thinking again, it would be indeed useful to extract \u0027openvswitch\u0027 in cfg.CONF.ml2.mechanism_drivers into its own utility function. This way not only we have encapsulated the configuration detail, but then we can make the execution of backend.setup_rpc subscription conditional to the presence of the driver in the deployment. In fact this subscription is only useful if the driver is indeed configured correctly and by avoiding the subscription we avoid altogether the executing the callbacks to trunk events, rather than having them behave like no-ops.\n\nThen, every other driver should follow the same pattern. I will follow up and document this in more detail for the sake of other trunk driver developers.","commit_id":"7935ee1009ad81c80523466baba17bd3da6c5246"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"change_message_id":"107419ceb81046cbcb2da0206330cf6562951d31","unresolved":false,"context_lines":[{"line_number":13,"context_line":""},{"line_number":14,"context_line":"from oslo_config import cfg"},{"line_number":15,"context_line":"from oslo_log import log as logging"},{"line_number":16,"context_line":""},{"line_number":17,"context_line":"from neutron_lib import constants"},{"line_number":18,"context_line":""},{"line_number":19,"context_line":"from neutron.extensions import portbindings"}],"source_content_type":"text/x-python","patch_set":17,"id":"bacf61ea_b9762b3c","line":16,"updated":"2016-08-03 13:13:36.000000000","message":"no need for this new line - neutron-lib is also 3rd party","commit_id":"124d59e8a167663da2a5369bb5a684bfe1886bd5"},{"author":{"_account_id":13770,"name":"Adolfo Duarte","email":"adduarte@redhat.com","username":"adolfoduarte"},"change_message_id":"fbc6557d1c5a87da449890f0222c62f032e89c6c","unresolved":false,"context_lines":[{"line_number":13,"context_line":""},{"line_number":14,"context_line":"from oslo_config import cfg"},{"line_number":15,"context_line":"from oslo_log import log as logging"},{"line_number":16,"context_line":""},{"line_number":17,"context_line":"from neutron_lib import constants"},{"line_number":18,"context_line":""},{"line_number":19,"context_line":"from neutron.extensions import portbindings"}],"source_content_type":"text/x-python","patch_set":17,"id":"bacf61ea_1063c11b","line":16,"in_reply_to":"bacf61ea_b9762b3c","updated":"2016-08-03 15:48:26.000000000","message":"Done","commit_id":"124d59e8a167663da2a5369bb5a684bfe1886bd5"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"change_message_id":"107419ceb81046cbcb2da0206330cf6562951d31","unresolved":false,"context_lines":[{"line_number":21,"context_line":"from neutron.services.trunk.drivers import base"},{"line_number":22,"context_line":""},{"line_number":23,"context_line":"LOG \u003d logging.getLogger(__name__)"},{"line_number":24,"context_line":""},{"line_number":25,"context_line":""},{"line_number":26,"context_line":"NAME \u003d \u0027openvswitch\u0027"},{"line_number":27,"context_line":""}],"source_content_type":"text/x-python","patch_set":17,"id":"bacf61ea_b9ad8b8a","line":24,"updated":"2016-08-03 13:13:36.000000000","message":"one too many new lines","commit_id":"124d59e8a167663da2a5369bb5a684bfe1886bd5"},{"author":{"_account_id":13770,"name":"Adolfo Duarte","email":"adduarte@redhat.com","username":"adolfoduarte"},"change_message_id":"fbc6557d1c5a87da449890f0222c62f032e89c6c","unresolved":false,"context_lines":[{"line_number":21,"context_line":"from neutron.services.trunk.drivers import base"},{"line_number":22,"context_line":""},{"line_number":23,"context_line":"LOG \u003d logging.getLogger(__name__)"},{"line_number":24,"context_line":""},{"line_number":25,"context_line":""},{"line_number":26,"context_line":"NAME \u003d \u0027openvswitch\u0027"},{"line_number":27,"context_line":""}],"source_content_type":"text/x-python","patch_set":17,"id":"bacf61ea_307085dc","line":24,"in_reply_to":"bacf61ea_b9ad8b8a","updated":"2016-08-03 15:48:26.000000000","message":"Done","commit_id":"124d59e8a167663da2a5369bb5a684bfe1886bd5"},{"author":{"_account_id":8655,"name":"Jakub Libosvar","email":"libosvar@redhat.com","username":"jlibosva"},"change_message_id":"314af9f5641bf0a4a84b31a5c13a9fb6888a7830","unresolved":false,"context_lines":[{"line_number":23,"context_line":"LOG \u003d logging.getLogger(__name__)"},{"line_number":24,"context_line":""},{"line_number":25,"context_line":""},{"line_number":26,"context_line":"NAME \u003d \u0027openvswitch\u0027"},{"line_number":27,"context_line":""},{"line_number":28,"context_line":"SUPPORTED_INTERFACES \u003d ("},{"line_number":29,"context_line":"    portbindings.VIF_TYPE_OVS,"}],"source_content_type":"text/x-python","patch_set":17,"id":"bacf61ea_6b35f244","line":26,"range":{"start_line":26,"start_character":0,"end_line":26,"end_character":4},"updated":"2016-08-03 15:37:54.000000000","message":"Nit: Maybe this belongs to OVSDriver as class attribute","commit_id":"124d59e8a167663da2a5369bb5a684bfe1886bd5"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"d0af2a16fed3388c2f3d1f202a273db341451d90","unresolved":false,"context_lines":[{"line_number":23,"context_line":"LOG \u003d logging.getLogger(__name__)"},{"line_number":24,"context_line":""},{"line_number":25,"context_line":""},{"line_number":26,"context_line":"NAME \u003d \u0027openvswitch\u0027"},{"line_number":27,"context_line":""},{"line_number":28,"context_line":"SUPPORTED_INTERFACES \u003d ("},{"line_number":29,"context_line":"    portbindings.VIF_TYPE_OVS,"}],"source_content_type":"text/x-python","patch_set":17,"id":"bacf61ea_5c5a7284","line":26,"range":{"start_line":26,"start_character":0,"end_line":26,"end_character":4},"in_reply_to":"bacf61ea_6b35f244","updated":"2016-08-03 16:27:32.000000000","message":"this is just a literal, the name is already an attribute of the driver.","commit_id":"124d59e8a167663da2a5369bb5a684bfe1886bd5"},{"author":{"_account_id":8655,"name":"Jakub Libosvar","email":"libosvar@redhat.com","username":"jlibosva"},"change_message_id":"314af9f5641bf0a4a84b31a5c13a9fb6888a7830","unresolved":false,"context_lines":[{"line_number":46,"context_line":""},{"line_number":47,"context_line":"def register():"},{"line_number":48,"context_line":"    \"\"\"Register the driver.\"\"\""},{"line_number":49,"context_line":"    global DRIVER"},{"line_number":50,"context_line":"    DRIVER \u003d OVSDriver(NAME,"},{"line_number":51,"context_line":"                       SUPPORTED_INTERFACES,"},{"line_number":52,"context_line":"                       SUPPORTED_SEGMENTATION_TYPES,"}],"source_content_type":"text/x-python","patch_set":17,"id":"bacf61ea_4beaaead","line":49,"updated":"2016-08-03 15:37:54.000000000","message":"if DRIVER is None?\n\nWouldn\u0027t it be better to make OVSDriver a singleton so we avoid using globals?","commit_id":"124d59e8a167663da2a5369bb5a684bfe1886bd5"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"d0af2a16fed3388c2f3d1f202a273db341451d90","unresolved":false,"context_lines":[{"line_number":46,"context_line":""},{"line_number":47,"context_line":"def register():"},{"line_number":48,"context_line":"    \"\"\"Register the driver.\"\"\""},{"line_number":49,"context_line":"    global DRIVER"},{"line_number":50,"context_line":"    DRIVER \u003d OVSDriver(NAME,"},{"line_number":51,"context_line":"                       SUPPORTED_INTERFACES,"},{"line_number":52,"context_line":"                       SUPPORTED_SEGMENTATION_TYPES,"}],"source_content_type":"text/x-python","patch_set":17,"id":"bacf61ea_1cc75a13","line":49,"in_reply_to":"bacf61ea_4beaaead","updated":"2016-08-03 16:27:32.000000000","message":"This is called only once, as for the singleton, I feel it\u0027s too much plumbing for no practical use case, at least not right now. Can be added if needed later.","commit_id":"124d59e8a167663da2a5369bb5a684bfe1886bd5"},{"author":{"_account_id":16800,"name":"Rawlin Peters","email":"rawlin.peters@hpe.com","username":"rawlin"},"change_message_id":"a32f941363c911fd0e23c9cbb1ff5ef447f71d8e","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":18,"id":"bacf61ea_fc01a605","updated":"2016-08-03 16:09:31.000000000","message":"There doesn\u0027t seem to be much of anything testable in this file currently, so it makes sense to not have UTs for it yet.\n\nHowever, I\u0027m adding to this file in a dependent patch, and it makes sense for me to add a UT for it.\n\nI just want to confirm before I rebase that we don\u0027t expect to add any UTs for this patch as-is. If so, I\u0027ll go ahead and recreate the UT file in my dependent patch. If UTs are necessary for this file again, I\u0027ll just wait.","commit_id":"3a42e258461e1a12ee756cd595588b0ef64f2bf1"},{"author":{"_account_id":13770,"name":"Adolfo Duarte","email":"adduarte@redhat.com","username":"adolfoduarte"},"change_message_id":"2e3c5e3cb40d1c805180dcbc19dd6d35f4906d0f","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":18,"id":"bacf61ea_a2bc28dc","in_reply_to":"bacf61ea_2235d8da","updated":"2016-08-03 17:19:10.000000000","message":"Agree with Rawlin on nothing testable. I skipped UTs for this because of that reason. Don\u0027t have any plans to add UT directly covering this file. I don\u0027t exepct to add any UTs for this file","commit_id":"3a42e258461e1a12ee756cd595588b0ef64f2bf1"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"8c66a7fdb156187710a2024db81d35451e3a3757","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":18,"id":"bacf61ea_2235d8da","in_reply_to":"bacf61ea_fc01a605","updated":"2016-08-03 16:28:54.000000000","message":"We can choose to test some of this via a scenario test, I am still mulling over what makes sense and allow us to avoid writing a lot of plumbing.","commit_id":"3a42e258461e1a12ee756cd595588b0ef64f2bf1"}],"neutron/services/trunk/drivers/openvswitch/rpc/callbacks.py":[{"author":{"_account_id":4187,"name":"Ryan Tidwell","email":"rtidwell@suse.com","username":"ryan-tidwell"},"change_message_id":"afa73b830e8c6a69bbe2186510c66bba9fe8c6dd","unresolved":false,"context_lines":[{"line_number":30,"context_line":"    target \u003d oslo_messaging.Target(version\u003d\u00271.0\u0027,"},{"line_number":31,"context_line":"                                   namespace\u003dconstants.TRUNK_BASE_NAMESPACE)"},{"line_number":32,"context_line":""},{"line_number":33,"context_line":"    def get_trunk_by_port_id(self, context, port_id):"},{"line_number":34,"context_line":"        \"\"\"Return information for the specified trunk with given port_id."},{"line_number":35,"context_line":""},{"line_number":36,"context_line":"        :param context: rpc context"}],"source_content_type":"text/x-python","patch_set":2,"id":"bacf61ea_23b07af4","line":33,"range":{"start_line":33,"start_character":8,"end_line":33,"end_character":51},"updated":"2016-07-27 19:56:08.000000000","message":"Placeholder until we have the actual method for exposing similar functionality ironed out.","commit_id":"ff6f4ae079db59efdb6bc4fbeb1ddc967eec54c9"},{"author":{"_account_id":4187,"name":"Ryan Tidwell","email":"rtidwell@suse.com","username":"ryan-tidwell"},"change_message_id":"afa73b830e8c6a69bbe2186510c66bba9fe8c6dd","unresolved":false,"context_lines":[{"line_number":41,"context_line":"        if trunk_obj:"},{"line_number":42,"context_line":"            return trunk_obj.obj_to_primitive()"},{"line_number":43,"context_line":""},{"line_number":44,"context_line":"    def get_trunk_by_id(self, context, trunk_id):"},{"line_number":45,"context_line":"        \"\"\"Return information for the specified trunk with given id."},{"line_number":46,"context_line":""},{"line_number":47,"context_line":"        :param context: rpc context"}],"source_content_type":"text/x-python","patch_set":2,"id":"bacf61ea_a39c6a6a","line":44,"range":{"start_line":44,"start_character":8,"end_line":44,"end_character":48},"updated":"2016-07-27 19:56:08.000000000","message":"Placeholder until we have the actual method for exposing similar functionality ironed out.","commit_id":"ff6f4ae079db59efdb6bc4fbeb1ddc967eec54c9"}],"neutron/services/trunk/plugin.py":[{"author":{"_account_id":7787,"name":"Kevin Benton","email":"kevin@benton.pub","username":"blak111"},"change_message_id":"418d6b72aaf3c37ff2d5106b1120f1778c4396cf","unresolved":false,"context_lines":[{"line_number":65,"context_line":"        drivers.register()"},{"line_number":66,"context_line":"        self._segmentation_types \u003d {}"},{"line_number":67,"context_line":"        self._vif_types \u003d set()"},{"line_number":68,"context_line":"        self._agents \u003d set()"},{"line_number":69,"context_line":"        self._rpc_connection \u003d None"},{"line_number":70,"context_line":"        registry.subscribe(rules.enforce_port_deletion_rules,"},{"line_number":71,"context_line":"                           resources.PORT, events.BEFORE_DELETE)"}],"source_content_type":"text/x-python","patch_set":4,"id":"bacf61ea_ed4641be","line":68,"updated":"2016-07-28 04:39:00.000000000","message":"can you call this _agent_types for clarity?","commit_id":"696c4a7ebdf455308f371a3cdfd2f2f0c67f1904"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"67324385b2dd71ed18cd34db44439972100fa003","unresolved":false,"context_lines":[{"line_number":65,"context_line":"        drivers.register()"},{"line_number":66,"context_line":"        self._segmentation_types \u003d {}"},{"line_number":67,"context_line":"        self._vif_types \u003d set()"},{"line_number":68,"context_line":"        self._agents \u003d set()"},{"line_number":69,"context_line":"        self._rpc_connection \u003d None"},{"line_number":70,"context_line":"        registry.subscribe(rules.enforce_port_deletion_rules,"},{"line_number":71,"context_line":"                           resources.PORT, events.BEFORE_DELETE)"}],"source_content_type":"text/x-python","patch_set":4,"id":"bacf61ea_582bc9eb","line":68,"in_reply_to":"bacf61ea_ed4641be","updated":"2016-07-28 05:39:30.000000000","message":"Done","commit_id":"696c4a7ebdf455308f371a3cdfd2f2f0c67f1904"},{"author":{"_account_id":6598,"name":"Berezovsky Irena","email":"irenab.dev@gmail.com","username":"irenab"},"change_message_id":"27f154668b80bcc4420bc3a28858631bd5eb2088","unresolved":false,"context_lines":[{"line_number":80,"context_line":"        if not any([driver.is_loaded for driver in self._drivers]):"},{"line_number":81,"context_line":"            raise trunk_exc.IncompatibleTrunkPluginConfiguration()"},{"line_number":82,"context_line":""},{"line_number":83,"context_line":"    def set_rpc_connection(self, connection):"},{"line_number":84,"context_line":"        self._rpc_connection \u003d connection"},{"line_number":85,"context_line":""},{"line_number":86,"context_line":"    def is_rpc_enabled(self):"},{"line_number":87,"context_line":"        return self._rpc_connection is not None"},{"line_number":88,"context_line":""},{"line_number":89,"context_line":"    def register_driver(self, driver):"},{"line_number":90,"context_line":"        \"\"\"Register driver with trunk plugin.\"\"\""}],"source_content_type":"text/x-python","patch_set":12,"id":"bacf61ea_2380e8f6","line":87,"range":{"start_line":83,"start_character":0,"end_line":87,"end_character":47},"updated":"2016-07-31 06:06:41.000000000","message":"I wonder if RPC should be managed by the Plugin layer. Wouldn\u0027t it be more suitable to be handled by Driver layer, assuming there will be some RpcDriver?","commit_id":"39660779476a3ae071a2fae00819fe497dccefff"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"9d4c567c0a2d8dac471bdf3d9690632812e60e83","unresolved":false,"context_lines":[{"line_number":80,"context_line":"        if not any([driver.is_loaded for driver in self._drivers]):"},{"line_number":81,"context_line":"            raise trunk_exc.IncompatibleTrunkPluginConfiguration()"},{"line_number":82,"context_line":""},{"line_number":83,"context_line":"    def set_rpc_connection(self, connection):"},{"line_number":84,"context_line":"        self._rpc_connection \u003d connection"},{"line_number":85,"context_line":""},{"line_number":86,"context_line":"    def is_rpc_enabled(self):"},{"line_number":87,"context_line":"        return self._rpc_connection is not None"},{"line_number":88,"context_line":""},{"line_number":89,"context_line":"    def register_driver(self, driver):"},{"line_number":90,"context_line":"        \"\"\"Register driver with trunk plugin.\"\"\""}],"source_content_type":"text/x-python","patch_set":12,"id":"bacf61ea_f1e5f3a3","line":87,"range":{"start_line":83,"start_character":0,"end_line":87,"end_character":47},"in_reply_to":"bacf61ea_2380e8f6","updated":"2016-07-31 16:10:00.000000000","message":"the plugin can and should work with drivers that may or may not require an rpc layer, and as such it\u0027s not strictly its responsibility.\n\nBut when you say managed, what do you mean exactly?","commit_id":"39660779476a3ae071a2fae00819fe497dccefff"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"1899c95cbca07e763e3315b5b9d10d85b1f152a1","unresolved":false,"context_lines":[{"line_number":80,"context_line":"        if not any([driver.is_loaded for driver in self._drivers]):"},{"line_number":81,"context_line":"            raise trunk_exc.IncompatibleTrunkPluginConfiguration()"},{"line_number":82,"context_line":""},{"line_number":83,"context_line":"    def set_rpc_connection(self, connection):"},{"line_number":84,"context_line":"        self._rpc_connection \u003d connection"},{"line_number":85,"context_line":""},{"line_number":86,"context_line":"    def is_rpc_enabled(self):"},{"line_number":87,"context_line":"        return self._rpc_connection is not None"},{"line_number":88,"context_line":""},{"line_number":89,"context_line":"    def register_driver(self, driver):"},{"line_number":90,"context_line":"        \"\"\"Register driver with trunk plugin.\"\"\""}],"source_content_type":"text/x-python","patch_set":12,"id":"bacf61ea_7859bf34","line":87,"range":{"start_line":83,"start_character":0,"end_line":87,"end_character":47},"in_reply_to":"bacf61ea_4f5a532b","updated":"2016-08-01 15:50:51.000000000","message":"It sounds to me that what you\u0027re suggesting is what is already happening in an alternative way; right now the rpc logic is not encapsulated into a class, because it didn\u0027t seem there was a need to, but let me look into this a bit more.","commit_id":"39660779476a3ae071a2fae00819fe497dccefff"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"92be17d479f183410f1763a6e2b3d54b44ae2287","unresolved":false,"context_lines":[{"line_number":80,"context_line":"        if not any([driver.is_loaded for driver in self._drivers]):"},{"line_number":81,"context_line":"            raise trunk_exc.IncompatibleTrunkPluginConfiguration()"},{"line_number":82,"context_line":""},{"line_number":83,"context_line":"    def set_rpc_connection(self, connection):"},{"line_number":84,"context_line":"        self._rpc_connection \u003d connection"},{"line_number":85,"context_line":""},{"line_number":86,"context_line":"    def is_rpc_enabled(self):"},{"line_number":87,"context_line":"        return self._rpc_connection is not None"},{"line_number":88,"context_line":""},{"line_number":89,"context_line":"    def register_driver(self, driver):"},{"line_number":90,"context_line":"        \"\"\"Register driver with trunk plugin.\"\"\""}],"source_content_type":"text/x-python","patch_set":12,"id":"bacf61ea_d4b4b9d5","line":87,"range":{"start_line":83,"start_character":0,"end_line":87,"end_character":47},"in_reply_to":"bacf61ea_680a7427","updated":"2016-08-02 15:35:19.000000000","message":"I think that you were on the right track, and your comment made me formalize things a little bit more. Have a look and please let me know what you think! Thanks.","commit_id":"39660779476a3ae071a2fae00819fe497dccefff"},{"author":{"_account_id":6598,"name":"Berezovsky Irena","email":"irenab.dev@gmail.com","username":"irenab"},"change_message_id":"e49596f21ee49a94cd46a4c5f860b722687a56b4","unresolved":false,"context_lines":[{"line_number":80,"context_line":"        if not any([driver.is_loaded for driver in self._drivers]):"},{"line_number":81,"context_line":"            raise trunk_exc.IncompatibleTrunkPluginConfiguration()"},{"line_number":82,"context_line":""},{"line_number":83,"context_line":"    def set_rpc_connection(self, connection):"},{"line_number":84,"context_line":"        self._rpc_connection \u003d connection"},{"line_number":85,"context_line":""},{"line_number":86,"context_line":"    def is_rpc_enabled(self):"},{"line_number":87,"context_line":"        return self._rpc_connection is not None"},{"line_number":88,"context_line":""},{"line_number":89,"context_line":"    def register_driver(self, driver):"},{"line_number":90,"context_line":"        \"\"\"Register driver with trunk plugin.\"\"\""}],"source_content_type":"text/x-python","patch_set":12,"id":"bacf61ea_680a7427","line":87,"range":{"start_line":83,"start_character":0,"end_line":87,"end_character":47},"in_reply_to":"bacf61ea_7859bf34","updated":"2016-08-02 06:34:53.000000000","message":"I think it\u0027s indeed done a bit differently than I had in mind, inspired by the QoS Plugin/RpcQoSServiceNotificationDriver decomposition. Looks like the plugin is just a store of the RPC connection, but the Driver is the one to use it. Since there is vendor specific Driver and not just generic notification driver, maybe it does not make sense at this point to add additional entity just to encapsulate RPC logic.","commit_id":"39660779476a3ae071a2fae00819fe497dccefff"},{"author":{"_account_id":6598,"name":"Berezovsky Irena","email":"irenab.dev@gmail.com","username":"irenab"},"change_message_id":"4559caceb70224e5e6713c4c6f2bd8c46d965221","unresolved":false,"context_lines":[{"line_number":80,"context_line":"        if not any([driver.is_loaded for driver in self._drivers]):"},{"line_number":81,"context_line":"            raise trunk_exc.IncompatibleTrunkPluginConfiguration()"},{"line_number":82,"context_line":""},{"line_number":83,"context_line":"    def set_rpc_connection(self, connection):"},{"line_number":84,"context_line":"        self._rpc_connection \u003d connection"},{"line_number":85,"context_line":""},{"line_number":86,"context_line":"    def is_rpc_enabled(self):"},{"line_number":87,"context_line":"        return self._rpc_connection is not None"},{"line_number":88,"context_line":""},{"line_number":89,"context_line":"    def register_driver(self, driver):"},{"line_number":90,"context_line":"        \"\"\"Register driver with trunk plugin.\"\"\""}],"source_content_type":"text/x-python","patch_set":12,"id":"bacf61ea_4f5a532b","line":87,"range":{"start_line":83,"start_character":0,"end_line":87,"end_character":47},"in_reply_to":"bacf61ea_f1e5f3a3","updated":"2016-08-01 05:49:17.000000000","message":"By \u0027managed\u0027 I mean handling of the RPC connection related logic. I  would suggest to delegate it to something like RPCNotificationDriver.","commit_id":"39660779476a3ae071a2fae00819fe497dccefff"},{"author":{"_account_id":6598,"name":"Berezovsky Irena","email":"irenab.dev@gmail.com","username":"irenab"},"change_message_id":"208861bc9fed99c07f5e68fe704e2dd2da9f08ae","unresolved":false,"context_lines":[{"line_number":80,"context_line":"        if not any([driver.is_loaded for driver in self._drivers]):"},{"line_number":81,"context_line":"            raise trunk_exc.IncompatibleTrunkPluginConfiguration()"},{"line_number":82,"context_line":""},{"line_number":83,"context_line":"    def set_rpc_backend(self, backend):"},{"line_number":84,"context_line":"        self._rpc_backend \u003d backend"},{"line_number":85,"context_line":""},{"line_number":86,"context_line":"    def is_rpc_enabled(self):"},{"line_number":87,"context_line":"        return self._rpc_backend is not None"},{"line_number":88,"context_line":""},{"line_number":89,"context_line":"    def register_driver(self, driver):"},{"line_number":90,"context_line":"        \"\"\"Register driver with trunk plugin.\"\"\""}],"source_content_type":"text/x-python","patch_set":16,"id":"bacf61ea_baae32e5","line":87,"range":{"start_line":83,"start_character":2,"end_line":87,"end_character":44},"updated":"2016-08-03 06:16:55.000000000","message":"Thank you for taking extra care of the RPC backend encapsulation, it is much more generic now.\nIt is still possible to have non message queue based plugin, but considering that ML2 plugin is the standard way that neutron tries to establish, it makes sense to have RPC backend setting in the service plugin (which of course may be left unassigned).","commit_id":"6443829c04c7c5e7a209b85e8440c264566479dd"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"3d4675fb2c4c20114644db35e4d33608d0c7858f","unresolved":false,"context_lines":[{"line_number":80,"context_line":"        if not any([driver.is_loaded for driver in self._drivers]):"},{"line_number":81,"context_line":"            raise trunk_exc.IncompatibleTrunkPluginConfiguration()"},{"line_number":82,"context_line":""},{"line_number":83,"context_line":"    def set_rpc_backend(self, backend):"},{"line_number":84,"context_line":"        self._rpc_backend \u003d backend"},{"line_number":85,"context_line":""},{"line_number":86,"context_line":"    def is_rpc_enabled(self):"},{"line_number":87,"context_line":"        return self._rpc_backend is not None"},{"line_number":88,"context_line":""},{"line_number":89,"context_line":"    def register_driver(self, driver):"},{"line_number":90,"context_line":"        \"\"\"Register driver with trunk plugin.\"\"\""}],"source_content_type":"text/x-python","patch_set":16,"id":"bacf61ea_3c0fbe89","line":87,"range":{"start_line":83,"start_character":2,"end_line":87,"end_character":44},"in_reply_to":"bacf61ea_baae32e5","updated":"2016-08-03 16:20:52.000000000","message":"Why do you think ML2 is standard? IMO, it\u0027s a responsibility of the driver (the one that integrates the plugin with the particular L2 technology) to require an rpc backend or not.","commit_id":"6443829c04c7c5e7a209b85e8440c264566479dd"},{"author":{"_account_id":16800,"name":"Rawlin Peters","email":"rawlin.peters@hpe.com","username":"rawlin"},"change_message_id":"4231ad7b4917106fbc5738b3795fada75a061d82","unresolved":false,"context_lines":[{"line_number":75,"context_line":"            LOG.debug(\u0027Trunk plugin loaded with driver %s\u0027, driver.name)"},{"line_number":76,"context_line":"        self.check_compatibility()"},{"line_number":77,"context_line":""},{"line_number":78,"context_line":"    def check_compatibility(self):"},{"line_number":79,"context_line":"        \"\"\"Fail to load if no compatible driver is found.\"\"\""},{"line_number":80,"context_line":"        if not any([driver.is_loaded for driver in self._drivers]):"},{"line_number":81,"context_line":"            raise trunk_exc.IncompatibleTrunkPluginConfiguration()"}],"source_content_type":"text/x-python","patch_set":18,"id":"bacf61ea_25fde23b","line":78,"range":{"start_line":78,"start_character":8,"end_line":78,"end_character":27},"updated":"2016-08-03 16:57:16.000000000","message":"This method is causing some of the UTs to fail and should probably be mocked out in neutron.tests.unit.services.trunk.test_plugin.TrunkPluginTestCase and neutron.tests.unit.services.trunk.test_rules.TrunkPortValidatorTestCase","commit_id":"3a42e258461e1a12ee756cd595588b0ef64f2bf1"},{"author":{"_account_id":13770,"name":"Adolfo Duarte","email":"adduarte@redhat.com","username":"adolfoduarte"},"change_message_id":"2e3c5e3cb40d1c805180dcbc19dd6d35f4906d0f","unresolved":false,"context_lines":[{"line_number":75,"context_line":"            LOG.debug(\u0027Trunk plugin loaded with driver %s\u0027, driver.name)"},{"line_number":76,"context_line":"        self.check_compatibility()"},{"line_number":77,"context_line":""},{"line_number":78,"context_line":"    def check_compatibility(self):"},{"line_number":79,"context_line":"        \"\"\"Fail to load if no compatible driver is found.\"\"\""},{"line_number":80,"context_line":"        if not any([driver.is_loaded for driver in self._drivers]):"},{"line_number":81,"context_line":"            raise trunk_exc.IncompatibleTrunkPluginConfiguration()"}],"source_content_type":"text/x-python","patch_set":18,"id":"bacf61ea_684971b7","line":78,"range":{"start_line":78,"start_character":8,"end_line":78,"end_character":27},"in_reply_to":"bacf61ea_25fde23b","updated":"2016-08-03 17:19:10.000000000","message":"Done","commit_id":"3a42e258461e1a12ee756cd595588b0ef64f2bf1"}],"neutron/services/trunk/rpc/agent.py":[{"author":{"_account_id":7787,"name":"Kevin Benton","email":"kevin@benton.pub","username":"blak111"},"change_message_id":"418d6b72aaf3c37ff2d5106b1120f1778c4396cf","unresolved":false,"context_lines":[{"line_number":46,"context_line":"        topic \u003d resources_rpc.resource_type_versioned_topic(resources.SUBPORT)"},{"line_number":47,"context_line":"        connection.create_consumer(topic, endpoints, fanout\u003dTrue)"},{"line_number":48,"context_line":""},{"line_number":49,"context_line":"    def handle_subports(self, subports, event_type):"},{"line_number":50,"context_line":"        # Override this method and/or add handling logic that is"},{"line_number":51,"context_line":"        # agent type agnostic."},{"line_number":52,"context_line":"        # If the subports belong to a trunk which the agent does not"}],"source_content_type":"text/x-python","patch_set":4,"id":"bacf61ea_4d12edb5","line":49,"updated":"2016-07-28 04:39:00.000000000","message":"abstractmethod?","commit_id":"696c4a7ebdf455308f371a3cdfd2f2f0c67f1904"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"67324385b2dd71ed18cd34db44439972100fa003","unresolved":false,"context_lines":[{"line_number":46,"context_line":"        topic \u003d resources_rpc.resource_type_versioned_topic(resources.SUBPORT)"},{"line_number":47,"context_line":"        connection.create_consumer(topic, endpoints, fanout\u003dTrue)"},{"line_number":48,"context_line":""},{"line_number":49,"context_line":"    def handle_subports(self, subports, event_type):"},{"line_number":50,"context_line":"        # Override this method and/or add handling logic that is"},{"line_number":51,"context_line":"        # agent type agnostic."},{"line_number":52,"context_line":"        # If the subports belong to a trunk which the agent does not"}],"source_content_type":"text/x-python","patch_set":4,"id":"bacf61ea_184af1c5","line":49,"in_reply_to":"bacf61ea_4d12edb5","updated":"2016-07-28 05:39:30.000000000","message":"Done","commit_id":"696c4a7ebdf455308f371a3cdfd2f2f0c67f1904"},{"author":{"_account_id":8788,"name":"Miguel Angel Ajo","email":"mangelajo@redhat.com","username":"mangelajo"},"change_message_id":"0400cf597a5ba21fa6f086c12ce5095ec6d3caca","unresolved":false,"context_lines":[{"line_number":37,"context_line":"# For server-side stub and skeleton proxy code, please look at server.py"},{"line_number":38,"context_line":""},{"line_number":39,"context_line":""},{"line_number":40,"context_line":"class TrunkSkeleton(object):"},{"line_number":41,"context_line":"    \"\"\"Skeleton proxy code for server-\u003eagent communication.\"\"\""},{"line_number":42,"context_line":""},{"line_number":43,"context_line":"    def __init__(self, connection\u003dNone):"}],"source_content_type":"text/x-python","patch_set":5,"id":"bacf61ea_53bb95c4","line":40,"updated":"2016-07-28 14:17:04.000000000","message":"Look at this:\n\nhttps://github.com/openstack/neutron/blob/master/neutron/agent/l2/extensions/qos.py#L188\n\nIt will result very familiar.\n\nIn your case you don\u0027t care about handle_port , but you can hook into the agent this way.\n\nThe agent config would need to have trunkports (or the way you name it) to their loaded extensions:\nhttps://github.com/openstack/neutron/blob/master/neutron/agent/agent_extensions_manager.py#L23\n\nhttps://github.com/openstack/neutron/blob/master/neutron/agent/l2/l2_agent_extensions_manager.py","commit_id":"0a9f320f1f38a36f80ef1564308f4f678d7931b7"},{"author":{"_account_id":8788,"name":"Miguel Angel Ajo","email":"mangelajo@redhat.com","username":"mangelajo"},"change_message_id":"0e6d057f103b0e506991d94b767d1529ff99e7a5","unresolved":false,"context_lines":[{"line_number":37,"context_line":"# For server-side stub and skeleton proxy code, please look at server.py"},{"line_number":38,"context_line":""},{"line_number":39,"context_line":""},{"line_number":40,"context_line":"class TrunkSkeleton(object):"},{"line_number":41,"context_line":"    \"\"\"Skeleton proxy code for server-\u003eagent communication.\"\"\""},{"line_number":42,"context_line":""},{"line_number":43,"context_line":"    def __init__(self, connection\u003dNone):"}],"source_content_type":"text/x-python","patch_set":5,"id":"bacf61ea_b43b97d0","line":40,"in_reply_to":"bacf61ea_0dbbaee6","updated":"2016-07-29 14:26:10.000000000","message":"Yes, if we get into a model where extensions are automatically loaded when the server has the capability/service, that would be nice.","commit_id":"0a9f320f1f38a36f80ef1564308f4f678d7931b7"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"83ccb42f79c61bab4bb0c847ed2b53c40541a159","unresolved":false,"context_lines":[{"line_number":37,"context_line":"# For server-side stub and skeleton proxy code, please look at server.py"},{"line_number":38,"context_line":""},{"line_number":39,"context_line":""},{"line_number":40,"context_line":"class TrunkSkeleton(object):"},{"line_number":41,"context_line":"    \"\"\"Skeleton proxy code for server-\u003eagent communication.\"\"\""},{"line_number":42,"context_line":""},{"line_number":43,"context_line":"    def __init__(self, connection\u003dNone):"}],"source_content_type":"text/x-python","patch_set":5,"id":"bacf61ea_84e81ee4","line":40,"in_reply_to":"bacf61ea_53bb95c4","updated":"2016-07-28 15:28:06.000000000","message":"Oh, I did and I thought about it long and hard :)\n\nIf the sole objective of using the l2 extension would be to hook into the agent, then I tried to come up with a more seamless mechanism that does not abuse the fact that the extension interface is in practice not implemented. It seems more readable/intuitive to me and it avoids making the deployer involved as far as agent setup is concerned.","commit_id":"0a9f320f1f38a36f80ef1564308f4f678d7931b7"},{"author":{"_account_id":4187,"name":"Ryan Tidwell","email":"rtidwell@suse.com","username":"ryan-tidwell"},"change_message_id":"78c3b31799697d7007538519b84563fe09e69fa8","unresolved":false,"context_lines":[{"line_number":37,"context_line":"# For server-side stub and skeleton proxy code, please look at server.py"},{"line_number":38,"context_line":""},{"line_number":39,"context_line":""},{"line_number":40,"context_line":"class TrunkSkeleton(object):"},{"line_number":41,"context_line":"    \"\"\"Skeleton proxy code for server-\u003eagent communication.\"\"\""},{"line_number":42,"context_line":""},{"line_number":43,"context_line":"    def __init__(self, connection\u003dNone):"}],"source_content_type":"text/x-python","patch_set":5,"id":"bacf61ea_d7300304","line":40,"in_reply_to":"bacf61ea_84e81ee4","updated":"2016-07-28 16:31:04.000000000","message":"Agreed. Anything we can do that takes the deployer out of the mix is something to be cheered. I\u0027ve played with taking the approach of the L2 extension and I found myself using \"pass\" a little too frequently. In that sense the L2 extension feels wrong, and it still requires the deployer to configure something to load functionality that can easily be turned on by default without interfering if they choose not to use it.","commit_id":"0a9f320f1f38a36f80ef1564308f4f678d7931b7"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"00791bb342b0d660759bcb535a91ebf3834c7ad7","unresolved":false,"context_lines":[{"line_number":37,"context_line":"# For server-side stub and skeleton proxy code, please look at server.py"},{"line_number":38,"context_line":""},{"line_number":39,"context_line":""},{"line_number":40,"context_line":"class TrunkSkeleton(object):"},{"line_number":41,"context_line":"    \"\"\"Skeleton proxy code for server-\u003eagent communication.\"\"\""},{"line_number":42,"context_line":""},{"line_number":43,"context_line":"    def __init__(self, connection\u003dNone):"}],"source_content_type":"text/x-python","patch_set":5,"id":"bacf61ea_0dbbaee6","line":40,"in_reply_to":"bacf61ea_d7300304","updated":"2016-07-28 16:53:31.000000000","message":"I think that this effort, the L3 agent extension framework and a few other discussions I had around exposed a potential improvements that can be beneficial for both the developer and the deployer.  In my opinion we should move away from a mindset where everything in Neutron *must* be a configuration pluggable point. Something to ponder on.","commit_id":"0a9f320f1f38a36f80ef1564308f4f678d7931b7"},{"author":{"_account_id":13770,"name":"Adolfo Duarte","email":"adduarte@redhat.com","username":"adolfoduarte"},"change_message_id":"74b8c097e6c383d25205f109ef1804c45911548e","unresolved":false,"context_lines":[{"line_number":43,"context_line":"    def __init__(self, connection\u003dNone):"},{"line_number":44,"context_line":""},{"line_number":45,"context_line":"        # TODO(armax): check if consumer registry supports resource bulks"},{"line_number":46,"context_line":"        registry.subscribe(self.handle_subport, resources.SUBPORT)"},{"line_number":47,"context_line":""},{"line_number":48,"context_line":"        self.connection \u003d connection or n_rpc.create_connection()"},{"line_number":49,"context_line":"        endpoints \u003d [resources_rpc.ResourcesPushRpcCallback()]"}],"source_content_type":"text/x-python","patch_set":7,"id":"bacf61ea_f8124408","line":46,"range":{"start_line":46,"start_character":8,"end_line":46,"end_character":66},"updated":"2016-07-29 00:54:47.000000000","message":"if [1] lands and the registry supports resource bulks, we\u0027ll have to figure out how to divide the work. If we have two callbacks, they will both be registered against resources.SUBPORT, so they both will receive the event. \nPerhaps change handle_subport below to handle_subports, and have it checked weather or not it received a list of resources or a single resource.\n\n[1] https://review.openstack.org/#/c/348476/1/neutron/api/rpc/handlers/resources_rpc.py","commit_id":"36447a4ca30737d80167ba2d1edc63d59dd92b2b"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"743883f680937b56854b8204974b4b9d34f1f7be","unresolved":false,"context_lines":[{"line_number":43,"context_line":"    def __init__(self, connection\u003dNone):"},{"line_number":44,"context_line":""},{"line_number":45,"context_line":"        # TODO(armax): check if consumer registry supports resource bulks"},{"line_number":46,"context_line":"        registry.subscribe(self.handle_subport, resources.SUBPORT)"},{"line_number":47,"context_line":""},{"line_number":48,"context_line":"        self.connection \u003d connection or n_rpc.create_connection()"},{"line_number":49,"context_line":"        endpoints \u003d [resources_rpc.ResourcesPushRpcCallback()]"}],"source_content_type":"text/x-python","patch_set":7,"id":"bacf61ea_b5728eab","line":46,"range":{"start_line":46,"start_character":8,"end_line":46,"end_character":66},"in_reply_to":"bacf61ea_73edd5ee","updated":"2016-07-29 03:51:12.000000000","message":"I think it\u0027s sensible to register a plural resource in [1]. I think this could be solved by simply adding:\n\nSUBPORTS \u003d _SUBPORT_CLS.obj_name()\n\nand\n\nSUBPORTS: _SUBPORT_CLS\n\nand that would do the trick.\n\n[1] https://review.openstack.org/#/c/347662/7/neutron/api/rpc/callbacks/resources.py@38","commit_id":"36447a4ca30737d80167ba2d1edc63d59dd92b2b"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"8f5b5b15ad42b9fbd6ceb706c06437906452374b","unresolved":false,"context_lines":[{"line_number":43,"context_line":"    def __init__(self, connection\u003dNone):"},{"line_number":44,"context_line":""},{"line_number":45,"context_line":"        # TODO(armax): check if consumer registry supports resource bulks"},{"line_number":46,"context_line":"        registry.subscribe(self.handle_subport, resources.SUBPORT)"},{"line_number":47,"context_line":""},{"line_number":48,"context_line":"        self.connection \u003d connection or n_rpc.create_connection()"},{"line_number":49,"context_line":"        endpoints \u003d [resources_rpc.ResourcesPushRpcCallback()]"}],"source_content_type":"text/x-python","patch_set":7,"id":"bacf61ea_73edd5ee","line":46,"range":{"start_line":46,"start_character":8,"end_line":46,"end_character":66},"in_reply_to":"bacf61ea_f8124408","updated":"2016-07-29 01:04:06.000000000","message":"yeah, that is still WIP, we\u0027ll have to iron a few details out.","commit_id":"36447a4ca30737d80167ba2d1edc63d59dd92b2b"},{"author":{"_account_id":8788,"name":"Miguel Angel Ajo","email":"mangelajo@redhat.com","username":"mangelajo"},"change_message_id":"b92db10ba2f6d1f3573f1f01fac6ad0e067239f0","unresolved":false,"context_lines":[{"line_number":47,"context_line":"        registry.subscribe(self.handle_trunk, resources.TRUNK)"},{"line_number":48,"context_line":"        registry.subscribe(self.handle_subports, resources.SUBPORTS)"},{"line_number":49,"context_line":""},{"line_number":50,"context_line":"        self.connection \u003d connection or n_rpc.create_connection()"},{"line_number":51,"context_line":"        endpoints \u003d [resources_rpc.ResourcesPushRpcCallback()]"},{"line_number":52,"context_line":"        topic \u003d resources_rpc.resource_type_versioned_topic(resources.SUBPORTS)"},{"line_number":53,"context_line":"        connection.create_consumer(topic, endpoints, fanout\u003dTrue)"}],"source_content_type":"text/x-python","patch_set":12,"id":"bacf61ea_d73d2d90","line":50,"updated":"2016-08-01 10:24:55.000000000","message":"No action required in this patch (aka: mental note to myself): those 4 lines keep repeating a lot around. I think they can be condensed into another method in the rpc_callbacks registry that takes a connection (which could be None if it needs to be created).\n\nSo those L50-53 would become:\n\nregistry.setup_connection(connection)\n\nAnd that would create consumers for the subscribed stuff since the last time setup_connections was used.","commit_id":"39660779476a3ae071a2fae00819fe497dccefff"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"4b34895089746707725d010a53c1e741330c1539","unresolved":false,"context_lines":[{"line_number":47,"context_line":"        registry.subscribe(self.handle_trunk, resources.TRUNK)"},{"line_number":48,"context_line":"        registry.subscribe(self.handle_subports, resources.SUBPORTS)"},{"line_number":49,"context_line":""},{"line_number":50,"context_line":"        self.connection \u003d connection or n_rpc.create_connection()"},{"line_number":51,"context_line":"        endpoints \u003d [resources_rpc.ResourcesPushRpcCallback()]"},{"line_number":52,"context_line":"        topic \u003d resources_rpc.resource_type_versioned_topic(resources.SUBPORTS)"},{"line_number":53,"context_line":"        connection.create_consumer(topic, endpoints, fanout\u003dTrue)"}],"source_content_type":"text/x-python","patch_set":12,"id":"bacf61ea_1b4b5d5a","line":50,"in_reply_to":"bacf61ea_d73d2d90","updated":"2016-08-01 16:03:26.000000000","message":"ack, we can clean this up when the dust settles.","commit_id":"39660779476a3ae071a2fae00819fe497dccefff"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"488f96a5f780823b03cdd6e1e98e8b61a5339ae7","unresolved":false,"context_lines":[{"line_number":49,"context_line":""},{"line_number":50,"context_line":"        self.connection \u003d connection or n_rpc.create_connection()"},{"line_number":51,"context_line":"        endpoints \u003d [resources_rpc.ResourcesPushRpcCallback()]"},{"line_number":52,"context_line":"        topic \u003d resources_rpc.resource_type_versioned_topic(resources.SUBPORTS)"},{"line_number":53,"context_line":"        connection.create_consumer(topic, endpoints, fanout\u003dTrue)"},{"line_number":54,"context_line":""},{"line_number":55,"context_line":"    @abc.abstractmethod"}],"source_content_type":"text/x-python","patch_set":12,"id":"bacf61ea_d6970f38","line":52,"updated":"2016-07-30 16:02:11.000000000","message":"Need trunks too?","commit_id":"39660779476a3ae071a2fae00819fe497dccefff"},{"author":{"_account_id":8788,"name":"Miguel Angel Ajo","email":"mangelajo@redhat.com","username":"mangelajo"},"change_message_id":"b92db10ba2f6d1f3573f1f01fac6ad0e067239f0","unresolved":false,"context_lines":[{"line_number":49,"context_line":""},{"line_number":50,"context_line":"        self.connection \u003d connection or n_rpc.create_connection()"},{"line_number":51,"context_line":"        endpoints \u003d [resources_rpc.ResourcesPushRpcCallback()]"},{"line_number":52,"context_line":"        topic \u003d resources_rpc.resource_type_versioned_topic(resources.SUBPORTS)"},{"line_number":53,"context_line":"        connection.create_consumer(topic, endpoints, fanout\u003dTrue)"},{"line_number":54,"context_line":""},{"line_number":55,"context_line":"    @abc.abstractmethod"}],"source_content_type":"text/x-python","patch_set":12,"id":"bacf61ea_377ac977","line":52,"in_reply_to":"bacf61ea_d6970f38","updated":"2016-08-01 10:24:55.000000000","message":"Yes, based on L47, yes.","commit_id":"39660779476a3ae071a2fae00819fe497dccefff"},{"author":{"_account_id":13770,"name":"Adolfo Duarte","email":"adduarte@redhat.com","username":"adolfoduarte"},"change_message_id":"eff6f9d39d954ec4e94a2e37bd580ef9bff8fcdf","unresolved":false,"context_lines":[{"line_number":21,"context_line":"from neutron.api.rpc.callbacks import resources"},{"line_number":22,"context_line":"from neutron.api.rpc.handlers import resources_rpc"},{"line_number":23,"context_line":"from neutron.common import rpc as n_rpc"},{"line_number":24,"context_line":"from neutron.services.trunk import constants as trunk_consts"},{"line_number":25,"context_line":""},{"line_number":26,"context_line":"LOG \u003d logging.getLogger(__name__)"},{"line_number":27,"context_line":""}],"source_content_type":"text/x-python","patch_set":15,"id":"bacf61ea_86e68914","line":24,"range":{"start_line":24,"start_character":0,"end_line":24,"end_character":60},"updated":"2016-08-02 21:04:46.000000000","message":"this should be from neutron.services.trunk.rpc import trunk_consts","commit_id":"bfb10545bcb7fef0542a1ae45b5e486d41f87907"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"e136e87f984898741ad0a992d0670f26c4f01177","unresolved":false,"context_lines":[{"line_number":21,"context_line":"from neutron.api.rpc.callbacks import resources"},{"line_number":22,"context_line":"from neutron.api.rpc.handlers import resources_rpc"},{"line_number":23,"context_line":"from neutron.common import rpc as n_rpc"},{"line_number":24,"context_line":"from neutron.services.trunk import constants as trunk_consts"},{"line_number":25,"context_line":""},{"line_number":26,"context_line":"LOG \u003d logging.getLogger(__name__)"},{"line_number":27,"context_line":""}],"source_content_type":"text/x-python","patch_set":15,"id":"bacf61ea_269d1d5a","line":24,"range":{"start_line":24,"start_character":0,"end_line":24,"end_character":60},"in_reply_to":"bacf61ea_86e68914","updated":"2016-08-02 21:05:59.000000000","message":"ack","commit_id":"bfb10545bcb7fef0542a1ae45b5e486d41f87907"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"change_message_id":"107419ceb81046cbcb2da0206330cf6562951d31","unresolved":false,"context_lines":[{"line_number":23,"context_line":"from neutron.common import rpc as n_rpc"},{"line_number":24,"context_line":"from neutron.services.trunk.rpc import constants as trunk_consts"},{"line_number":25,"context_line":""},{"line_number":26,"context_line":"LOG \u003d logging.getLogger(__name__)"},{"line_number":27,"context_line":""},{"line_number":28,"context_line":"# This module contains stub (client-side) and skeleton (server-side)"},{"line_number":29,"context_line":"# proxy code that executes in the Neutron L2 Agent process space. This"}],"source_content_type":"text/x-python","patch_set":17,"id":"bacf61ea_d9067f84","line":26,"updated":"2016-08-03 13:13:36.000000000","message":"not used","commit_id":"124d59e8a167663da2a5369bb5a684bfe1886bd5"},{"author":{"_account_id":13770,"name":"Adolfo Duarte","email":"adduarte@redhat.com","username":"adolfoduarte"},"change_message_id":"fbc6557d1c5a87da449890f0222c62f032e89c6c","unresolved":false,"context_lines":[{"line_number":23,"context_line":"from neutron.common import rpc as n_rpc"},{"line_number":24,"context_line":"from neutron.services.trunk.rpc import constants as trunk_consts"},{"line_number":25,"context_line":""},{"line_number":26,"context_line":"LOG \u003d logging.getLogger(__name__)"},{"line_number":27,"context_line":""},{"line_number":28,"context_line":"# This module contains stub (client-side) and skeleton (server-side)"},{"line_number":29,"context_line":"# proxy code that executes in the Neutron L2 Agent process space. This"}],"source_content_type":"text/x-python","patch_set":17,"id":"bacf61ea_70203db1","line":26,"in_reply_to":"bacf61ea_d9067f84","updated":"2016-08-03 15:48:26.000000000","message":"Done","commit_id":"124d59e8a167663da2a5369bb5a684bfe1886bd5"},{"author":{"_account_id":8788,"name":"Miguel Angel Ajo","email":"mangelajo@redhat.com","username":"mangelajo"},"change_message_id":"4cb6881b3a442d1c079995ac885539aa60318e1c","unresolved":false,"context_lines":[{"line_number":75,"context_line":""},{"line_number":76,"context_line":""},{"line_number":77,"context_line":"class TrunkStub(object):"},{"line_number":78,"context_line":"    \"\"\"Stub proxy code for agent-\u003eserver communication.\"\"\""},{"line_number":79,"context_line":""},{"line_number":80,"context_line":"    def __init__(self):"},{"line_number":81,"context_line":"        self.stub \u003d resources_rpc.ResourcesPullRpcApi()"}],"source_content_type":"text/x-python","patch_set":22,"id":"9ad45d7e_e498f81d","line":78,"updated":"2016-08-09 12:31:54.000000000","message":"Sorry for the cry :), but if we had time, using this would be wonderful:\n\nhttp://www.ajo.es/post/148687053354/some-random-links-about-osloversioned-objects\n\n(I\u0027ve put some notes together in my blog).\n\nI guess time is tight, so please ignore it, and we should provide an indirection API from Ocata, making our lifes much more easier at the agent side. :)","commit_id":"e512d27a030f0c0ff23a52ab38d5ada83522413a"},{"author":{"_account_id":13770,"name":"Adolfo Duarte","email":"adduarte@redhat.com","username":"adolfoduarte"},"change_message_id":"35f902ed48596d527de2930b2fb9ebc8754bc481","unresolved":false,"context_lines":[{"line_number":75,"context_line":""},{"line_number":76,"context_line":""},{"line_number":77,"context_line":"class TrunkStub(object):"},{"line_number":78,"context_line":"    \"\"\"Stub proxy code for agent-\u003eserver communication.\"\"\""},{"line_number":79,"context_line":""},{"line_number":80,"context_line":"    def __init__(self):"},{"line_number":81,"context_line":"        self.stub \u003d resources_rpc.ResourcesPullRpcApi()"}],"source_content_type":"text/x-python","patch_set":22,"id":"9ad45d7e_ff1dbe62","line":78,"in_reply_to":"9ad45d7e_06db3ded","updated":"2016-08-10 22:48:52.000000000","message":"Done","commit_id":"e512d27a030f0c0ff23a52ab38d5ada83522413a"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"83ea0d091e518c9899b75dd7cdb64c3b89b11bf3","unresolved":false,"context_lines":[{"line_number":75,"context_line":""},{"line_number":76,"context_line":""},{"line_number":77,"context_line":"class TrunkStub(object):"},{"line_number":78,"context_line":"    \"\"\"Stub proxy code for agent-\u003eserver communication.\"\"\""},{"line_number":79,"context_line":""},{"line_number":80,"context_line":"    def __init__(self):"},{"line_number":81,"context_line":"        self.stub \u003d resources_rpc.ResourcesPullRpcApi()"}],"source_content_type":"text/x-python","patch_set":22,"id":"9ad45d7e_06db3ded","line":78,"in_reply_to":"9ad45d7e_1c672e26","updated":"2016-08-10 18:01:09.000000000","message":"I am not sure I follow 100%, get_trunk_details() is an agent side local call that, once remoted, calls into get_objects() and it already follows the pattern as adopted elsewhere, correct? Now if you\u0027re suggesting to avoid using the registry pull() operation, or avoid use oslo_messaging directly and use remotable OVO methods, I\u0027d argue that I\u0027d still want to the stub code to encapsulate nicely how remote communication takes place, because I may want to change that in the future anyway.\n\nIt\u0027s unclear to me what benefits we gain by switching today rather than tomorrow, especially in consideration of the fact that all of the code here is within 20 lines, how much cleaner does this need to get?\n\nI can see that it would be nice to make a call on an object and not care whether the call itself is remote or not, but from a quick scan to your links I still saw some plumbing code required. Now it may be beneficial to adopt the OVO-based model to deal with versioning, bw compatibility etc, but the reality is the methods update_trunk_status() and update_subport_bindings() would need to do a lot more than updating the object status alone, there\u0027s other business logic involving cooperating with core plugin etc, and that logic may not make sense to be encapsulated in the trunk OVO class. Surely a clean design could be achieved nonetheless but there are so many missing pieces to the puzzle that I feel it would be risky going down this path right now.\n\nAm I making any sense?","commit_id":"e512d27a030f0c0ff23a52ab38d5ada83522413a"},{"author":{"_account_id":8788,"name":"Miguel Angel Ajo","email":"mangelajo@redhat.com","username":"mangelajo"},"change_message_id":"ad97606a7264b54e393053a75d8edfbc43c31bae","unresolved":false,"context_lines":[{"line_number":75,"context_line":""},{"line_number":76,"context_line":""},{"line_number":77,"context_line":"class TrunkStub(object):"},{"line_number":78,"context_line":"    \"\"\"Stub proxy code for agent-\u003eserver communication.\"\"\""},{"line_number":79,"context_line":""},{"line_number":80,"context_line":"    def __init__(self):"},{"line_number":81,"context_line":"        self.stub \u003d resources_rpc.ResourcesPullRpcApi()"}],"source_content_type":"text/x-python","patch_set":22,"id":"9ad45d7e_1c672e26","line":78,"in_reply_to":"9ad45d7e_96d68025","updated":"2016-08-10 08:16:29.000000000","message":"In general, we could have as base of DB OVO\u0027s\n\na get_object(....)\n\nSo, being naive:\n\n    get_trunk_details would be avoided all together by having, get_object and get_objects as remotables (from the base NeutronDbObject):\n\n    TrunkPort.get_object(port_id\u003dparent_port_id)\n\n\n    trunk_port.update_status(status)\n\n\n    trunk.update_subport_bindings(subports)\n\nThose could, or could not make sense as calls on the OVO, I haven\u0027t looked at the behaviour of those calls while writing this comment, but , it could make sense that a trunk port OVO knows himself how to update his objects, o talk to his own subports to update bindings :)\n\n\nAnyway, making a call remotable has the same implications of introducing a new rpc call (compatibility across versions, upgrade path, 2 cycle deprecation), just makes code a little bit more clean, and saves us from writing extra code and stubs.","commit_id":"e512d27a030f0c0ff23a52ab38d5ada83522413a"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"3df55de40db90c7c13bb37897c89d5f12cdcad5c","unresolved":false,"context_lines":[{"line_number":75,"context_line":""},{"line_number":76,"context_line":""},{"line_number":77,"context_line":"class TrunkStub(object):"},{"line_number":78,"context_line":"    \"\"\"Stub proxy code for agent-\u003eserver communication.\"\"\""},{"line_number":79,"context_line":""},{"line_number":80,"context_line":"    def __init__(self):"},{"line_number":81,"context_line":"        self.stub \u003d resources_rpc.ResourcesPullRpcApi()"}],"source_content_type":"text/x-python","patch_set":22,"id":"9ad45d7e_96d68025","line":78,"in_reply_to":"9ad45d7e_e498f81d","updated":"2016-08-09 15:56:33.000000000","message":"What exactly do you intend to remote here? Of the three API calls this stub provides I feel like the latter two would look rather clunky if we switched to something OVO based, but I\u0027d love to see an existing example. The first API is OVO based and it looks rather neat.","commit_id":"e512d27a030f0c0ff23a52ab38d5ada83522413a"},{"author":{"_account_id":16800,"name":"Rawlin Peters","email":"rawlin.peters@hpe.com","username":"rawlin"},"change_message_id":"656f7d12839364efe165598acb3957576cc945b7","unresolved":false,"context_lines":[{"line_number":58,"context_line":"        # if common logic may be extracted out, consider making a base"},{"line_number":59,"context_line":"        # version of this method that can be overidden by the inherited"},{"line_number":60,"context_line":"        # skeleton."},{"line_number":61,"context_line":"        # NOTE: If the trunk belong to a trunk which the agent does not"},{"line_number":62,"context_line":"        # manage, the notification can either be ignored or cached for"},{"line_number":63,"context_line":"        # future use."},{"line_number":64,"context_line":""},{"line_number":65,"context_line":"    @abc.abstractmethod"}],"source_content_type":"text/x-python","patch_set":26,"id":"9ad45d7e_ea578323","line":62,"range":{"start_line":61,"start_character":16,"end_line":62,"end_character":16},"updated":"2016-08-11 22:13:24.000000000","message":"\"If a trunk is not managed by the agent\"","commit_id":"31a4a66dcae0698e91640bc5eaf110425e304371"},{"author":{"_account_id":13770,"name":"Adolfo Duarte","email":"adduarte@redhat.com","username":"adolfoduarte"},"change_message_id":"8e5d9264debee026def7e7fd88c0530efbda9e67","unresolved":false,"context_lines":[{"line_number":58,"context_line":"        # if common logic may be extracted out, consider making a base"},{"line_number":59,"context_line":"        # version of this method that can be overidden by the inherited"},{"line_number":60,"context_line":"        # skeleton."},{"line_number":61,"context_line":"        # NOTE: If the trunk belong to a trunk which the agent does not"},{"line_number":62,"context_line":"        # manage, the notification can either be ignored or cached for"},{"line_number":63,"context_line":"        # future use."},{"line_number":64,"context_line":""},{"line_number":65,"context_line":"    @abc.abstractmethod"}],"source_content_type":"text/x-python","patch_set":26,"id":"9ad45d7e_f7472c49","line":62,"range":{"start_line":61,"start_character":16,"end_line":62,"end_character":16},"in_reply_to":"9ad45d7e_ea578323","updated":"2016-08-12 19:01:07.000000000","message":"Done","commit_id":"31a4a66dcae0698e91640bc5eaf110425e304371"},{"author":{"_account_id":16800,"name":"Rawlin Peters","email":"rawlin.peters@hpe.com","username":"rawlin"},"change_message_id":"656f7d12839364efe165598acb3957576cc945b7","unresolved":false,"context_lines":[{"line_number":68,"context_line":"        # if common logic may be extracted out, consider making a base"},{"line_number":69,"context_line":"        # version of this method that can be overidden by the inherited"},{"line_number":70,"context_line":"        # skeleton."},{"line_number":71,"context_line":"        # NOTE: If the subport belong to a trunk which the agent does not"},{"line_number":72,"context_line":"        # manage, the notification should be ignored."},{"line_number":73,"context_line":""},{"line_number":74,"context_line":""}],"source_content_type":"text/x-python","patch_set":26,"id":"9ad45d7e_8a2367bc","line":71,"range":{"start_line":71,"start_character":31,"end_line":71,"end_character":37},"updated":"2016-08-11 22:13:24.000000000","message":"belongs","commit_id":"31a4a66dcae0698e91640bc5eaf110425e304371"},{"author":{"_account_id":13770,"name":"Adolfo Duarte","email":"adduarte@redhat.com","username":"adolfoduarte"},"change_message_id":"8e5d9264debee026def7e7fd88c0530efbda9e67","unresolved":false,"context_lines":[{"line_number":68,"context_line":"        # if common logic may be extracted out, consider making a base"},{"line_number":69,"context_line":"        # version of this method that can be overidden by the inherited"},{"line_number":70,"context_line":"        # skeleton."},{"line_number":71,"context_line":"        # NOTE: If the subport belong to a trunk which the agent does not"},{"line_number":72,"context_line":"        # manage, the notification should be ignored."},{"line_number":73,"context_line":""},{"line_number":74,"context_line":""}],"source_content_type":"text/x-python","patch_set":26,"id":"9ad45d7e_579a78c6","line":71,"range":{"start_line":71,"start_character":31,"end_line":71,"end_character":37},"in_reply_to":"9ad45d7e_8a2367bc","updated":"2016-08-12 19:01:07.000000000","message":"Done","commit_id":"31a4a66dcae0698e91640bc5eaf110425e304371"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"9eeb0415b2c29b7e28944da2564baeb5f10a32ae","unresolved":false,"context_lines":[{"line_number":79,"context_line":"        self.stub \u003d resources_rpc.ResourcesPullRpcApi()"},{"line_number":80,"context_line":"        target \u003d oslo_messaging.Target("},{"line_number":81,"context_line":"            topic\u003dtrunk_consts.TRUNK_BASE_TOPIC,"},{"line_number":82,"context_line":"            version\u003d\u00271.0\u0027,"},{"line_number":83,"context_line":"            namespace\u003dtrunk_consts.TRUNK_BASE_NAMESPACE)"},{"line_number":84,"context_line":"        self.rpc_client \u003d n_rpc.get_client(target)"},{"line_number":85,"context_line":""}],"source_content_type":"text/x-python","patch_set":26,"id":"9ad45d7e_0963fc42","line":82,"updated":"2016-08-12 01:01:47.000000000","message":"perhaps it\u0027s cleaner if we make this a class attribute and use it here rather than hardcode it, we can keep the API version history cleaner that way.","commit_id":"31a4a66dcae0698e91640bc5eaf110425e304371"},{"author":{"_account_id":13770,"name":"Adolfo Duarte","email":"adduarte@redhat.com","username":"adolfoduarte"},"change_message_id":"8e5d9264debee026def7e7fd88c0530efbda9e67","unresolved":false,"context_lines":[{"line_number":79,"context_line":"        self.stub \u003d resources_rpc.ResourcesPullRpcApi()"},{"line_number":80,"context_line":"        target \u003d oslo_messaging.Target("},{"line_number":81,"context_line":"            topic\u003dtrunk_consts.TRUNK_BASE_TOPIC,"},{"line_number":82,"context_line":"            version\u003d\u00271.0\u0027,"},{"line_number":83,"context_line":"            namespace\u003dtrunk_consts.TRUNK_BASE_NAMESPACE)"},{"line_number":84,"context_line":"        self.rpc_client \u003d n_rpc.get_client(target)"},{"line_number":85,"context_line":""}],"source_content_type":"text/x-python","patch_set":26,"id":"9ad45d7e_d7dca876","line":82,"in_reply_to":"9ad45d7e_0963fc42","updated":"2016-08-12 19:01:07.000000000","message":"will make version a class attribute.","commit_id":"31a4a66dcae0698e91640bc5eaf110425e304371"},{"author":{"_account_id":13770,"name":"Adolfo Duarte","email":"adduarte@redhat.com","username":"adolfoduarte"},"change_message_id":"abf8b21e4961175bcc85845401aba2176cda3e29","unresolved":false,"context_lines":[{"line_number":79,"context_line":"        self.stub \u003d resources_rpc.ResourcesPullRpcApi()"},{"line_number":80,"context_line":"        target \u003d oslo_messaging.Target("},{"line_number":81,"context_line":"            topic\u003dtrunk_consts.TRUNK_BASE_TOPIC,"},{"line_number":82,"context_line":"            version\u003d\u00271.0\u0027,"},{"line_number":83,"context_line":"            namespace\u003dtrunk_consts.TRUNK_BASE_NAMESPACE)"},{"line_number":84,"context_line":"        self.rpc_client \u003d n_rpc.get_client(target)"},{"line_number":85,"context_line":""}],"source_content_type":"text/x-python","patch_set":26,"id":"9ad45d7e_c51cedc3","line":82,"in_reply_to":"9ad45d7e_d7dca876","updated":"2016-08-12 20:45:30.000000000","message":"Done","commit_id":"31a4a66dcae0698e91640bc5eaf110425e304371"},{"author":{"_account_id":6788,"name":"Rossella Sblendido","email":"rsblendido@suse.com","username":"rossella-o"},"change_message_id":"c9d7876ca4177c828f4cb87e6448604ea2470b15","unresolved":false,"context_lines":[{"line_number":83,"context_line":"            namespace\u003dtrunk_consts.TRUNK_BASE_NAMESPACE)"},{"line_number":84,"context_line":"        self.rpc_client \u003d n_rpc.get_client(target)"},{"line_number":85,"context_line":""},{"line_number":86,"context_line":"    def get_trunk_details(self, context, parent_port_id):"},{"line_number":87,"context_line":"        \"\"\"Get information about the trunk for the given parent port.\"\"\""},{"line_number":88,"context_line":"        return self.stub.pull(context, resources.TRUNK, parent_port_id)"},{"line_number":89,"context_line":""}],"source_content_type":"text/x-python","patch_set":26,"id":"9ad45d7e_780fb62e","line":86,"updated":"2016-08-12 15:30:46.000000000","message":"the ovs agent needs to know the mac address of the parent port to be able to wire the trunk. Wouldn\u0027t it make sense to provide it into this call?","commit_id":"31a4a66dcae0698e91640bc5eaf110425e304371"},{"author":{"_account_id":13770,"name":"Adolfo Duarte","email":"adduarte@redhat.com","username":"adolfoduarte"},"change_message_id":"8e5d9264debee026def7e7fd88c0530efbda9e67","unresolved":false,"context_lines":[{"line_number":83,"context_line":"            namespace\u003dtrunk_consts.TRUNK_BASE_NAMESPACE)"},{"line_number":84,"context_line":"        self.rpc_client \u003d n_rpc.get_client(target)"},{"line_number":85,"context_line":""},{"line_number":86,"context_line":"    def get_trunk_details(self, context, parent_port_id):"},{"line_number":87,"context_line":"        \"\"\"Get information about the trunk for the given parent port.\"\"\""},{"line_number":88,"context_line":"        return self.stub.pull(context, resources.TRUNK, parent_port_id)"},{"line_number":89,"context_line":""}],"source_content_type":"text/x-python","patch_set":26,"id":"9ad45d7e_17be40ff","line":86,"in_reply_to":"9ad45d7e_464c9076","updated":"2016-08-12 19:01:07.000000000","message":"Nothing to do here since it looks like the agent has other means to get access to the parent port\u0027s mac address\nDone","commit_id":"31a4a66dcae0698e91640bc5eaf110425e304371"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"4bbdaa412368116f7fb2b2c2f3c65245be3e16f4","unresolved":false,"context_lines":[{"line_number":83,"context_line":"            namespace\u003dtrunk_consts.TRUNK_BASE_NAMESPACE)"},{"line_number":84,"context_line":"        self.rpc_client \u003d n_rpc.get_client(target)"},{"line_number":85,"context_line":""},{"line_number":86,"context_line":"    def get_trunk_details(self, context, parent_port_id):"},{"line_number":87,"context_line":"        \"\"\"Get information about the trunk for the given parent port.\"\"\""},{"line_number":88,"context_line":"        return self.stub.pull(context, resources.TRUNK, parent_port_id)"},{"line_number":89,"context_line":""}],"source_content_type":"text/x-python","patch_set":26,"id":"9ad45d7e_bb8f68cb","line":86,"in_reply_to":"9ad45d7e_780fb62e","updated":"2016-08-12 15:54:06.000000000","message":"As far as I understand (OVS case), the mac address of the parent port is available from the external ids, no?","commit_id":"31a4a66dcae0698e91640bc5eaf110425e304371"},{"author":{"_account_id":16800,"name":"Rawlin Peters","email":"rawlin.peters@hpe.com","username":"rawlin"},"change_message_id":"16ef1c835aca75da7f206a59d8f1b12a0a0e8264","unresolved":false,"context_lines":[{"line_number":83,"context_line":"            namespace\u003dtrunk_consts.TRUNK_BASE_NAMESPACE)"},{"line_number":84,"context_line":"        self.rpc_client \u003d n_rpc.get_client(target)"},{"line_number":85,"context_line":""},{"line_number":86,"context_line":"    def get_trunk_details(self, context, parent_port_id):"},{"line_number":87,"context_line":"        \"\"\"Get information about the trunk for the given parent port.\"\"\""},{"line_number":88,"context_line":"        return self.stub.pull(context, resources.TRUNK, parent_port_id)"},{"line_number":89,"context_line":""}],"source_content_type":"text/x-python","patch_set":26,"id":"9ad45d7e_464c9076","line":86,"in_reply_to":"9ad45d7e_bb8f68cb","updated":"2016-08-12 17:15:37.000000000","message":"Yes, os-vif still sets the \u0027attached-mac\u0027 external id [1], which would be the MAC of the parent port. I think the agent could easily retrieve this info after it has detected a new port on a trunk bridge, somewhere around [2].\n\n[1] https://github.com/openstack/os-vif/blob/master/vif_plug_ovs/linux_net.py#L56\n[2] https://review.openstack.org/#/c/347466/1/neutron/services/trunk/drivers/openvswitch/agent/ovsdb_handler.py@90","commit_id":"31a4a66dcae0698e91640bc5eaf110425e304371"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"39b62586e48af97a7e90d49fc23d019e0f8a5ef3","unresolved":false,"context_lines":[{"line_number":79,"context_line":"        self.stub \u003d resources_rpc.ResourcesPullRpcApi()"},{"line_number":80,"context_line":"        target \u003d oslo_messaging.Target("},{"line_number":81,"context_line":"            topic\u003dtrunk_consts.TRUNK_BASE_TOPIC,"},{"line_number":82,"context_line":"            version\u003dself.__class__.version,"},{"line_number":83,"context_line":"            namespace\u003dtrunk_consts.TRUNK_BASE_NAMESPACE)"},{"line_number":84,"context_line":"        self.rpc_client \u003d n_rpc.get_client(target)"},{"line_number":85,"context_line":""}],"source_content_type":"text/x-python","patch_set":27,"id":"7ac969e8_40f8127d","line":82,"updated":"2016-08-13 00:10:57.000000000","message":"self.version!!!","commit_id":"5f06e02006e4d1289d23ac532999f5e5064a8d0d"}],"neutron/services/trunk/rpc/backend.py":[{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"88793d135290c4269cd14559ee812881b2f685ee","unresolved":false,"context_lines":[{"line_number":25,"context_line":""},{"line_number":26,"context_line":"def setup_rpc(resource, event, trigger, **kwargs):"},{"line_number":27,"context_line":"    \"\"\"Initialize the Neutron Server RPC backend.\"\"\""},{"line_number":28,"context_line":"    # Initialize an RPC backend for the Neutron Server is it"},{"line_number":29,"context_line":"    # is not already available."},{"line_number":30,"context_line":"    if not trigger.is_rpc_enabled():"},{"line_number":31,"context_line":"        trigger.set_rpc_connection(server.initialize_rpc_backend())"}],"source_content_type":"text/x-python","patch_set":3,"id":"bacf61ea_a6558d1e","line":28,"updated":"2016-07-28 02:06:31.000000000","message":"fixme","commit_id":"b24a43d86086793180364a305a3c45f078c8a3d8"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"88793d135290c4269cd14559ee812881b2f685ee","unresolved":false,"context_lines":[{"line_number":54,"context_line":""},{"line_number":55,"context_line":"    # Check if the host is running an agent whose type is advertised as a"},{"line_number":56,"context_line":"    # supported one."},{"line_number":57,"context_line":"    compatible_agent_exists \u003d trunk_is_bound and True"},{"line_number":58,"context_line":""},{"line_number":59,"context_line":"    # Check if the vif_type associated to the trunk is compatible with an"},{"line_number":60,"context_line":"    # advertised vif type."}],"source_content_type":"text/x-python","patch_set":3,"id":"bacf61ea_c6588159","line":57,"updated":"2016-07-28 02:06:31.000000000","message":"fixme","commit_id":"b24a43d86086793180364a305a3c45f078c8a3d8"},{"author":{"_account_id":8788,"name":"Miguel Angel Ajo","email":"mangelajo@redhat.com","username":"mangelajo"},"change_message_id":"0400cf597a5ba21fa6f086c12ce5095ec6d3caca","unresolved":false,"context_lines":[{"line_number":24,"context_line":"LOG \u003d logging.getLogger(__name__)"},{"line_number":25,"context_line":""},{"line_number":26,"context_line":""},{"line_number":27,"context_line":"def setup_rpc(resource, event, trigger, **kwargs):"},{"line_number":28,"context_line":"    \"\"\"Initialize the Neutron Server RPC backend.\"\"\""},{"line_number":29,"context_line":"    # Initialize an RPC backend for the Neutron Server if it"},{"line_number":30,"context_line":"    # is not already available."}],"source_content_type":"text/x-python","patch_set":5,"id":"bacf61ea_f3f8c97e","line":27,"range":{"start_line":27,"start_character":31,"end_line":27,"end_character":39},"updated":"2016-07-28 14:17:04.000000000","message":"Could we rename trigger into what it specifically is in this case, so it becomes more meaningful.\n\nAlternatively, we can explain that into the docstring.","commit_id":"0a9f320f1f38a36f80ef1564308f4f678d7931b7"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"83ccb42f79c61bab4bb0c847ed2b53c40541a159","unresolved":false,"context_lines":[{"line_number":24,"context_line":"LOG \u003d logging.getLogger(__name__)"},{"line_number":25,"context_line":""},{"line_number":26,"context_line":""},{"line_number":27,"context_line":"def setup_rpc(resource, event, trigger, **kwargs):"},{"line_number":28,"context_line":"    \"\"\"Initialize the Neutron Server RPC backend.\"\"\""},{"line_number":29,"context_line":"    # Initialize an RPC backend for the Neutron Server if it"},{"line_number":30,"context_line":"    # is not already available."}],"source_content_type":"text/x-python","patch_set":5,"id":"bacf61ea_a4ed62f1","line":27,"range":{"start_line":27,"start_character":31,"end_line":27,"end_character":39},"in_reply_to":"bacf61ea_f3f8c97e","updated":"2016-07-28 15:28:06.000000000","message":"Done","commit_id":"0a9f320f1f38a36f80ef1564308f4f678d7931b7"},{"author":{"_account_id":13770,"name":"Adolfo Duarte","email":"adduarte@redhat.com","username":"adolfoduarte"},"change_message_id":"1469c956bb6067a11cd7c3491f7c6511986a8b28","unresolved":false,"context_lines":[{"line_number":43,"context_line":""},{"line_number":44,"context_line":""},{"line_number":45,"context_line":"def is_agent_available_on_host("},{"line_number":46,"context_line":"    context, core_plugin, supported_agent_types, host):"},{"line_number":47,"context_line":"    \"\"\"Return True if host is running any of the agent_types.\"\"\""},{"line_number":48,"context_line":"    if utils.is_extension_supported(core_plugin, \u0027agent\u0027):"},{"line_number":49,"context_line":"        agents \u003d core_plugin.get_agents("}],"source_content_type":"text/x-python","patch_set":5,"id":"bacf61ea_44cf5fb0","line":46,"range":{"start_line":46,"start_character":4,"end_line":46,"end_character":10},"updated":"2016-07-28 09:10:19.000000000","message":"continuation line with same indent as line above","commit_id":"0a9f320f1f38a36f80ef1564308f4f678d7931b7"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"83ccb42f79c61bab4bb0c847ed2b53c40541a159","unresolved":false,"context_lines":[{"line_number":43,"context_line":""},{"line_number":44,"context_line":""},{"line_number":45,"context_line":"def is_agent_available_on_host("},{"line_number":46,"context_line":"    context, core_plugin, supported_agent_types, host):"},{"line_number":47,"context_line":"    \"\"\"Return True if host is running any of the agent_types.\"\"\""},{"line_number":48,"context_line":"    if utils.is_extension_supported(core_plugin, \u0027agent\u0027):"},{"line_number":49,"context_line":"        agents \u003d core_plugin.get_agents("}],"source_content_type":"text/x-python","patch_set":5,"id":"bacf61ea_24b852e5","line":46,"range":{"start_line":46,"start_character":4,"end_line":46,"end_character":10},"in_reply_to":"bacf61ea_44cf5fb0","updated":"2016-07-28 15:28:06.000000000","message":"Done","commit_id":"0a9f320f1f38a36f80ef1564308f4f678d7931b7"},{"author":{"_account_id":8788,"name":"Miguel Angel Ajo","email":"mangelajo@redhat.com","username":"mangelajo"},"change_message_id":"0400cf597a5ba21fa6f086c12ce5095ec6d3caca","unresolved":false,"context_lines":[{"line_number":54,"context_line":"        return False"},{"line_number":55,"context_line":""},{"line_number":56,"context_line":""},{"line_number":57,"context_line":"def subports_notification(resource, event, trigger, payload\u003dNone):"},{"line_number":58,"context_line":"    \"\"\"Send subports event to agent if required.\"\"\""},{"line_number":59,"context_line":"    core_plugin \u003d manager.NeutronManager.get_plugin()"},{"line_number":60,"context_line":"    context \u003d payload.context"}],"source_content_type":"text/x-python","patch_set":5,"id":"bacf61ea_d1d81df2","line":57,"range":{"start_line":57,"start_character":43,"end_line":57,"end_character":50},"updated":"2016-07-28 14:17:04.000000000","message":"Ditto about trigger.","commit_id":"0a9f320f1f38a36f80ef1564308f4f678d7931b7"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"83ccb42f79c61bab4bb0c847ed2b53c40541a159","unresolved":false,"context_lines":[{"line_number":54,"context_line":"        return False"},{"line_number":55,"context_line":""},{"line_number":56,"context_line":""},{"line_number":57,"context_line":"def subports_notification(resource, event, trigger, payload\u003dNone):"},{"line_number":58,"context_line":"    \"\"\"Send subports event to agent if required.\"\"\""},{"line_number":59,"context_line":"    core_plugin \u003d manager.NeutronManager.get_plugin()"},{"line_number":60,"context_line":"    context \u003d payload.context"}],"source_content_type":"text/x-python","patch_set":5,"id":"bacf61ea_84cf7e7e","line":57,"range":{"start_line":57,"start_character":43,"end_line":57,"end_character":50},"in_reply_to":"bacf61ea_d1d81df2","updated":"2016-07-28 15:28:06.000000000","message":"Done","commit_id":"0a9f320f1f38a36f80ef1564308f4f678d7931b7"},{"author":{"_account_id":13770,"name":"Adolfo Duarte","email":"adduarte@redhat.com","username":"adolfoduarte"},"change_message_id":"1469c956bb6067a11cd7c3491f7c6511986a8b28","unresolved":false,"context_lines":[{"line_number":60,"context_line":"    context \u003d payload.context"},{"line_number":61,"context_line":"    trunk_parent \u003d core_plugin.get_port("},{"line_number":62,"context_line":"        context, payload.current_trunk.port_id)"},{"line_number":63,"context_line":"    vif_type \u003d trunk_parent.get(\u0027binding:vif_type\u0027)"},{"line_number":64,"context_line":"    binding_host \u003d trunk_parent.get(\u0027binding:host_id\u0027)"},{"line_number":65,"context_line":""},{"line_number":66,"context_line":"    # Check if the trunk is bound."}],"source_content_type":"text/x-python","patch_set":5,"id":"bacf61ea_c49cef6b","line":63,"range":{"start_line":63,"start_character":4,"end_line":63,"end_character":51},"updated":"2016-07-28 09:10:19.000000000","message":"any chance trunk_parent \u003d None at this point? if so, the .get called to it will fail","commit_id":"0a9f320f1f38a36f80ef1564308f4f678d7931b7"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"83ccb42f79c61bab4bb0c847ed2b53c40541a159","unresolved":false,"context_lines":[{"line_number":60,"context_line":"    context \u003d payload.context"},{"line_number":61,"context_line":"    trunk_parent \u003d core_plugin.get_port("},{"line_number":62,"context_line":"        context, payload.current_trunk.port_id)"},{"line_number":63,"context_line":"    vif_type \u003d trunk_parent.get(\u0027binding:vif_type\u0027)"},{"line_number":64,"context_line":"    binding_host \u003d trunk_parent.get(\u0027binding:host_id\u0027)"},{"line_number":65,"context_line":""},{"line_number":66,"context_line":"    # Check if the trunk is bound."}],"source_content_type":"text/x-python","patch_set":5,"id":"bacf61ea_64ca4a70","line":63,"range":{"start_line":63,"start_character":4,"end_line":63,"end_character":51},"in_reply_to":"bacf61ea_71605136","updated":"2016-07-28 15:28:06.000000000","message":"no.","commit_id":"0a9f320f1f38a36f80ef1564308f4f678d7931b7"},{"author":{"_account_id":8788,"name":"Miguel Angel Ajo","email":"mangelajo@redhat.com","username":"mangelajo"},"change_message_id":"0400cf597a5ba21fa6f086c12ce5095ec6d3caca","unresolved":false,"context_lines":[{"line_number":60,"context_line":"    context \u003d payload.context"},{"line_number":61,"context_line":"    trunk_parent \u003d core_plugin.get_port("},{"line_number":62,"context_line":"        context, payload.current_trunk.port_id)"},{"line_number":63,"context_line":"    vif_type \u003d trunk_parent.get(\u0027binding:vif_type\u0027)"},{"line_number":64,"context_line":"    binding_host \u003d trunk_parent.get(\u0027binding:host_id\u0027)"},{"line_number":65,"context_line":""},{"line_number":66,"context_line":"    # Check if the trunk is bound."}],"source_content_type":"text/x-python","patch_set":5,"id":"bacf61ea_71605136","line":63,"range":{"start_line":63,"start_character":4,"end_line":63,"end_character":51},"in_reply_to":"bacf61ea_c49cef6b","updated":"2016-07-28 14:17:04.000000000","message":"Can the trunk exist without a parent?","commit_id":"0a9f320f1f38a36f80ef1564308f4f678d7931b7"},{"author":{"_account_id":13770,"name":"Adolfo Duarte","email":"adduarte@redhat.com","username":"adolfoduarte"},"change_message_id":"1469c956bb6067a11cd7c3491f7c6511986a8b28","unresolved":false,"context_lines":[{"line_number":78,"context_line":""},{"line_number":79,"context_line":"    # Send the notification, if all the checks are positive."},{"line_number":80,"context_line":"    if trunk_is_bound and compatible_agent_exists and compatible_vif_type:"},{"line_number":81,"context_line":"        stub \u003d server.TrunkStub()"},{"line_number":82,"context_line":"        method \u003d {"},{"line_number":83,"context_line":"            events.AFTER_CREATE: stub.add_subports,"},{"line_number":84,"context_line":"            events.AFTER_DELETE: stub.delete_subports,"}],"source_content_type":"text/x-python","patch_set":5,"id":"bacf61ea_dfc5d85b","line":81,"range":{"start_line":81,"start_character":8,"end_line":81,"end_character":33},"updated":"2016-07-28 09:10:19.000000000","message":"Why do we need an object here? couldn\u0027t the TrunkStub methods just be static and imported ? everytime this call is made a new object is created just to be able to call the methods. a bit expensive.\nhttps://review.openstack.org/#/c/347662/5/neutron/services/trunk/rpc/server.py@77","commit_id":"0a9f320f1f38a36f80ef1564308f4f678d7931b7"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"83ccb42f79c61bab4bb0c847ed2b53c40541a159","unresolved":false,"context_lines":[{"line_number":78,"context_line":""},{"line_number":79,"context_line":"    # Send the notification, if all the checks are positive."},{"line_number":80,"context_line":"    if trunk_is_bound and compatible_agent_exists and compatible_vif_type:"},{"line_number":81,"context_line":"        stub \u003d server.TrunkStub()"},{"line_number":82,"context_line":"        method \u003d {"},{"line_number":83,"context_line":"            events.AFTER_CREATE: stub.add_subports,"},{"line_number":84,"context_line":"            events.AFTER_DELETE: stub.delete_subports,"}],"source_content_type":"text/x-python","patch_set":5,"id":"bacf61ea_44b106e1","line":81,"range":{"start_line":81,"start_character":8,"end_line":81,"end_character":33},"in_reply_to":"bacf61ea_dfc5d85b","updated":"2016-07-28 15:28:06.000000000","message":"Do you know how cheap is an object instantiation is? I can turn it this around though.","commit_id":"0a9f320f1f38a36f80ef1564308f4f678d7931b7"},{"author":{"_account_id":8788,"name":"Miguel Angel Ajo","email":"mangelajo@redhat.com","username":"mangelajo"},"change_message_id":"b92db10ba2f6d1f3573f1f01fac6ad0e067239f0","unresolved":false,"context_lines":[{"line_number":34,"context_line":"    # to agents as needed. These are designed to work with any"},{"line_number":35,"context_line":"    # agent-based driver that may integrate with the trunk service"},{"line_number":36,"context_line":"    # plugin, e.g. linux bridge or ovs."},{"line_number":37,"context_line":"    registry.subscribe(subports_notification,"},{"line_number":38,"context_line":"                       trunk_consts.SUBPORTS,"},{"line_number":39,"context_line":"                       events.AFTER_CREATE)"},{"line_number":40,"context_line":"    registry.subscribe(subports_notification,"}],"source_content_type":"text/x-python","patch_set":12,"id":"bacf61ea_17850506","line":37,"updated":"2016-08-01 10:24:55.000000000","message":"for event_type in [events.AFTER_CREATE, events.AFTER_DELETE]: \n    ...","commit_id":"39660779476a3ae071a2fae00819fe497dccefff"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"4b34895089746707725d010a53c1e741330c1539","unresolved":false,"context_lines":[{"line_number":34,"context_line":"    # to agents as needed. These are designed to work with any"},{"line_number":35,"context_line":"    # agent-based driver that may integrate with the trunk service"},{"line_number":36,"context_line":"    # plugin, e.g. linux bridge or ovs."},{"line_number":37,"context_line":"    registry.subscribe(subports_notification,"},{"line_number":38,"context_line":"                       trunk_consts.SUBPORTS,"},{"line_number":39,"context_line":"                       events.AFTER_CREATE)"},{"line_number":40,"context_line":"    registry.subscribe(subports_notification,"}],"source_content_type":"text/x-python","patch_set":12,"id":"bacf61ea_fb5c891a","line":37,"in_reply_to":"bacf61ea_17850506","updated":"2016-08-01 16:03:26.000000000","message":"minor optimization, but yeah","commit_id":"39660779476a3ae071a2fae00819fe497dccefff"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"488f96a5f780823b03cdd6e1e98e8b61a5339ae7","unresolved":false,"context_lines":[{"line_number":37,"context_line":"    registry.subscribe(subports_notification,"},{"line_number":38,"context_line":"                       trunk_consts.SUBPORTS,"},{"line_number":39,"context_line":"                       events.AFTER_CREATE)"},{"line_number":40,"context_line":"    registry.subscribe(subports_notification,"},{"line_number":41,"context_line":"                       trunk_consts.SUBPORTS,"},{"line_number":42,"context_line":"                       events.AFTER_DELETE)"},{"line_number":43,"context_line":""}],"source_content_type":"text/x-python","patch_set":12,"id":"bacf61ea_56acbf8b","line":40,"updated":"2016-07-30 16:02:11.000000000","message":"add trunk event subscribes","commit_id":"39660779476a3ae071a2fae00819fe497dccefff"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"488f96a5f780823b03cdd6e1e98e8b61a5339ae7","unresolved":false,"context_lines":[{"line_number":53,"context_line":"    else:"},{"line_number":54,"context_line":"        return False"},{"line_number":55,"context_line":""},{"line_number":56,"context_line":""},{"line_number":57,"context_line":"def subports_notification(resource, event, trunk_plugin, payload\u003dNone):"},{"line_number":58,"context_line":"    \"\"\"Send subports event to agent if required.\"\"\""},{"line_number":59,"context_line":"    core_plugin \u003d manager.NeutronManager.get_plugin()"}],"source_content_type":"text/x-python","patch_set":12,"id":"bacf61ea_b6b37be8","line":56,"updated":"2016-07-30 16:02:11.000000000","message":"missing trunk_notification handler.","commit_id":"39660779476a3ae071a2fae00819fe497dccefff"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"be782c653b1a45eca7cf647c4b4d69ddaaeb05e2","unresolved":false,"context_lines":[{"line_number":57,"context_line":"            return False"},{"line_number":58,"context_line":""},{"line_number":59,"context_line":"    def process_event(self, resource, event, trunk_plugin, payload\u003dNone):"},{"line_number":60,"context_line":"        \"\"\"Send subports event to an agent only if required.\"\"\""},{"line_number":61,"context_line":"        core_plugin \u003d manager.NeutronManager.get_plugin()"},{"line_number":62,"context_line":"        context \u003d payload.context"},{"line_number":63,"context_line":"        trunk_parent \u003d core_plugin.get_port("}],"source_content_type":"text/x-python","patch_set":14,"id":"bacf61ea_1f669b29","line":60,"updated":"2016-08-01 21:47:28.000000000","message":"and trunk","commit_id":"bc23b9387ed4103ae5f04b82e163e8bf85daeff1"},{"author":{"_account_id":8655,"name":"Jakub Libosvar","email":"libosvar@redhat.com","username":"jlibosva"},"change_message_id":"314af9f5641bf0a4a84b31a5c13a9fb6888a7830","unresolved":false,"context_lines":[{"line_number":29,"context_line":""},{"line_number":30,"context_line":"    def __init__(self):"},{"line_number":31,"context_line":"        \"\"\"Initialize an RPC backend for the Neutron Server.\"\"\""},{"line_number":32,"context_line":"        self._skeleton \u003d server.TrunkSkeleton()"},{"line_number":33,"context_line":"        self._stub \u003d server.TrunkStub()"},{"line_number":34,"context_line":""},{"line_number":35,"context_line":"        # Set up listeners to trunk events: they dispatch RPC messages"}],"source_content_type":"text/x-python","patch_set":17,"id":"bacf61ea_0d056ec1","line":32,"range":{"start_line":32,"start_character":8,"end_line":32,"end_character":47},"updated":"2016-08-03 15:37:54.000000000","message":"Is it used anywhere?","commit_id":"124d59e8a167663da2a5369bb5a684bfe1886bd5"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"d0af2a16fed3388c2f3d1f202a273db341451d90","unresolved":false,"context_lines":[{"line_number":29,"context_line":""},{"line_number":30,"context_line":"    def __init__(self):"},{"line_number":31,"context_line":"        \"\"\"Initialize an RPC backend for the Neutron Server.\"\"\""},{"line_number":32,"context_line":"        self._skeleton \u003d server.TrunkSkeleton()"},{"line_number":33,"context_line":"        self._stub \u003d server.TrunkStub()"},{"line_number":34,"context_line":""},{"line_number":35,"context_line":"        # Set up listeners to trunk events: they dispatch RPC messages"}],"source_content_type":"text/x-python","patch_set":17,"id":"bacf61ea_9cb06a8d","line":32,"range":{"start_line":32,"start_character":8,"end_line":32,"end_character":47},"in_reply_to":"bacf61ea_0d056ec1","updated":"2016-08-03 16:27:32.000000000","message":"not directly, but it can come handy later.","commit_id":"124d59e8a167663da2a5369bb5a684bfe1886bd5"},{"author":{"_account_id":8655,"name":"Jakub Libosvar","email":"libosvar@redhat.com","username":"jlibosva"},"change_message_id":"314af9f5641bf0a4a84b31a5c13a9fb6888a7830","unresolved":false,"context_lines":[{"line_number":45,"context_line":"                               event)"},{"line_number":46,"context_line":"        LOG.debug(\"RPC backend initialized for trunk plugin\")"},{"line_number":47,"context_line":""},{"line_number":48,"context_line":"    def is_agent_available_on_host(self, context, core_plugin,"},{"line_number":49,"context_line":"                                   supported_agent_types, host):"},{"line_number":50,"context_line":"        \"\"\"Return True if host is running any of the agent_types.\"\"\""},{"line_number":51,"context_line":"        if utils.is_extension_supported(core_plugin, \u0027agent\u0027):"}],"source_content_type":"text/x-python","patch_set":17,"id":"bacf61ea_6dd86a80","line":48,"range":{"start_line":48,"start_character":8,"end_line":48,"end_character":34},"updated":"2016-08-03 15:37:54.000000000","message":"Maybe this could be a separate function outside of the class as it really has nothing to do with it.","commit_id":"124d59e8a167663da2a5369bb5a684bfe1886bd5"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"d0af2a16fed3388c2f3d1f202a273db341451d90","unresolved":false,"context_lines":[{"line_number":45,"context_line":"                               event)"},{"line_number":46,"context_line":"        LOG.debug(\"RPC backend initialized for trunk plugin\")"},{"line_number":47,"context_line":""},{"line_number":48,"context_line":"    def is_agent_available_on_host(self, context, core_plugin,"},{"line_number":49,"context_line":"                                   supported_agent_types, host):"},{"line_number":50,"context_line":"        \"\"\"Return True if host is running any of the agent_types.\"\"\""},{"line_number":51,"context_line":"        if utils.is_extension_supported(core_plugin, \u0027agent\u0027):"}],"source_content_type":"text/x-python","patch_set":17,"id":"bacf61ea_5c6d5203","line":48,"range":{"start_line":48,"start_character":8,"end_line":48,"end_character":34},"in_reply_to":"bacf61ea_6dd86a80","updated":"2016-08-03 16:27:32.000000000","message":"true, but this makes sense here. It could be a module function, but meh.","commit_id":"124d59e8a167663da2a5369bb5a684bfe1886bd5"},{"author":{"_account_id":8655,"name":"Jakub Libosvar","email":"libosvar@redhat.com","username":"jlibosva"},"change_message_id":"314af9f5641bf0a4a84b31a5c13a9fb6888a7830","unresolved":false,"context_lines":[{"line_number":59,"context_line":"    def process_event(self, resource, event, trunk_plugin, payload\u003dNone):"},{"line_number":60,"context_line":"        \"\"\"Send subports event to an agent only if required.\"\"\""},{"line_number":61,"context_line":"        core_plugin \u003d manager.NeutronManager.get_plugin()"},{"line_number":62,"context_line":"        context \u003d payload.context"},{"line_number":63,"context_line":"        trunk_parent \u003d core_plugin.get_port("},{"line_number":64,"context_line":"            context, payload.current_trunk.port_id)"},{"line_number":65,"context_line":"        vif_type \u003d trunk_parent.get(\u0027binding:vif_type\u0027)"}],"source_content_type":"text/x-python","patch_set":17,"id":"bacf61ea_6d3ceabf","line":62,"range":{"start_line":62,"start_character":18,"end_line":62,"end_character":33},"updated":"2016-08-03 15:37:54.000000000","message":"This seems like payload is a mandatory argument.","commit_id":"124d59e8a167663da2a5369bb5a684bfe1886bd5"},{"author":{"_account_id":13770,"name":"Adolfo Duarte","email":"adduarte@redhat.com","username":"adolfoduarte"},"change_message_id":"7099107cd73b4a45b17bddd00314bb097bf45761","unresolved":false,"context_lines":[{"line_number":59,"context_line":"    def process_event(self, resource, event, trunk_plugin, payload\u003dNone):"},{"line_number":60,"context_line":"        \"\"\"Send subports event to an agent only if required.\"\"\""},{"line_number":61,"context_line":"        core_plugin \u003d manager.NeutronManager.get_plugin()"},{"line_number":62,"context_line":"        context \u003d payload.context"},{"line_number":63,"context_line":"        trunk_parent \u003d core_plugin.get_port("},{"line_number":64,"context_line":"            context, payload.current_trunk.port_id)"},{"line_number":65,"context_line":"        vif_type \u003d trunk_parent.get(\u0027binding:vif_type\u0027)"}],"source_content_type":"text/x-python","patch_set":17,"id":"bacf61ea_854bee58","line":62,"range":{"start_line":62,"start_character":18,"end_line":62,"end_character":33},"in_reply_to":"bacf61ea_3c47be78","updated":"2016-08-03 17:22:25.000000000","message":"Done","commit_id":"124d59e8a167663da2a5369bb5a684bfe1886bd5"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"d0af2a16fed3388c2f3d1f202a273db341451d90","unresolved":false,"context_lines":[{"line_number":59,"context_line":"    def process_event(self, resource, event, trunk_plugin, payload\u003dNone):"},{"line_number":60,"context_line":"        \"\"\"Send subports event to an agent only if required.\"\"\""},{"line_number":61,"context_line":"        core_plugin \u003d manager.NeutronManager.get_plugin()"},{"line_number":62,"context_line":"        context \u003d payload.context"},{"line_number":63,"context_line":"        trunk_parent \u003d core_plugin.get_port("},{"line_number":64,"context_line":"            context, payload.current_trunk.port_id)"},{"line_number":65,"context_line":"        vif_type \u003d trunk_parent.get(\u0027binding:vif_type\u0027)"}],"source_content_type":"text/x-python","patch_set":17,"id":"bacf61ea_3c47be78","line":62,"range":{"start_line":62,"start_character":18,"end_line":62,"end_character":33},"in_reply_to":"bacf61ea_6d3ceabf","updated":"2016-08-03 16:27:32.000000000","message":"we can drop the default to None.","commit_id":"124d59e8a167663da2a5369bb5a684bfe1886bd5"},{"author":{"_account_id":8655,"name":"Jakub Libosvar","email":"libosvar@redhat.com","username":"jlibosva"},"change_message_id":"314af9f5641bf0a4a84b31a5c13a9fb6888a7830","unresolved":false,"context_lines":[{"line_number":84,"context_line":"            LOG.debug(\"RPC notification needed for trunk %s\", payload.trunk_id)"},{"line_number":85,"context_line":"            if resource \u003d\u003d trunk_consts.SUBPORTS:"},{"line_number":86,"context_line":"                payload \u003d payload.subports"},{"line_number":87,"context_line":"                method \u003d {"},{"line_number":88,"context_line":"                    events.AFTER_CREATE: self._stub.add_subports,"},{"line_number":89,"context_line":"                    events.AFTER_DELETE: self._stub.delete_subports,"},{"line_number":90,"context_line":"                }"},{"line_number":91,"context_line":"            elif resource \u003d\u003d trunk_consts.TRUNK:"},{"line_number":92,"context_line":"                payload \u003d payload.current_trunk"},{"line_number":93,"context_line":"                method \u003d {"}],"source_content_type":"text/x-python","patch_set":17,"id":"bacf61ea_8d95de41","line":90,"range":{"start_line":87,"start_character":16,"end_line":90,"end_character":17},"updated":"2016-08-03 15:37:54.000000000","message":"This is a constant, can be initialized in __init__ and not constructed per event processing.","commit_id":"124d59e8a167663da2a5369bb5a684bfe1886bd5"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"d0af2a16fed3388c2f3d1f202a273db341451d90","unresolved":false,"context_lines":[{"line_number":84,"context_line":"            LOG.debug(\"RPC notification needed for trunk %s\", payload.trunk_id)"},{"line_number":85,"context_line":"            if resource \u003d\u003d trunk_consts.SUBPORTS:"},{"line_number":86,"context_line":"                payload \u003d payload.subports"},{"line_number":87,"context_line":"                method \u003d {"},{"line_number":88,"context_line":"                    events.AFTER_CREATE: self._stub.add_subports,"},{"line_number":89,"context_line":"                    events.AFTER_DELETE: self._stub.delete_subports,"},{"line_number":90,"context_line":"                }"},{"line_number":91,"context_line":"            elif resource \u003d\u003d trunk_consts.TRUNK:"},{"line_number":92,"context_line":"                payload \u003d payload.current_trunk"},{"line_number":93,"context_line":"                method \u003d {"}],"source_content_type":"text/x-python","patch_set":17,"id":"bacf61ea_bc53ae38","line":90,"range":{"start_line":87,"start_character":16,"end_line":90,"end_character":17},"in_reply_to":"bacf61ea_8d95de41","updated":"2016-08-03 16:27:32.000000000","message":"do you know how cheap this is? meh","commit_id":"124d59e8a167663da2a5369bb5a684bfe1886bd5"},{"author":{"_account_id":8655,"name":"Jakub Libosvar","email":"libosvar@redhat.com","username":"jlibosva"},"change_message_id":"314af9f5641bf0a4a84b31a5c13a9fb6888a7830","unresolved":false,"context_lines":[{"line_number":90,"context_line":"                }"},{"line_number":91,"context_line":"            elif resource \u003d\u003d trunk_consts.TRUNK:"},{"line_number":92,"context_line":"                payload \u003d payload.current_trunk"},{"line_number":93,"context_line":"                method \u003d {"},{"line_number":94,"context_line":"                    events.AFTER_CREATE: self._stub.trunk_created,"},{"line_number":95,"context_line":"                    events.AFTER_DELETE: self._stub.trunk_deleted,"},{"line_number":96,"context_line":"                }"}],"source_content_type":"text/x-python","patch_set":17,"id":"bacf61ea_2d85d206","line":93,"range":{"start_line":93,"start_character":16,"end_line":93,"end_character":22},"updated":"2016-08-03 15:37:54.000000000","message":"ditto","commit_id":"124d59e8a167663da2a5369bb5a684bfe1886bd5"},{"author":{"_account_id":16800,"name":"Rawlin Peters","email":"rawlin.peters@hpe.com","username":"rawlin"},"change_message_id":"36aa5b522e744bb27d5d663263865c198be00cce","unresolved":false,"context_lines":[{"line_number":45,"context_line":"                               event)"},{"line_number":46,"context_line":"        LOG.debug(\"RPC backend initialized for trunk plugin\")"},{"line_number":47,"context_line":""},{"line_number":48,"context_line":"    def is_agent_available_on_host(self, context, core_plugin,"},{"line_number":49,"context_line":"                                   supported_agent_types, host):"},{"line_number":50,"context_line":"        \"\"\"Return True if host is running any of the agent_types.\"\"\""},{"line_number":51,"context_line":"        if utils.is_extension_supported(core_plugin, \u0027agent\u0027):"}],"source_content_type":"text/x-python","patch_set":19,"id":"bacf61ea_8f2bfdea","line":48,"range":{"start_line":48,"start_character":8,"end_line":48,"end_character":34},"updated":"2016-08-04 00:02:52.000000000","message":"Maybe we can test this method and process_event() in a functional test that registers an OVS agent on the host? Similar to [1]?\n\n[1] https://review.openstack.org/#/c/343816/16/neutron/tests/functional/services/trunk/test_plugin.py","commit_id":"0add8405148c2df4b8ae49a885d75b49aff8bc98"},{"author":{"_account_id":16800,"name":"Rawlin Peters","email":"rawlin.peters@hpe.com","username":"rawlin"},"change_message_id":"36aa5b522e744bb27d5d663263865c198be00cce","unresolved":false,"context_lines":[{"line_number":48,"context_line":"    def is_agent_available_on_host(self, context, core_plugin,"},{"line_number":49,"context_line":"                                   supported_agent_types, host):"},{"line_number":50,"context_line":"        \"\"\"Return True if host is running any of the agent_types.\"\"\""},{"line_number":51,"context_line":"        if utils.is_extension_supported(core_plugin, \u0027agent\u0027):"},{"line_number":52,"context_line":"            agents \u003d core_plugin.get_agents("},{"line_number":53,"context_line":"                context.elevated(), filters\u003d{\u0027host\u0027: [host]})"},{"line_number":54,"context_line":"            agent_types \u003d set([a[\u0027agent_type\u0027] for a in agents])"}],"source_content_type":"text/x-python","patch_set":19,"id":"bacf61ea_4c4c7370","line":51,"range":{"start_line":51,"start_character":8,"end_line":51,"end_character":62},"updated":"2016-08-04 00:02:52.000000000","message":"nit: I find it easier to read if/else statements when the if/else are closer:\n\n if not utils.is_extension_supported(core_plugin, \u0027agent\u0027):\n     return False\n else:\n     ...","commit_id":"0add8405148c2df4b8ae49a885d75b49aff8bc98"},{"author":{"_account_id":16800,"name":"Rawlin Peters","email":"rawlin.peters@hpe.com","username":"rawlin"},"change_message_id":"36aa5b522e744bb27d5d663263865c198be00cce","unresolved":false,"context_lines":[{"line_number":51,"context_line":"        if utils.is_extension_supported(core_plugin, \u0027agent\u0027):"},{"line_number":52,"context_line":"            agents \u003d core_plugin.get_agents("},{"line_number":53,"context_line":"                context.elevated(), filters\u003d{\u0027host\u0027: [host]})"},{"line_number":54,"context_line":"            agent_types \u003d set([a[\u0027agent_type\u0027] for a in agents])"},{"line_number":55,"context_line":"            return bool(agent_types \u0026 supported_agent_types)"},{"line_number":56,"context_line":"        else:"},{"line_number":57,"context_line":"            return False"}],"source_content_type":"text/x-python","patch_set":19,"id":"bacf61ea_ec0e0731","line":54,"range":{"start_line":54,"start_character":26,"end_line":54,"end_character":64},"updated":"2016-08-04 00:02:52.000000000","message":"nit: you can use a set comprehension here:\n\n agent_types \u003d {a[\u0027agent_type\u0027] for a in agents}","commit_id":"0add8405148c2df4b8ae49a885d75b49aff8bc98"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"25035e83d657da26876d360b0d5fe876d962135d","unresolved":false,"context_lines":[{"line_number":45,"context_line":"                               event)"},{"line_number":46,"context_line":"        LOG.debug(\"RPC backend initialized for trunk plugin\")"},{"line_number":47,"context_line":""},{"line_number":48,"context_line":"    def is_agent_available_on_host(self, context, core_plugin,"},{"line_number":49,"context_line":"                                   supported_agent_types, host):"},{"line_number":50,"context_line":"        \"\"\"Return True if host is running any of the agent_types.\"\"\""},{"line_number":51,"context_line":"        if utils.is_extension_supported(core_plugin, \u0027agent\u0027):"},{"line_number":52,"context_line":"            agents \u003d core_plugin.get_agents("},{"line_number":53,"context_line":"                context.elevated(), filters\u003d{\u0027host\u0027: [host]})"},{"line_number":54,"context_line":"            agent_types \u003d set([a[\u0027agent_type\u0027] for a in agents])"},{"line_number":55,"context_line":"            return bool(agent_types \u0026 supported_agent_types)"},{"line_number":56,"context_line":"        else:"},{"line_number":57,"context_line":"            return False"},{"line_number":58,"context_line":""},{"line_number":59,"context_line":"    def process_event(self, resource, event, trunk_plugin, payload):"},{"line_number":60,"context_line":"        \"\"\"Send subports event to an agent only if required.\"\"\""}],"source_content_type":"text/x-python","patch_set":19,"id":"bacf61ea_9ecc9bbc","line":57,"range":{"start_line":48,"start_character":0,"end_line":57,"end_character":24},"updated":"2016-08-04 18:23:40.000000000","message":"btw, Kuba suggested in a previous PS to take this out of here. Since I may actually need it in a different patch I am putting together, we might want to take it out of this patch altogether. Bear with me while I work this out, I am trying to address Kevin\u0027s need [1]\n\n[1] https://review.openstack.org/#/c/346377/5/neutron/services/trunk/rules.py@77","commit_id":"0add8405148c2df4b8ae49a885d75b49aff8bc98"},{"author":{"_account_id":16800,"name":"Rawlin Peters","email":"rawlin.peters@hpe.com","username":"rawlin"},"change_message_id":"36aa5b522e744bb27d5d663263865c198be00cce","unresolved":false,"context_lines":[{"line_number":62,"context_line":"        context \u003d payload.context"},{"line_number":63,"context_line":"        trunk_parent \u003d core_plugin.get_port("},{"line_number":64,"context_line":"            context, payload.current_trunk.port_id)"},{"line_number":65,"context_line":"        vif_type \u003d trunk_parent.get(\u0027binding:vif_type\u0027)"},{"line_number":66,"context_line":"        binding_host \u003d trunk_parent.get(\u0027binding:host_id\u0027)"},{"line_number":67,"context_line":""},{"line_number":68,"context_line":"        # Check if the trunk is bound."},{"line_number":69,"context_line":"        trunk_is_bound \u003d bool(binding_host)"}],"source_content_type":"text/x-python","patch_set":19,"id":"bacf61ea_4cae3386","line":66,"range":{"start_line":65,"start_character":8,"end_line":66,"end_character":58},"updated":"2016-08-04 00:02:52.000000000","message":"constants from neutron.extensions.portbindings","commit_id":"0add8405148c2df4b8ae49a885d75b49aff8bc98"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"d3684f7f0e37681d2ce45fce1387f5a4094582ea","unresolved":false,"context_lines":[{"line_number":45,"context_line":"                               event)"},{"line_number":46,"context_line":"        LOG.debug(\"RPC backend initialized for trunk plugin\")"},{"line_number":47,"context_line":""},{"line_number":48,"context_line":"    def is_agent_available_on_host(self, context, core_plugin,"},{"line_number":49,"context_line":"                                   supported_agent_types, host):"},{"line_number":50,"context_line":"        \"\"\"Return True if host is running any of the agent_types.\"\"\""},{"line_number":51,"context_line":"        if utils.is_extension_supported(core_plugin, \u0027agent\u0027):"}],"source_content_type":"text/x-python","patch_set":22,"id":"9ad45d7e_9475ce99","line":48,"updated":"2016-08-09 19:48:24.000000000","message":"have a look at [1], perhaps the next method can be simplified a bit if you borrowed some of logic that comes from that patch.\n\n[1] https://review.openstack.org/#/c/351375/7/neutron/services/trunk/rules.py","commit_id":"e512d27a030f0c0ff23a52ab38d5ada83522413a"},{"author":{"_account_id":13770,"name":"Adolfo Duarte","email":"adduarte@redhat.com","username":"adolfoduarte"},"change_message_id":"35f902ed48596d527de2930b2fb9ebc8754bc481","unresolved":false,"context_lines":[{"line_number":45,"context_line":"                               event)"},{"line_number":46,"context_line":"        LOG.debug(\"RPC backend initialized for trunk plugin\")"},{"line_number":47,"context_line":""},{"line_number":48,"context_line":"    def is_agent_available_on_host(self, context, core_plugin,"},{"line_number":49,"context_line":"                                   supported_agent_types, host):"},{"line_number":50,"context_line":"        \"\"\"Return True if host is running any of the agent_types.\"\"\""},{"line_number":51,"context_line":"        if utils.is_extension_supported(core_plugin, \u0027agent\u0027):"}],"source_content_type":"text/x-python","patch_set":22,"id":"9ad45d7e_5f5dea13","line":48,"in_reply_to":"9ad45d7e_9475ce99","updated":"2016-08-10 22:48:52.000000000","message":"Will be addressed on PS 25\nDone","commit_id":"e512d27a030f0c0ff23a52ab38d5ada83522413a"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"891327523647e50470a1c37116c56870c0b361ee","unresolved":false,"context_lines":[{"line_number":56,"context_line":"        else:"},{"line_number":57,"context_line":"            return False"},{"line_number":58,"context_line":""},{"line_number":59,"context_line":"    def process_event(self, resource, event, trunk_plugin, payload):"},{"line_number":60,"context_line":"        \"\"\"Send subports event to an agent only if required.\"\"\""},{"line_number":61,"context_line":"        core_plugin \u003d manager.NeutronManager.get_plugin()"},{"line_number":62,"context_line":"        context \u003d payload.context"}],"source_content_type":"text/x-python","patch_set":22,"id":"9ad45d7e_2ca05bf4","line":59,"updated":"2016-08-08 20:54:05.000000000","message":"nit: I know I\u0027m really just nit-picking style here. So, feel free to ignore me. But, if I were to have my way with this method, I\u0027d create four different methods, one for each of the event / resource combinations. Then, I\u0027d create a fifth helper method essentially with L61 - L83. Call it like \"_rpc_notification_needed\" or something.\n\nIt probably has its own drawbacks, like a few extra lines of code but I like it because it avoids having too many code paths converge in to one method that has to de-multilplex them to do the right thing.","commit_id":"e512d27a030f0c0ff23a52ab38d5ada83522413a"},{"author":{"_account_id":13770,"name":"Adolfo Duarte","email":"adduarte@redhat.com","username":"adolfoduarte"},"change_message_id":"d0e9872bd37f395bb7f05117a6676025964af55c","unresolved":false,"context_lines":[{"line_number":56,"context_line":"        else:"},{"line_number":57,"context_line":"            return False"},{"line_number":58,"context_line":""},{"line_number":59,"context_line":"    def process_event(self, resource, event, trunk_plugin, payload):"},{"line_number":60,"context_line":"        \"\"\"Send subports event to an agent only if required.\"\"\""},{"line_number":61,"context_line":"        core_plugin \u003d manager.NeutronManager.get_plugin()"},{"line_number":62,"context_line":"        context \u003d payload.context"}],"source_content_type":"text/x-python","patch_set":22,"id":"9ad45d7e_cc46dabe","line":59,"in_reply_to":"9ad45d7e_2ca05bf4","updated":"2016-08-08 22:51:14.000000000","message":"I think the intent here is to add more methods in the future to accommodate other events.  in that case it is easier to add them by just putting them in the body of the method maps. \nBut if no more events are to be added later perhaps it would be best to split each event/method type into its own method here.","commit_id":"e512d27a030f0c0ff23a52ab38d5ada83522413a"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"3df55de40db90c7c13bb37897c89d5f12cdcad5c","unresolved":false,"context_lines":[{"line_number":56,"context_line":"        else:"},{"line_number":57,"context_line":"            return False"},{"line_number":58,"context_line":""},{"line_number":59,"context_line":"    def process_event(self, resource, event, trunk_plugin, payload):"},{"line_number":60,"context_line":"        \"\"\"Send subports event to an agent only if required.\"\"\""},{"line_number":61,"context_line":"        core_plugin \u003d manager.NeutronManager.get_plugin()"},{"line_number":62,"context_line":"        context \u003d payload.context"}],"source_content_type":"text/x-python","patch_set":22,"id":"9ad45d7e_76dcac12","line":59,"in_reply_to":"9ad45d7e_72420e40","updated":"2016-08-09 15:56:33.000000000","message":"Yes, sometimes we choose conciseness over readability; this method can perhaps be broken down into smaller units for easier testing but choosing one handler vs multiple handlers is probably best decided once we see this code in action and needs to evolve.","commit_id":"e512d27a030f0c0ff23a52ab38d5ada83522413a"},{"author":{"_account_id":13770,"name":"Adolfo Duarte","email":"adduarte@redhat.com","username":"adolfoduarte"},"change_message_id":"35f902ed48596d527de2930b2fb9ebc8754bc481","unresolved":false,"context_lines":[{"line_number":56,"context_line":"        else:"},{"line_number":57,"context_line":"            return False"},{"line_number":58,"context_line":""},{"line_number":59,"context_line":"    def process_event(self, resource, event, trunk_plugin, payload):"},{"line_number":60,"context_line":"        \"\"\"Send subports event to an agent only if required.\"\"\""},{"line_number":61,"context_line":"        core_plugin \u003d manager.NeutronManager.get_plugin()"},{"line_number":62,"context_line":"        context \u003d payload.context"}],"source_content_type":"text/x-python","patch_set":22,"id":"9ad45d7e_ffa2defa","line":59,"in_reply_to":"9ad45d7e_76dcac12","updated":"2016-08-10 22:48:52.000000000","message":"Done","commit_id":"e512d27a030f0c0ff23a52ab38d5ada83522413a"},{"author":{"_account_id":8788,"name":"Miguel Angel Ajo","email":"mangelajo@redhat.com","username":"mangelajo"},"change_message_id":"4cb6881b3a442d1c079995ac885539aa60318e1c","unresolved":false,"context_lines":[{"line_number":56,"context_line":"        else:"},{"line_number":57,"context_line":"            return False"},{"line_number":58,"context_line":""},{"line_number":59,"context_line":"    def process_event(self, resource, event, trunk_plugin, payload):"},{"line_number":60,"context_line":"        \"\"\"Send subports event to an agent only if required.\"\"\""},{"line_number":61,"context_line":"        core_plugin \u003d manager.NeutronManager.get_plugin()"},{"line_number":62,"context_line":"        context \u003d payload.context"}],"source_content_type":"text/x-python","patch_set":22,"id":"9ad45d7e_72420e40","line":59,"in_reply_to":"9ad45d7e_cc46dabe","updated":"2016-08-09 12:31:54.000000000","message":"I understand both \"sentiments\" ;) I guess that if the whole pattern is going to repeat a lot, and just the map will need to be modified, may be it\u0027s good as adolfo wrote it.","commit_id":"e512d27a030f0c0ff23a52ab38d5ada83522413a"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"891327523647e50470a1c37116c56870c0b361ee","unresolved":false,"context_lines":[{"line_number":66,"context_line":"        binding_host \u003d trunk_parent.get(\u0027binding:host_id\u0027)"},{"line_number":67,"context_line":""},{"line_number":68,"context_line":"        # Check if the trunk is bound."},{"line_number":69,"context_line":"        trunk_is_bound \u003d bool(binding_host)"},{"line_number":70,"context_line":""},{"line_number":71,"context_line":"        # Check if the host is running an agent whose type is advertised as a"},{"line_number":72,"context_line":"        # supported one."}],"source_content_type":"text/x-python","patch_set":22,"id":"9ad45d7e_29a04df4","line":69,"updated":"2016-08-08 20:54:05.000000000","message":"nit: Consider just returning if not trunk_is_bound. It might simplify some of the rest.","commit_id":"e512d27a030f0c0ff23a52ab38d5ada83522413a"},{"author":{"_account_id":13770,"name":"Adolfo Duarte","email":"adduarte@redhat.com","username":"adolfoduarte"},"change_message_id":"d0e9872bd37f395bb7f05117a6676025964af55c","unresolved":false,"context_lines":[{"line_number":66,"context_line":"        binding_host \u003d trunk_parent.get(\u0027binding:host_id\u0027)"},{"line_number":67,"context_line":""},{"line_number":68,"context_line":"        # Check if the trunk is bound."},{"line_number":69,"context_line":"        trunk_is_bound \u003d bool(binding_host)"},{"line_number":70,"context_line":""},{"line_number":71,"context_line":"        # Check if the host is running an agent whose type is advertised as a"},{"line_number":72,"context_line":"        # supported one."}],"source_content_type":"text/x-python","patch_set":22,"id":"9ad45d7e_0c1752a4","line":69,"in_reply_to":"9ad45d7e_29a04df4","updated":"2016-08-08 22:51:14.000000000","message":"Done","commit_id":"e512d27a030f0c0ff23a52ab38d5ada83522413a"},{"author":{"_account_id":6788,"name":"Rossella Sblendido","email":"rsblendido@suse.com","username":"rossella-o"},"change_message_id":"61559e4830fa9307accebfc0883388497606b1e6","unresolved":false,"context_lines":[{"line_number":68,"context_line":"        # Check if the trunk is bound."},{"line_number":69,"context_line":"        trunk_is_bound \u003d bool(binding_host)"},{"line_number":70,"context_line":""},{"line_number":71,"context_line":"        # Check if the host is running an agent whose type is advertised as a"},{"line_number":72,"context_line":"        # supported one."},{"line_number":73,"context_line":"        compatible_agent_exists \u003d (trunk_is_bound and"},{"line_number":74,"context_line":"            self.is_agent_available_on_host("}],"source_content_type":"text/x-python","patch_set":22,"id":"9ad45d7e_f00c2496","line":71,"updated":"2016-08-09 15:37:26.000000000","message":"do we need this check and the next one if the event is AFTER_DELETE? I don\u0027t think so","commit_id":"e512d27a030f0c0ff23a52ab38d5ada83522413a"},{"author":{"_account_id":13770,"name":"Adolfo Duarte","email":"adduarte@redhat.com","username":"adolfoduarte"},"change_message_id":"35f902ed48596d527de2930b2fb9ebc8754bc481","unresolved":false,"context_lines":[{"line_number":68,"context_line":"        # Check if the trunk is bound."},{"line_number":69,"context_line":"        trunk_is_bound \u003d bool(binding_host)"},{"line_number":70,"context_line":""},{"line_number":71,"context_line":"        # Check if the host is running an agent whose type is advertised as a"},{"line_number":72,"context_line":"        # supported one."},{"line_number":73,"context_line":"        compatible_agent_exists \u003d (trunk_is_bound and"},{"line_number":74,"context_line":"            self.is_agent_available_on_host("}],"source_content_type":"text/x-python","patch_set":22,"id":"9ad45d7e_3fb11648","line":71,"in_reply_to":"9ad45d7e_c5b832e8","updated":"2016-08-10 22:48:52.000000000","message":"Done","commit_id":"e512d27a030f0c0ff23a52ab38d5ada83522413a"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"d8d69d9bc7c58d2e3745c23e1b64302629424c55","unresolved":false,"context_lines":[{"line_number":68,"context_line":"        # Check if the trunk is bound."},{"line_number":69,"context_line":"        trunk_is_bound \u003d bool(binding_host)"},{"line_number":70,"context_line":""},{"line_number":71,"context_line":"        # Check if the host is running an agent whose type is advertised as a"},{"line_number":72,"context_line":"        # supported one."},{"line_number":73,"context_line":"        compatible_agent_exists \u003d (trunk_is_bound and"},{"line_number":74,"context_line":"            self.is_agent_available_on_host("}],"source_content_type":"text/x-python","patch_set":22,"id":"9ad45d7e_c5b832e8","line":71,"in_reply_to":"9ad45d7e_f00c2496","updated":"2016-08-09 21:16:07.000000000","message":"Yes, we do: all checks are here to confirm that indeed a notification must be sent out.","commit_id":"e512d27a030f0c0ff23a52ab38d5ada83522413a"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"891327523647e50470a1c37116c56870c0b361ee","unresolved":false,"context_lines":[{"line_number":83,"context_line":"        if trunk_is_bound and compatible_agent_exists and compatible_vif_type:"},{"line_number":84,"context_line":"            LOG.debug(\"RPC notification needed for trunk %s\", payload.trunk_id)"},{"line_number":85,"context_line":"            if resource \u003d\u003d trunk_consts.SUBPORTS:"},{"line_number":86,"context_line":"                payload \u003d payload.subports"},{"line_number":87,"context_line":"                method \u003d {"},{"line_number":88,"context_line":"                    events.AFTER_CREATE: self._stub.add_subports,"},{"line_number":89,"context_line":"                    events.AFTER_DELETE: self._stub.delete_subports,"},{"line_number":90,"context_line":"                }"},{"line_number":91,"context_line":"            elif resource \u003d\u003d trunk_consts.TRUNK:"},{"line_number":92,"context_line":"                payload \u003d payload.current_trunk"},{"line_number":93,"context_line":"                method \u003d {"}],"source_content_type":"text/x-python","patch_set":22,"id":"9ad45d7e_a986fdb6","line":90,"range":{"start_line":86,"start_character":16,"end_line":90,"end_character":17},"updated":"2016-08-08 20:54:05.000000000","message":"nit: Doesn\u0027t this look more straight-forward:\n\n  if event \u003d\u003d events.AFTER_CREATE:\n      self._stub.add_subports(context, payload.subports)\n  elif event \u003d\u003d events.AFTER_DELETE:\n      self._stub.delete_subports(context, payload.subports)\n\nI guess with your version, you get a KeyError on L98 if event isn\u0027t right and in mine, it is silent. But, you could check that explicitly above in a more readable way. Just seems like extra indirection when I prefer straight-forward code.\n\nThis is fine, I just like to discourage gratuitous use of complex coding patterns. :)","commit_id":"e512d27a030f0c0ff23a52ab38d5ada83522413a"},{"author":{"_account_id":13770,"name":"Adolfo Duarte","email":"adduarte@redhat.com","username":"adolfoduarte"},"change_message_id":"35f902ed48596d527de2930b2fb9ebc8754bc481","unresolved":false,"context_lines":[{"line_number":83,"context_line":"        if trunk_is_bound and compatible_agent_exists and compatible_vif_type:"},{"line_number":84,"context_line":"            LOG.debug(\"RPC notification needed for trunk %s\", payload.trunk_id)"},{"line_number":85,"context_line":"            if resource \u003d\u003d trunk_consts.SUBPORTS:"},{"line_number":86,"context_line":"                payload \u003d payload.subports"},{"line_number":87,"context_line":"                method \u003d {"},{"line_number":88,"context_line":"                    events.AFTER_CREATE: self._stub.add_subports,"},{"line_number":89,"context_line":"                    events.AFTER_DELETE: self._stub.delete_subports,"},{"line_number":90,"context_line":"                }"},{"line_number":91,"context_line":"            elif resource \u003d\u003d trunk_consts.TRUNK:"},{"line_number":92,"context_line":"                payload \u003d payload.current_trunk"},{"line_number":93,"context_line":"                method \u003d {"}],"source_content_type":"text/x-python","patch_set":22,"id":"9ad45d7e_1faed2e5","line":90,"range":{"start_line":86,"start_character":16,"end_line":90,"end_character":17},"in_reply_to":"9ad45d7e_8c2222b8","updated":"2016-08-10 22:48:52.000000000","message":"Done","commit_id":"e512d27a030f0c0ff23a52ab38d5ada83522413a"},{"author":{"_account_id":13770,"name":"Adolfo Duarte","email":"adduarte@redhat.com","username":"adolfoduarte"},"change_message_id":"d0e9872bd37f395bb7f05117a6676025964af55c","unresolved":false,"context_lines":[{"line_number":83,"context_line":"        if trunk_is_bound and compatible_agent_exists and compatible_vif_type:"},{"line_number":84,"context_line":"            LOG.debug(\"RPC notification needed for trunk %s\", payload.trunk_id)"},{"line_number":85,"context_line":"            if resource \u003d\u003d trunk_consts.SUBPORTS:"},{"line_number":86,"context_line":"                payload \u003d payload.subports"},{"line_number":87,"context_line":"                method \u003d {"},{"line_number":88,"context_line":"                    events.AFTER_CREATE: self._stub.add_subports,"},{"line_number":89,"context_line":"                    events.AFTER_DELETE: self._stub.delete_subports,"},{"line_number":90,"context_line":"                }"},{"line_number":91,"context_line":"            elif resource \u003d\u003d trunk_consts.TRUNK:"},{"line_number":92,"context_line":"                payload \u003d payload.current_trunk"},{"line_number":93,"context_line":"                method \u003d {"}],"source_content_type":"text/x-python","patch_set":22,"id":"9ad45d7e_8c2222b8","line":90,"range":{"start_line":86,"start_character":16,"end_line":90,"end_character":17},"in_reply_to":"9ad45d7e_a986fdb6","updated":"2016-08-08 22:51:14.000000000","message":"agree that it would look cleaner that way, however there are more event/methods to come once this patch lands, and it will be easier to just add them to map.","commit_id":"e512d27a030f0c0ff23a52ab38d5ada83522413a"},{"author":{"_account_id":4187,"name":"Ryan Tidwell","email":"rtidwell@suse.com","username":"ryan-tidwell"},"change_message_id":"d321af7dc0e9c4699c07b10bac84c16afa9bad81","unresolved":false,"context_lines":[{"line_number":45,"context_line":"                               event)"},{"line_number":46,"context_line":"        LOG.debug(\"RPC backend initialized for trunk plugin\")"},{"line_number":47,"context_line":""},{"line_number":48,"context_line":"    def is_agent_available_on_host(self, context, core_plugin,"},{"line_number":49,"context_line":"                                   supported_agent_types, host):"},{"line_number":50,"context_line":"        \"\"\"Return True if host is running any of the agent_types.\"\"\""},{"line_number":51,"context_line":"        if utils.is_extension_supported(core_plugin, \u0027agent\u0027):"}],"source_content_type":"text/x-python","patch_set":23,"id":"9ad45d7e_5796a6f0","line":48,"updated":"2016-08-10 06:44:27.000000000","message":"nit: seems like this could be peeled out into a common utility, doesn\u0027t seem trunk-specific to me. I wouldn\u0027t hold this patch up over it though.","commit_id":"028a0035130483ceb21ac50e747db1f3e343092d"},{"author":{"_account_id":13770,"name":"Adolfo Duarte","email":"adduarte@redhat.com","username":"adolfoduarte"},"change_message_id":"e9716fc28a847df6e8d857cab7483c7eede1c1db","unresolved":false,"context_lines":[{"line_number":45,"context_line":"                               event)"},{"line_number":46,"context_line":"        LOG.debug(\"RPC backend initialized for trunk plugin\")"},{"line_number":47,"context_line":""},{"line_number":48,"context_line":"    def is_agent_available_on_host(self, context, core_plugin,"},{"line_number":49,"context_line":"                                   supported_agent_types, host):"},{"line_number":50,"context_line":"        \"\"\"Return True if host is running any of the agent_types.\"\"\""},{"line_number":51,"context_line":"        if utils.is_extension_supported(core_plugin, \u0027agent\u0027):"}],"source_content_type":"text/x-python","patch_set":23,"id":"9ad45d7e_bfea260d","line":48,"in_reply_to":"9ad45d7e_5796a6f0","updated":"2016-08-10 22:50:24.000000000","message":"Yes. This will be addressed on PS25\nDone","commit_id":"028a0035130483ceb21ac50e747db1f3e343092d"},{"author":{"_account_id":4187,"name":"Ryan Tidwell","email":"rtidwell@suse.com","username":"ryan-tidwell"},"change_message_id":"383aaf8a7f4af441b1e7d6cf7fb4a81d8592c79d","unresolved":false,"context_lines":[{"line_number":73,"context_line":"                                       trunk_plugin.supported_agent_types,"},{"line_number":74,"context_line":"                                       binding_host))"},{"line_number":75,"context_line":"        if not compatible_agent_exists:"},{"line_number":76,"context_line":"            return"},{"line_number":77,"context_line":""},{"line_number":78,"context_line":"        # Check if the vif_type associated to the trunk is compatible with an"},{"line_number":79,"context_line":"        # advertised vif type."}],"source_content_type":"text/x-python","patch_set":23,"id":"9ad45d7e_d77d761d","line":76,"updated":"2016-08-10 06:34:37.000000000","message":"nit: is this a situation where debug logging might come in handy?","commit_id":"028a0035130483ceb21ac50e747db1f3e343092d"},{"author":{"_account_id":13770,"name":"Adolfo Duarte","email":"adduarte@redhat.com","username":"adolfoduarte"},"change_message_id":"e9716fc28a847df6e8d857cab7483c7eede1c1db","unresolved":false,"context_lines":[{"line_number":73,"context_line":"                                       trunk_plugin.supported_agent_types,"},{"line_number":74,"context_line":"                                       binding_host))"},{"line_number":75,"context_line":"        if not compatible_agent_exists:"},{"line_number":76,"context_line":"            return"},{"line_number":77,"context_line":""},{"line_number":78,"context_line":"        # Check if the vif_type associated to the trunk is compatible with an"},{"line_number":79,"context_line":"        # advertised vif type."}],"source_content_type":"text/x-python","patch_set":23,"id":"9ad45d7e_9fef621d","line":76,"in_reply_to":"9ad45d7e_92d2ecd0","updated":"2016-08-10 22:50:24.000000000","message":"Done","commit_id":"028a0035130483ceb21ac50e747db1f3e343092d"},{"author":{"_account_id":13770,"name":"Adolfo Duarte","email":"adduarte@redhat.com","username":"adolfoduarte"},"change_message_id":"581e7109cc0b8e6fe486ad7ebed85d0d7996132d","unresolved":false,"context_lines":[{"line_number":73,"context_line":"                                       trunk_plugin.supported_agent_types,"},{"line_number":74,"context_line":"                                       binding_host))"},{"line_number":75,"context_line":"        if not compatible_agent_exists:"},{"line_number":76,"context_line":"            return"},{"line_number":77,"context_line":""},{"line_number":78,"context_line":"        # Check if the vif_type associated to the trunk is compatible with an"},{"line_number":79,"context_line":"        # advertised vif type."}],"source_content_type":"text/x-python","patch_set":23,"id":"9ad45d7e_92d2ecd0","line":76,"in_reply_to":"9ad45d7e_d77d761d","updated":"2016-08-10 07:19:46.000000000","message":"This could actually fail for two reasons. no binding_host or no compatible agent. To log it correctly we would have to split the code to be able to determine the correct reason.","commit_id":"028a0035130483ceb21ac50e747db1f3e343092d"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"44deb1d4377c78d95b5815cab048666cc768e745","unresolved":false,"context_lines":[{"line_number":45,"context_line":"                               event)"},{"line_number":46,"context_line":"        LOG.debug(\"RPC backend initialized for trunk plugin\")"},{"line_number":47,"context_line":""},{"line_number":48,"context_line":"    def is_agent_available_on_host(self, context, core_plugin,"},{"line_number":49,"context_line":"                                   supported_agent_types, host):"},{"line_number":50,"context_line":"        \"\"\"Return True if host is running any of the agent_types.\"\"\""},{"line_number":51,"context_line":"        if utils.is_extension_supported(core_plugin, \u0027agent\u0027):"}],"source_content_type":"text/x-python","patch_set":24,"id":"9ad45d7e_08206c47","line":48,"updated":"2016-08-10 17:38:56.000000000","message":"I think this can be removed and you can use [1] instead:\n\nhttps://review.openstack.org/#/c/351375/9/neutron/services/trunk/utils.py@27","commit_id":"b5a5684dcafed2ed1da5d8fe25434f09fe0edf81"},{"author":{"_account_id":13770,"name":"Adolfo Duarte","email":"adduarte@redhat.com","username":"adolfoduarte"},"change_message_id":"ebc41b82734d2b5898f7f92534b0bfb33eb81314","unresolved":false,"context_lines":[{"line_number":45,"context_line":"                               event)"},{"line_number":46,"context_line":"        LOG.debug(\"RPC backend initialized for trunk plugin\")"},{"line_number":47,"context_line":""},{"line_number":48,"context_line":"    def is_agent_available_on_host(self, context, core_plugin,"},{"line_number":49,"context_line":"                                   supported_agent_types, host):"},{"line_number":50,"context_line":"        \"\"\"Return True if host is running any of the agent_types.\"\"\""},{"line_number":51,"context_line":"        if utils.is_extension_supported(core_plugin, \u0027agent\u0027):"}],"source_content_type":"text/x-python","patch_set":24,"id":"9ad45d7e_ffc77e95","line":48,"in_reply_to":"9ad45d7e_08206c47","updated":"2016-08-10 23:38:58.000000000","message":"Rebased on [1] as suggested. and use the function from there instead.","commit_id":"b5a5684dcafed2ed1da5d8fe25434f09fe0edf81"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"44deb1d4377c78d95b5815cab048666cc768e745","unresolved":false,"context_lines":[{"line_number":67,"context_line":""},{"line_number":68,"context_line":"        # Check if the trunk is bound, and if the host is running an agent"},{"line_number":69,"context_line":"        # whose type is advertised as a supported one."},{"line_number":70,"context_line":"        compatible_agent_exists \u003d (bool(binding_host) and"},{"line_number":71,"context_line":"                                   self.is_agent_available_on_host("},{"line_number":72,"context_line":"                                       context, core_plugin,"},{"line_number":73,"context_line":"                                       trunk_plugin.supported_agent_types,"}],"source_content_type":"text/x-python","patch_set":24,"id":"9ad45d7e_087cec1d","line":70,"updated":"2016-08-10 17:38:56.000000000","message":"If followed suggestion on line 52 this can become:\n\ncompatible_agent_exists \u003d (bool(binding_host) and \n  are_agent_types_available_on_host(context,\n    trunk_plugin.supported_agent_types,\n    binding_host))\n\nGranted the method calls again \n\ncore_plugin \u003d manager.NeutronManager.get_plugin()\n\nbut that is freaky cheap and because of that I\u0027d rather have a slimmer signature to deal with than carry baggage around.","commit_id":"b5a5684dcafed2ed1da5d8fe25434f09fe0edf81"},{"author":{"_account_id":13770,"name":"Adolfo Duarte","email":"adduarte@redhat.com","username":"adolfoduarte"},"change_message_id":"ebc41b82734d2b5898f7f92534b0bfb33eb81314","unresolved":false,"context_lines":[{"line_number":67,"context_line":""},{"line_number":68,"context_line":"        # Check if the trunk is bound, and if the host is running an agent"},{"line_number":69,"context_line":"        # whose type is advertised as a supported one."},{"line_number":70,"context_line":"        compatible_agent_exists \u003d (bool(binding_host) and"},{"line_number":71,"context_line":"                                   self.is_agent_available_on_host("},{"line_number":72,"context_line":"                                       context, core_plugin,"},{"line_number":73,"context_line":"                                       trunk_plugin.supported_agent_types,"}],"source_content_type":"text/x-python","patch_set":24,"id":"9ad45d7e_1f71b276","line":70,"in_reply_to":"9ad45d7e_087cec1d","updated":"2016-08-10 23:38:58.000000000","message":"Done","commit_id":"b5a5684dcafed2ed1da5d8fe25434f09fe0edf81"},{"author":{"_account_id":7787,"name":"Kevin Benton","email":"kevin@benton.pub","username":"blak111"},"change_message_id":"93d3147697453ce086416dec293a91164656b746","unresolved":false,"context_lines":[{"line_number":46,"context_line":"        LOG.debug(\"RPC backend initialized for trunk plugin\")"},{"line_number":47,"context_line":""},{"line_number":48,"context_line":"    def process_event(self, resource, event, trunk_plugin, payload):"},{"line_number":49,"context_line":"        \"\"\"Send subports event to an agent only if required.\"\"\""},{"line_number":50,"context_line":"        core_plugin \u003d manager.NeutronManager.get_plugin()"},{"line_number":51,"context_line":"        context \u003d payload.context"},{"line_number":52,"context_line":"        trunk_parent \u003d core_plugin.get_port("}],"source_content_type":"text/x-python","patch_set":26,"id":"9ad45d7e_10b2fce4","line":49,"updated":"2016-08-12 00:52:26.000000000","message":"IMO the RPC callback system is meant to be a pub/sub system. As the publisher of the event, we shouldn\u0027t attempt to decide up front if someone is interested in Trunks/Subports. We should just unconditionally send them to RPC notification system which will determine the correct version and send it out. If there are no subscribers the backend will just drop it.\n\nYes, this incurs an overhead for Trunks delivered to agents that will ultimately ignore it because it doesn\u0027t belong to them, but IMO it\u0027s worth the reduction in complexity and the adherence to callback semantics.","commit_id":"31a4a66dcae0698e91640bc5eaf110425e304371"},{"author":{"_account_id":16800,"name":"Rawlin Peters","email":"rawlin.peters@hpe.com","username":"rawlin"},"change_message_id":"656f7d12839364efe165598acb3957576cc945b7","unresolved":false,"context_lines":[{"line_number":46,"context_line":"        LOG.debug(\"RPC backend initialized for trunk plugin\")"},{"line_number":47,"context_line":""},{"line_number":48,"context_line":"    def process_event(self, resource, event, trunk_plugin, payload):"},{"line_number":49,"context_line":"        \"\"\"Send subports event to an agent only if required.\"\"\""},{"line_number":50,"context_line":"        core_plugin \u003d manager.NeutronManager.get_plugin()"},{"line_number":51,"context_line":"        context \u003d payload.context"},{"line_number":52,"context_line":"        trunk_parent \u003d core_plugin.get_port("}],"source_content_type":"text/x-python","patch_set":26,"id":"9ad45d7e_67ae292f","line":49,"range":{"start_line":49,"start_character":16,"end_line":49,"end_character":24},"updated":"2016-08-11 22:13:24.000000000","message":"This handles both trunk and subport events, so perhaps this should just be \"trunk\"","commit_id":"31a4a66dcae0698e91640bc5eaf110425e304371"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"e45fb0638bf3b4ebaadde7077f124b5f50e5c804","unresolved":false,"context_lines":[{"line_number":46,"context_line":"        LOG.debug(\"RPC backend initialized for trunk plugin\")"},{"line_number":47,"context_line":""},{"line_number":48,"context_line":"    def process_event(self, resource, event, trunk_plugin, payload):"},{"line_number":49,"context_line":"        \"\"\"Send subports event to an agent only if required.\"\"\""},{"line_number":50,"context_line":"        core_plugin \u003d manager.NeutronManager.get_plugin()"},{"line_number":51,"context_line":"        context \u003d payload.context"},{"line_number":52,"context_line":"        trunk_parent \u003d core_plugin.get_port("}],"source_content_type":"text/x-python","patch_set":26,"id":"9ad45d7e_d32b4e80","line":49,"in_reply_to":"9ad45d7e_10b2fce4","updated":"2016-08-12 01:06:52.000000000","message":"See if comment on line 63 makes sense to you. I tend to agree that this block can be simplified further, but I wonder if we can strike a better balance between efficiency and simplicity by at least skipping notifications on invalid vif types.","commit_id":"31a4a66dcae0698e91640bc5eaf110425e304371"},{"author":{"_account_id":13770,"name":"Adolfo Duarte","email":"adduarte@redhat.com","username":"adolfoduarte"},"change_message_id":"8e5d9264debee026def7e7fd88c0530efbda9e67","unresolved":false,"context_lines":[{"line_number":46,"context_line":"        LOG.debug(\"RPC backend initialized for trunk plugin\")"},{"line_number":47,"context_line":""},{"line_number":48,"context_line":"    def process_event(self, resource, event, trunk_plugin, payload):"},{"line_number":49,"context_line":"        \"\"\"Send subports event to an agent only if required.\"\"\""},{"line_number":50,"context_line":"        core_plugin \u003d manager.NeutronManager.get_plugin()"},{"line_number":51,"context_line":"        context \u003d payload.context"},{"line_number":52,"context_line":"        trunk_parent \u003d core_plugin.get_port("}],"source_content_type":"text/x-python","patch_set":26,"id":"9ad45d7e_f2c45a60","line":49,"in_reply_to":"9ad45d7e_d32b4e80","updated":"2016-08-12 19:01:07.000000000","message":"will remove \"subports\" from docstring","commit_id":"31a4a66dcae0698e91640bc5eaf110425e304371"},{"author":{"_account_id":16800,"name":"Rawlin Peters","email":"rawlin.peters@hpe.com","username":"rawlin"},"change_message_id":"656f7d12839364efe165598acb3957576cc945b7","unresolved":false,"context_lines":[{"line_number":51,"context_line":"        context \u003d payload.context"},{"line_number":52,"context_line":"        trunk_parent \u003d core_plugin.get_port("},{"line_number":53,"context_line":"            context, payload.current_trunk.port_id)"},{"line_number":54,"context_line":"        vif_type \u003d trunk_parent.get(\u0027binding:vif_type\u0027)"},{"line_number":55,"context_line":"        binding_host \u003d trunk_parent.get(\u0027binding:host_id\u0027)"},{"line_number":56,"context_line":""},{"line_number":57,"context_line":"        # Check if the trunk is bound, and if the host is running an agent"},{"line_number":58,"context_line":"        # whose type is advertised as a supported one."}],"source_content_type":"text/x-python","patch_set":26,"id":"9ad45d7e_479e8507","line":55,"range":{"start_line":54,"start_character":36,"end_line":55,"end_character":57},"updated":"2016-08-11 22:13:24.000000000","message":"these constants can be found in neutron.extensions.portbindings","commit_id":"31a4a66dcae0698e91640bc5eaf110425e304371"},{"author":{"_account_id":13770,"name":"Adolfo Duarte","email":"adduarte@redhat.com","username":"adolfoduarte"},"change_message_id":"8e5d9264debee026def7e7fd88c0530efbda9e67","unresolved":false,"context_lines":[{"line_number":51,"context_line":"        context \u003d payload.context"},{"line_number":52,"context_line":"        trunk_parent \u003d core_plugin.get_port("},{"line_number":53,"context_line":"            context, payload.current_trunk.port_id)"},{"line_number":54,"context_line":"        vif_type \u003d trunk_parent.get(\u0027binding:vif_type\u0027)"},{"line_number":55,"context_line":"        binding_host \u003d trunk_parent.get(\u0027binding:host_id\u0027)"},{"line_number":56,"context_line":""},{"line_number":57,"context_line":"        # Check if the trunk is bound, and if the host is running an agent"},{"line_number":58,"context_line":"        # whose type is advertised as a supported one."}],"source_content_type":"text/x-python","patch_set":26,"id":"9ad45d7e_d7c9485c","line":55,"range":{"start_line":54,"start_character":36,"end_line":55,"end_character":57},"in_reply_to":"9ad45d7e_479e8507","updated":"2016-08-12 19:01:07.000000000","message":"see comment below about condition on L65 and condition on L77 since those are being removed we don\u0027t need these anymore. \nwill remove.\nDONE","commit_id":"31a4a66dcae0698e91640bc5eaf110425e304371"},{"author":{"_account_id":16800,"name":"Rawlin Peters","email":"rawlin.peters@hpe.com","username":"rawlin"},"change_message_id":"656f7d12839364efe165598acb3957576cc945b7","unresolved":false,"context_lines":[{"line_number":56,"context_line":""},{"line_number":57,"context_line":"        # Check if the trunk is bound, and if the host is running an agent"},{"line_number":58,"context_line":"        # whose type is advertised as a supported one."},{"line_number":59,"context_line":"        compatible_agent_exists \u003d (bool(binding_host) and"},{"line_number":60,"context_line":"                                   self.is_agent_available_on_host("},{"line_number":61,"context_line":"                                       context, core_plugin,"},{"line_number":62,"context_line":"                                       trunk_plugin.supported_agent_types,"},{"line_number":63,"context_line":"                                       binding_host))"},{"line_number":64,"context_line":""},{"line_number":65,"context_line":"        compatible_agent_exists \u003d ("},{"line_number":66,"context_line":"            bool(binding_host) and"}],"source_content_type":"text/x-python","patch_set":26,"id":"9ad45d7e_a7002103","line":63,"range":{"start_line":59,"start_character":8,"end_line":63,"end_character":53},"updated":"2016-08-11 22:13:24.000000000","message":"This is unneeded now, right?","commit_id":"31a4a66dcae0698e91640bc5eaf110425e304371"},{"author":{"_account_id":16800,"name":"Rawlin Peters","email":"rawlin.peters@hpe.com","username":"rawlin"},"change_message_id":"16ef1c835aca75da7f206a59d8f1b12a0a0e8264","unresolved":false,"context_lines":[{"line_number":56,"context_line":""},{"line_number":57,"context_line":"        # Check if the trunk is bound, and if the host is running an agent"},{"line_number":58,"context_line":"        # whose type is advertised as a supported one."},{"line_number":59,"context_line":"        compatible_agent_exists \u003d (bool(binding_host) and"},{"line_number":60,"context_line":"                                   self.is_agent_available_on_host("},{"line_number":61,"context_line":"                                       context, core_plugin,"},{"line_number":62,"context_line":"                                       trunk_plugin.supported_agent_types,"},{"line_number":63,"context_line":"                                       binding_host))"},{"line_number":64,"context_line":""},{"line_number":65,"context_line":"        compatible_agent_exists \u003d ("},{"line_number":66,"context_line":"            bool(binding_host) and"}],"source_content_type":"text/x-python","patch_set":26,"id":"9ad45d7e_cca9c426","line":63,"range":{"start_line":59,"start_character":8,"end_line":63,"end_character":53},"in_reply_to":"9ad45d7e_5b346c49","updated":"2016-08-12 17:15:37.000000000","message":"\u003e For the agent to start the binding of the trunk, it means the parent port is already bound\n\n+1 that\u0027s correct I believe. Nova won\u0027t create the trunk bridge until it gets the results of updating the parent port\u0027s binding, so by the time the agent requests the trunk details, the parent port will already be bound.\n\n\u003e Can you elaborate?\n\nI meant that the check on line 65 was meant to replace the check on L59 because self.is_agent_available_on_host was replaced by utils.are_agent_types_available_on_host [1]. So we should remove L59-L63 and possibly keep L65-73. I think that was an oversight.\n\nAs for keeping L65-73 and 77 vs dropping them, the check at 77 doesn\u0027t seem to add any extra DB overhead while at the same time preventing some unnecessary notifications. L65-73 adds a DB call to prevent an unnecessary RPC notification.\n\nSo, I\u0027d vote to keep L77, but I\u0027m not sure if an extra DB call or an unnecessary RPC notification is worse (in terms of L65-73). I\u0027d think it would be the unnecessary RPC notification IMO just because it seems like rabbitmq is most likely to fall on its face at large scale, but this check might just be a premature optimization anyway.\n\n[1] https://review.openstack.org/#/c/347662/24/neutron/services/trunk/rpc/backend.py@48","commit_id":"31a4a66dcae0698e91640bc5eaf110425e304371"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"4bbdaa412368116f7fb2b2c2f3c65245be3e16f4","unresolved":false,"context_lines":[{"line_number":56,"context_line":""},{"line_number":57,"context_line":"        # Check if the trunk is bound, and if the host is running an agent"},{"line_number":58,"context_line":"        # whose type is advertised as a supported one."},{"line_number":59,"context_line":"        compatible_agent_exists \u003d (bool(binding_host) and"},{"line_number":60,"context_line":"                                   self.is_agent_available_on_host("},{"line_number":61,"context_line":"                                       context, core_plugin,"},{"line_number":62,"context_line":"                                       trunk_plugin.supported_agent_types,"},{"line_number":63,"context_line":"                                       binding_host))"},{"line_number":64,"context_line":""},{"line_number":65,"context_line":"        compatible_agent_exists \u003d ("},{"line_number":66,"context_line":"            bool(binding_host) and"}],"source_content_type":"text/x-python","patch_set":26,"id":"9ad45d7e_5b346c49","line":63,"range":{"start_line":59,"start_character":8,"end_line":63,"end_character":53},"in_reply_to":"9ad45d7e_70540121","updated":"2016-08-12 15:54:06.000000000","message":"For the agent to start the binding of the trunk, it means the parent port is already bound, it can\u0027t happen otherwise as the VM has booted!\n\nEither way, if we want to drop 77, we can always add it later.","commit_id":"31a4a66dcae0698e91640bc5eaf110425e304371"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"9eeb0415b2c29b7e28944da2564baeb5f10a32ae","unresolved":false,"context_lines":[{"line_number":56,"context_line":""},{"line_number":57,"context_line":"        # Check if the trunk is bound, and if the host is running an agent"},{"line_number":58,"context_line":"        # whose type is advertised as a supported one."},{"line_number":59,"context_line":"        compatible_agent_exists \u003d (bool(binding_host) and"},{"line_number":60,"context_line":"                                   self.is_agent_available_on_host("},{"line_number":61,"context_line":"                                       context, core_plugin,"},{"line_number":62,"context_line":"                                       trunk_plugin.supported_agent_types,"},{"line_number":63,"context_line":"                                       binding_host))"},{"line_number":64,"context_line":""},{"line_number":65,"context_line":"        compatible_agent_exists \u003d ("},{"line_number":66,"context_line":"            bool(binding_host) and"}],"source_content_type":"text/x-python","patch_set":26,"id":"9ad45d7e_c99284f5","line":63,"range":{"start_line":59,"start_character":8,"end_line":63,"end_character":53},"in_reply_to":"9ad45d7e_a7002103","updated":"2016-08-12 01:01:47.000000000","message":"Can you elaborate?\n\nI believe there were a couple of reasons why these conditionals were introduced, let me make sure I recall correctly:\n\na) If the trunk is not currently physically bound, emitting a notification unconditionally may be wasteful, as no RPC listener (ie. agent) can do anything about the event, which in turn must be discarded.\nb) in multi-drivers deployments, with agentless and agent based drivers , if the trunk is bound, emitting a notification unconditionally may be wasteful as the trunk event is not really meant to be processed by one driver but another.\n\nNow Rossella\u0027s point on PS22 got me thinking...the fact we\u0027re using RPC pushes, which are fanout based, means that we don\u0027t really care/know who might be listening on the other side of the message bus. In other words, if there are no subscribers the message hits the exchange and it dies there. That might be not too bad in case of 2), and therefore it should be safe dropping the compatible_agent_exists condition altogether. Besides, this might end up being racy if the binding host is cleared quickly after the event is processed.\n\nAs for condition 77 where we test for compatible interfaces, this is addressing case 1, where the trunk has been bound to a technology (ovs for instance) and thus something is worth emitting. In case of binding failed, or blank vif_type, there\u0027s no point in emitting a notification as no-one can be interested in it.\n\nWe can consider dropping condition 77 too, if we want to simplify this even further, but keeping it does not hurt.\n\nSo bottom line, please drop condition 65. Let\u0027s hear others what they think of condition 77","commit_id":"31a4a66dcae0698e91640bc5eaf110425e304371"},{"author":{"_account_id":13770,"name":"Adolfo Duarte","email":"adduarte@redhat.com","username":"adolfoduarte"},"change_message_id":"8e5d9264debee026def7e7fd88c0530efbda9e67","unresolved":false,"context_lines":[{"line_number":56,"context_line":""},{"line_number":57,"context_line":"        # Check if the trunk is bound, and if the host is running an agent"},{"line_number":58,"context_line":"        # whose type is advertised as a supported one."},{"line_number":59,"context_line":"        compatible_agent_exists \u003d (bool(binding_host) and"},{"line_number":60,"context_line":"                                   self.is_agent_available_on_host("},{"line_number":61,"context_line":"                                       context, core_plugin,"},{"line_number":62,"context_line":"                                       trunk_plugin.supported_agent_types,"},{"line_number":63,"context_line":"                                       binding_host))"},{"line_number":64,"context_line":""},{"line_number":65,"context_line":"        compatible_agent_exists \u003d ("},{"line_number":66,"context_line":"            bool(binding_host) and"}],"source_content_type":"text/x-python","patch_set":26,"id":"9ad45d7e_d24af626","line":63,"range":{"start_line":59,"start_character":8,"end_line":63,"end_character":53},"in_reply_to":"9ad45d7e_a7002103","updated":"2016-08-12 19:01:07.000000000","message":"yes. copy and paste error.","commit_id":"31a4a66dcae0698e91640bc5eaf110425e304371"},{"author":{"_account_id":6788,"name":"Rossella Sblendido","email":"rsblendido@suse.com","username":"rossella-o"},"change_message_id":"f55fc8753dfd2c8657fe9f41ea09231204c709fd","unresolved":false,"context_lines":[{"line_number":56,"context_line":""},{"line_number":57,"context_line":"        # Check if the trunk is bound, and if the host is running an agent"},{"line_number":58,"context_line":"        # whose type is advertised as a supported one."},{"line_number":59,"context_line":"        compatible_agent_exists \u003d (bool(binding_host) and"},{"line_number":60,"context_line":"                                   self.is_agent_available_on_host("},{"line_number":61,"context_line":"                                       context, core_plugin,"},{"line_number":62,"context_line":"                                       trunk_plugin.supported_agent_types,"},{"line_number":63,"context_line":"                                       binding_host))"},{"line_number":64,"context_line":""},{"line_number":65,"context_line":"        compatible_agent_exists \u003d ("},{"line_number":66,"context_line":"            bool(binding_host) and"}],"source_content_type":"text/x-python","patch_set":26,"id":"9ad45d7e_70540121","line":63,"range":{"start_line":59,"start_character":8,"end_line":63,"end_character":53},"in_reply_to":"9ad45d7e_c99284f5","updated":"2016-08-12 10:53:19.000000000","message":"I\u0027d drop condition 77 too, there could be some interesting race with the subport creation. Imagine the following scenario:\n\n1) the agent starts the binding of the trunk\n2) agent requests trunk details, no subport is present\n3) a new subport is created\n4) notification is dropped since trunk is not bound yet\n5) agents sends the rpc message to set the trunk up\n\nwe end up missing the creation of the subport...","commit_id":"31a4a66dcae0698e91640bc5eaf110425e304371"},{"author":{"_account_id":13770,"name":"Adolfo Duarte","email":"adduarte@redhat.com","username":"adolfoduarte"},"change_message_id":"8e5d9264debee026def7e7fd88c0530efbda9e67","unresolved":false,"context_lines":[{"line_number":56,"context_line":""},{"line_number":57,"context_line":"        # Check if the trunk is bound, and if the host is running an agent"},{"line_number":58,"context_line":"        # whose type is advertised as a supported one."},{"line_number":59,"context_line":"        compatible_agent_exists \u003d (bool(binding_host) and"},{"line_number":60,"context_line":"                                   self.is_agent_available_on_host("},{"line_number":61,"context_line":"                                       context, core_plugin,"},{"line_number":62,"context_line":"                                       trunk_plugin.supported_agent_types,"},{"line_number":63,"context_line":"                                       binding_host))"},{"line_number":64,"context_line":""},{"line_number":65,"context_line":"        compatible_agent_exists \u003d ("},{"line_number":66,"context_line":"            bool(binding_host) and"}],"source_content_type":"text/x-python","patch_set":26,"id":"9ad45d7e_72ceaab5","line":63,"range":{"start_line":59,"start_character":8,"end_line":63,"end_character":53},"in_reply_to":"9ad45d7e_cc71bf79","updated":"2016-08-12 19:01:07.000000000","message":"will drop condition 65\nwill drop condition 77 in favor of simpler code because we can always add it later. Will add \"TODO\" to mark code for optimization if necessary. \nWe don\u0027t need to check parent port is bound. \nThis results in removing all calls to the DB from this method. \nDONE","commit_id":"31a4a66dcae0698e91640bc5eaf110425e304371"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"da64fba865be575e21d2aafbd483d68390e4e687","unresolved":false,"context_lines":[{"line_number":56,"context_line":""},{"line_number":57,"context_line":"        # Check if the trunk is bound, and if the host is running an agent"},{"line_number":58,"context_line":"        # whose type is advertised as a supported one."},{"line_number":59,"context_line":"        compatible_agent_exists \u003d (bool(binding_host) and"},{"line_number":60,"context_line":"                                   self.is_agent_available_on_host("},{"line_number":61,"context_line":"                                       context, core_plugin,"},{"line_number":62,"context_line":"                                       trunk_plugin.supported_agent_types,"},{"line_number":63,"context_line":"                                       binding_host))"},{"line_number":64,"context_line":""},{"line_number":65,"context_line":"        compatible_agent_exists \u003d ("},{"line_number":66,"context_line":"            bool(binding_host) and"}],"source_content_type":"text/x-python","patch_set":26,"id":"9ad45d7e_cc71bf79","line":63,"range":{"start_line":59,"start_character":8,"end_line":63,"end_character":53},"in_reply_to":"9ad45d7e_cca9c426","updated":"2016-08-12 17:56:36.000000000","message":"Yes. I guess what we learnt here is that we\u0027re aware of the implications of unconditional notification and we know where to look when/if the brown matter hits the fan. Until then, perhaps we can simply favor a simpler code and drop both conditionals. In that case, we can go back and rebase this to master (though the base patch in the gate)","commit_id":"31a4a66dcae0698e91640bc5eaf110425e304371"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"39b62586e48af97a7e90d49fc23d019e0f8a5ef3","unresolved":false,"context_lines":[{"line_number":44,"context_line":"        LOG.debug(\"RPC backend initialized for trunk plugin\")"},{"line_number":45,"context_line":""},{"line_number":46,"context_line":"    def process_event(self, resource, event, trunk_plugin, payload):"},{"line_number":47,"context_line":"        \"\"\"Send event to agents.\"\"\""},{"line_number":48,"context_line":"        context \u003d payload.context"},{"line_number":49,"context_line":""},{"line_number":50,"context_line":"        # TODO(fitoduarte): future possible optimization:"}],"source_content_type":"text/x-python","patch_set":27,"id":"7ac969e8_0083bacd","line":47,"updated":"2016-08-13 00:10:57.000000000","message":"That\u0027s a bit skinny.","commit_id":"5f06e02006e4d1289d23ac532999f5e5064a8d0d"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"39b62586e48af97a7e90d49fc23d019e0f8a5ef3","unresolved":false,"context_lines":[{"line_number":50,"context_line":"        # TODO(fitoduarte): future possible optimization:"},{"line_number":51,"context_line":"        # - if necessary, check that the parent port is bound."},{"line_number":52,"context_line":"        # - Check that there is actual agents ready to receive notifications:"},{"line_number":53,"context_line":"        #      neutron.services.trunk.utils.are_agent_types_available_on_host"},{"line_number":54,"context_line":"        # - Check if the vif_type associated to the trunk is compatible with"},{"line_number":55,"context_line":"        #   the advertised vif types"},{"line_number":56,"context_line":""}],"source_content_type":"text/x-python","patch_set":27,"id":"7ac969e8_00b45af0","line":53,"updated":"2016-08-13 00:10:57.000000000","message":"this is actually being renamed.","commit_id":"5f06e02006e4d1289d23ac532999f5e5064a8d0d"}],"neutron/services/trunk/rpc/server.py":[{"author":{"_account_id":7787,"name":"Kevin Benton","email":"kevin@benton.pub","username":"blak111"},"change_message_id":"418d6b72aaf3c37ff2d5106b1120f1778c4396cf","unresolved":false,"context_lines":[{"line_number":64,"context_line":""},{"line_number":65,"context_line":"    def update_trunk(self, context, trunk):"},{"line_number":66,"context_line":"        \"\"\"Handle updates for the trunk coming from the agent.\"\"\""},{"line_number":67,"context_line":"        # TODO(armax): add the meat"},{"line_number":68,"context_line":"        pass"},{"line_number":69,"context_line":""},{"line_number":70,"context_line":""}],"source_content_type":"text/x-python","patch_set":4,"id":"bacf61ea_2d17b9a4","line":67,"updated":"2016-07-28 04:39:00.000000000","message":"just pass it directly through to the service plugin :)","commit_id":"696c4a7ebdf455308f371a3cdfd2f2f0c67f1904"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"67324385b2dd71ed18cd34db44439972100fa003","unresolved":false,"context_lines":[{"line_number":64,"context_line":""},{"line_number":65,"context_line":"    def update_trunk(self, context, trunk):"},{"line_number":66,"context_line":"        \"\"\"Handle updates for the trunk coming from the agent.\"\"\""},{"line_number":67,"context_line":"        # TODO(armax): add the meat"},{"line_number":68,"context_line":"        pass"},{"line_number":69,"context_line":""},{"line_number":70,"context_line":""}],"source_content_type":"text/x-python","patch_set":4,"id":"bacf61ea_b86ac518","line":67,"in_reply_to":"bacf61ea_2d17b9a4","updated":"2016-07-28 05:39:30.000000000","message":"the update_trunk that the plugin exposes is not gonna cut it, because that only allows to update name and admin_state. We need a little more than that.","commit_id":"696c4a7ebdf455308f371a3cdfd2f2f0c67f1904"},{"author":{"_account_id":8788,"name":"Miguel Angel Ajo","email":"mangelajo@redhat.com","username":"mangelajo"},"change_message_id":"0400cf597a5ba21fa6f086c12ce5095ec6d3caca","unresolved":false,"context_lines":[{"line_number":63,"context_line":"                                   namespace\u003dconstants.TRUNK_BASE_NAMESPACE)"},{"line_number":64,"context_line":""},{"line_number":65,"context_line":"    def update_trunk(self, context, trunk):"},{"line_number":66,"context_line":"        \"\"\"Handle updates for the trunk coming from the agent.\"\"\""},{"line_number":67,"context_line":"        # TODO(armax): add the meat"},{"line_number":68,"context_line":"        pass"},{"line_number":69,"context_line":""}],"source_content_type":"text/x-python","patch_set":5,"id":"bacf61ea_6279a1fc","line":66,"updated":"2016-07-28 14:17:04.000000000","message":"Oslo versioned objects had something called remotable methods, which you could call on an object, and get handled by the remote servers, I never used it, I wonder if @iharchys knows more about it.\n\n\nhttp://docs.openstack.org/developer/oslo.versionedobjects/usage.html#implement-the-indirection-api\n\nI think the idea of those decorated methods is that when an inidrection API is provided on the object, when you call the method, the object is serialized through the indirection api, executed remotely, and you get the result locally.","commit_id":"0a9f320f1f38a36f80ef1564308f4f678d7931b7"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"83ccb42f79c61bab4bb0c847ed2b53c40541a159","unresolved":false,"context_lines":[{"line_number":63,"context_line":"                                   namespace\u003dconstants.TRUNK_BASE_NAMESPACE)"},{"line_number":64,"context_line":""},{"line_number":65,"context_line":"    def update_trunk(self, context, trunk):"},{"line_number":66,"context_line":"        \"\"\"Handle updates for the trunk coming from the agent.\"\"\""},{"line_number":67,"context_line":"        # TODO(armax): add the meat"},{"line_number":68,"context_line":"        pass"},{"line_number":69,"context_line":""}],"source_content_type":"text/x-python","patch_set":5,"id":"bacf61ea_04054e79","line":66,"in_reply_to":"bacf61ea_6279a1fc","updated":"2016-07-28 15:28:06.000000000","message":"something worth exploring...but I\u0027d rather not break too much ground here :)","commit_id":"0a9f320f1f38a36f80ef1564308f4f678d7931b7"},{"author":{"_account_id":8788,"name":"Miguel Angel Ajo","email":"mangelajo@redhat.com","username":"mangelajo"},"change_message_id":"0400cf597a5ba21fa6f086c12ce5095ec6d3caca","unresolved":false,"context_lines":[{"line_number":72,"context_line":"    \"\"\"Stub proxy code for server-\u003eagent communication.\"\"\""},{"line_number":73,"context_line":""},{"line_number":74,"context_line":"    def __init__(self):"},{"line_number":75,"context_line":"        # TODO(armax): check if consumer registry supports resource bulks"},{"line_number":76,"context_line":"        self.stub \u003d resources_rpc.ResourcesPushRpcApi()"},{"line_number":77,"context_line":""},{"line_number":78,"context_line":"    def add_subports(self, context, subports):"}],"source_content_type":"text/x-python","patch_set":5,"id":"bacf61ea_c2f5ed83","line":75,"updated":"2016-07-28 14:17:04.000000000","message":"Working on it.","commit_id":"0a9f320f1f38a36f80ef1564308f4f678d7931b7"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"83ccb42f79c61bab4bb0c847ed2b53c40541a159","unresolved":false,"context_lines":[{"line_number":72,"context_line":"    \"\"\"Stub proxy code for server-\u003eagent communication.\"\"\""},{"line_number":73,"context_line":""},{"line_number":74,"context_line":"    def __init__(self):"},{"line_number":75,"context_line":"        # TODO(armax): check if consumer registry supports resource bulks"},{"line_number":76,"context_line":"        self.stub \u003d resources_rpc.ResourcesPushRpcApi()"},{"line_number":77,"context_line":""},{"line_number":78,"context_line":"    def add_subports(self, context, subports):"}],"source_content_type":"text/x-python","patch_set":5,"id":"bacf61ea_44ff4667","line":75,"in_reply_to":"bacf61ea_c2f5ed83","updated":"2016-07-28 15:28:06.000000000","message":"ack. For now I am gonna fall back on iterating over.","commit_id":"0a9f320f1f38a36f80ef1564308f4f678d7931b7"},{"author":{"_account_id":13770,"name":"Adolfo Duarte","email":"adduarte@redhat.com","username":"adolfoduarte"},"change_message_id":"1469c956bb6067a11cd7c3491f7c6511986a8b28","unresolved":false,"context_lines":[{"line_number":68,"context_line":"        pass"},{"line_number":69,"context_line":""},{"line_number":70,"context_line":""},{"line_number":71,"context_line":"class TrunkStub(object):"},{"line_number":72,"context_line":"    \"\"\"Stub proxy code for server-\u003eagent communication.\"\"\""},{"line_number":73,"context_line":""},{"line_number":74,"context_line":"    def __init__(self):"},{"line_number":75,"context_line":"        # TODO(armax): check if consumer registry supports resource bulks"},{"line_number":76,"context_line":"        self.stub \u003d resources_rpc.ResourcesPushRpcApi()"},{"line_number":77,"context_line":""},{"line_number":78,"context_line":"    def add_subports(self, context, subports):"},{"line_number":79,"context_line":"        \"\"\"Tell the agent about new subports to add.\"\"\""},{"line_number":80,"context_line":"        self.stub.push(context, subports, events.CREATED)"},{"line_number":81,"context_line":""},{"line_number":82,"context_line":"    def delete_subports(self, context, subports):"},{"line_number":83,"context_line":"        \"\"\"Tell the agent about existing subports to remove.\"\"\""},{"line_number":84,"context_line":"        self.stub.push(context, subports, events.DELETED)"},{"line_number":85,"context_line":""},{"line_number":86,"context_line":""},{"line_number":87,"context_line":"def initialize_rpc_backend():"}],"source_content_type":"text/x-python","patch_set":5,"id":"bacf61ea_9fffe033","line":84,"range":{"start_line":71,"start_character":0,"end_line":84,"end_character":57},"updated":"2016-07-28 09:10:19.000000000","message":"do we really need an object? can\u0027t just make them static?: \ndef delete_subports(context, subports):\n    resources_rpc.ResourcePushRpcApi().push(context,\n                                            subports,\n                                            events.DELETE)","commit_id":"0a9f320f1f38a36f80ef1564308f4f678d7931b7"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"83ccb42f79c61bab4bb0c847ed2b53c40541a159","unresolved":false,"context_lines":[{"line_number":68,"context_line":"        pass"},{"line_number":69,"context_line":""},{"line_number":70,"context_line":""},{"line_number":71,"context_line":"class TrunkStub(object):"},{"line_number":72,"context_line":"    \"\"\"Stub proxy code for server-\u003eagent communication.\"\"\""},{"line_number":73,"context_line":""},{"line_number":74,"context_line":"    def __init__(self):"},{"line_number":75,"context_line":"        # TODO(armax): check if consumer registry supports resource bulks"},{"line_number":76,"context_line":"        self.stub \u003d resources_rpc.ResourcesPushRpcApi()"},{"line_number":77,"context_line":""},{"line_number":78,"context_line":"    def add_subports(self, context, subports):"},{"line_number":79,"context_line":"        \"\"\"Tell the agent about new subports to add.\"\"\""},{"line_number":80,"context_line":"        self.stub.push(context, subports, events.CREATED)"},{"line_number":81,"context_line":""},{"line_number":82,"context_line":"    def delete_subports(self, context, subports):"},{"line_number":83,"context_line":"        \"\"\"Tell the agent about existing subports to remove.\"\"\""},{"line_number":84,"context_line":"        self.stub.push(context, subports, events.DELETED)"},{"line_number":85,"context_line":""},{"line_number":86,"context_line":""},{"line_number":87,"context_line":"def initialize_rpc_backend():"}],"source_content_type":"text/x-python","patch_set":5,"id":"bacf61ea_440d868f","line":84,"range":{"start_line":71,"start_character":0,"end_line":84,"end_character":57},"in_reply_to":"bacf61ea_9fffe033","updated":"2016-07-28 15:28:06.000000000","message":"Right now we don\u0027t. This might turn handy in the future but let\u0027s go back and we\u0027ll cross that bridge when we get to it.","commit_id":"0a9f320f1f38a36f80ef1564308f4f678d7931b7"},{"author":{"_account_id":7787,"name":"Kevin Benton","email":"kevin@benton.pub","username":"blak111"},"change_message_id":"18f29cd31ff684023bf6d15032ed8e8ebbd8e8ba","unresolved":false,"context_lines":[{"line_number":48,"context_line":"def trunk_by_port_provider(resource, port_id, **kwargs):"},{"line_number":49,"context_line":"    \"\"\"Provider callback to supply trunk information by parent port.\"\"\""},{"line_number":50,"context_line":"    context \u003d kwargs.get(\u0027context\u0027)"},{"line_number":51,"context_line":"    if context is None:"},{"line_number":52,"context_line":"        LOG.debug("},{"line_number":53,"context_line":"            \u0027Received %(resource)s %(port_id)s without context\u0027,"},{"line_number":54,"context_line":"            {\u0027resource\u0027: resource, \u0027port_id\u0027: port_id}"}],"source_content_type":"text/x-python","patch_set":13,"id":"bacf61ea_08a82a76","line":51,"updated":"2016-08-01 19:53:06.000000000","message":"Why is this a silent failure? Shouldn\u0027t we just raise something here?","commit_id":"f52710e4c44fb51ff149bbbf1074182652525646"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"01b81c12a28decf7fa9c07aa3b61c11d52492e19","unresolved":false,"context_lines":[{"line_number":48,"context_line":"def trunk_by_port_provider(resource, port_id, **kwargs):"},{"line_number":49,"context_line":"    \"\"\"Provider callback to supply trunk information by parent port.\"\"\""},{"line_number":50,"context_line":"    context \u003d kwargs.get(\u0027context\u0027)"},{"line_number":51,"context_line":"    if context is None:"},{"line_number":52,"context_line":"        LOG.debug("},{"line_number":53,"context_line":"            \u0027Received %(resource)s %(port_id)s without context\u0027,"},{"line_number":54,"context_line":"            {\u0027resource\u0027: resource, \u0027port_id\u0027: port_id}"}],"source_content_type":"text/x-python","patch_set":13,"id":"bacf61ea_43504332","line":51,"in_reply_to":"bacf61ea_08a82a76","updated":"2016-08-01 20:26:37.000000000","message":"I borrowed this from ajo\u0027s suggestion, can be revised later I guess.","commit_id":"f52710e4c44fb51ff149bbbf1074182652525646"},{"author":{"_account_id":7787,"name":"Kevin Benton","email":"kevin@benton.pub","username":"blak111"},"change_message_id":"18f29cd31ff684023bf6d15032ed8e8ebbd8e8ba","unresolved":false,"context_lines":[{"line_number":54,"context_line":"            {\u0027resource\u0027: resource, \u0027port_id\u0027: port_id}"},{"line_number":55,"context_line":"        )"},{"line_number":56,"context_line":"        return"},{"line_number":57,"context_line":"    return trunk_objects.Trunk.get_object(context, port_id\u003dport_id)"},{"line_number":58,"context_line":""},{"line_number":59,"context_line":""},{"line_number":60,"context_line":"class TrunkSkeleton(object):"}],"source_content_type":"text/x-python","patch_set":13,"id":"bacf61ea_68b9e6cb","line":57,"updated":"2016-08-01 19:53:06.000000000","message":"try:\n    return trunk_objects.Trunk.get_objects(context, port_id\u003dport_id)[0]\nexcept IndexError:\n    raise resources_rpc.ResourceNotFound...","commit_id":"f52710e4c44fb51ff149bbbf1074182652525646"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"01b81c12a28decf7fa9c07aa3b61c11d52492e19","unresolved":false,"context_lines":[{"line_number":54,"context_line":"            {\u0027resource\u0027: resource, \u0027port_id\u0027: port_id}"},{"line_number":55,"context_line":"        )"},{"line_number":56,"context_line":"        return"},{"line_number":57,"context_line":"    return trunk_objects.Trunk.get_object(context, port_id\u003dport_id)"},{"line_number":58,"context_line":""},{"line_number":59,"context_line":""},{"line_number":60,"context_line":"class TrunkSkeleton(object):"}],"source_content_type":"text/x-python","patch_set":13,"id":"bacf61ea_c35c334d","line":57,"in_reply_to":"bacf61ea_68b9e6cb","updated":"2016-08-01 20:26:37.000000000","message":"but we use this already in the code:\n\nhttps://github.com/openstack/neutron/blob/master/neutron/services/trunk/rules.py#L49\n\nAny reason why you don\u0027t like it?","commit_id":"f52710e4c44fb51ff149bbbf1074182652525646"},{"author":{"_account_id":7787,"name":"Kevin Benton","email":"kevin@benton.pub","username":"blak111"},"change_message_id":"18f29cd31ff684023bf6d15032ed8e8ebbd8e8ba","unresolved":false,"context_lines":[{"line_number":98,"context_line":"        for trunk, subports in ports_by_trunk.items():"},{"line_number":99,"context_line":"            trunk_port_id \u003d self.trunk_plugin.get_trunk(el, trunk)[\u0027port_id\u0027]"},{"line_number":100,"context_line":"            trunk_port \u003d self.core_plugin.get_port(el, trunk_port_id)"},{"line_number":101,"context_line":"            trunk_host \u003d trunk_port.get(\u0027binding:host_id\u0027)"},{"line_number":102,"context_line":"            if not trunk_host:"},{"line_number":103,"context_line":"                LOG.warning(_LW(\"Agent requested binding update on unbound \""},{"line_number":104,"context_line":"                                \"trunk %s\"), trunk)"}],"source_content_type":"text/x-python","patch_set":13,"id":"bacf61ea_48bce2ba","line":101,"updated":"2016-08-01 19:53:06.000000000","message":"use the constant for \u0027binding:host_id\u0027","commit_id":"f52710e4c44fb51ff149bbbf1074182652525646"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"01b81c12a28decf7fa9c07aa3b61c11d52492e19","unresolved":false,"context_lines":[{"line_number":98,"context_line":"        for trunk, subports in ports_by_trunk.items():"},{"line_number":99,"context_line":"            trunk_port_id \u003d self.trunk_plugin.get_trunk(el, trunk)[\u0027port_id\u0027]"},{"line_number":100,"context_line":"            trunk_port \u003d self.core_plugin.get_port(el, trunk_port_id)"},{"line_number":101,"context_line":"            trunk_host \u003d trunk_port.get(\u0027binding:host_id\u0027)"},{"line_number":102,"context_line":"            if not trunk_host:"},{"line_number":103,"context_line":"                LOG.warning(_LW(\"Agent requested binding update on unbound \""},{"line_number":104,"context_line":"                                \"trunk %s\"), trunk)"}],"source_content_type":"text/x-python","patch_set":13,"id":"bacf61ea_c32393bb","line":101,"in_reply_to":"bacf61ea_48bce2ba","updated":"2016-08-01 20:26:37.000000000","message":"breadcrumbs...but ya.","commit_id":"f52710e4c44fb51ff149bbbf1074182652525646"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"be782c653b1a45eca7cf647c4b4d69ddaaeb05e2","unresolved":false,"context_lines":[{"line_number":93,"context_line":"        \"\"\"Update subport bindings to match parent port host binding.\"\"\""},{"line_number":94,"context_line":"        el \u003d context.elevated()"},{"line_number":95,"context_line":"        ports_by_trunk \u003d collections.defaultdict(list)"},{"line_number":96,"context_line":"        for s in subports:"},{"line_number":97,"context_line":"            ports_by_trunk[s[\u0027trunk_id\u0027]].append(s[\u0027port_id\u0027])"},{"line_number":98,"context_line":"        for trunk, subports in ports_by_trunk.items():"},{"line_number":99,"context_line":"            trunk_port_id \u003d self.trunk_plugin.get_trunk(el, trunk)[\u0027port_id\u0027]"}],"source_content_type":"text/x-python","patch_set":14,"id":"bacf61ea_bf294f9d","line":96,"updated":"2016-08-01 21:47:28.000000000","message":"if we\u0027re assuming that the agent may tell the plugin to bind sub-port from different trunks, then it\u0027d be nice to add a comment to make this clear.","commit_id":"bc23b9387ed4103ae5f04b82e163e8bf85daeff1"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"be782c653b1a45eca7cf647c4b4d69ddaaeb05e2","unresolved":false,"context_lines":[{"line_number":98,"context_line":"        for trunk, subports in ports_by_trunk.items():"},{"line_number":99,"context_line":"            trunk_port_id \u003d self.trunk_plugin.get_trunk(el, trunk)[\u0027port_id\u0027]"},{"line_number":100,"context_line":"            trunk_port \u003d self.core_plugin.get_port(el, trunk_port_id)"},{"line_number":101,"context_line":"            trunk_host \u003d trunk_port.get(\u0027binding:host_id\u0027)"},{"line_number":102,"context_line":"            if not trunk_host:"},{"line_number":103,"context_line":"                LOG.warning(_LW(\"Agent requested binding update on unbound \""},{"line_number":104,"context_line":"                                \"trunk %s\"), trunk)"}],"source_content_type":"text/x-python","patch_set":14,"id":"bacf61ea_0205a20f","line":101,"range":{"start_line":101,"start_character":44,"end_line":101,"end_character":45},"updated":"2016-08-01 21:47:28.000000000","message":"constant?","commit_id":"bc23b9387ed4103ae5f04b82e163e8bf85daeff1"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"be782c653b1a45eca7cf647c4b4d69ddaaeb05e2","unresolved":false,"context_lines":[{"line_number":103,"context_line":"                LOG.warning(_LW(\"Agent requested binding update on unbound \""},{"line_number":104,"context_line":"                                \"trunk %s\"), trunk)"},{"line_number":105,"context_line":"                return"},{"line_number":106,"context_line":"            for p in self.core_plugin.get_ports(el, {\u0027id\u0027: subports}):"},{"line_number":107,"context_line":"                if p.get(\u0027binding:host_id\u0027) !\u003d trunk_host:"},{"line_number":108,"context_line":"                    self.core_plugin.update_port("},{"line_number":109,"context_line":"                        el, p[\u0027id\u0027], {\u0027port\u0027: {\u0027binding:host_id\u0027: trunk_host}})"}],"source_content_type":"text/x-python","patch_set":14,"id":"bacf61ea_4222faa3","line":106,"updated":"2016-08-01 21:47:28.000000000","message":"We\u0027d need to remember to take care of the trunk state machine.","commit_id":"bc23b9387ed4103ae5f04b82e163e8bf85daeff1"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"be782c653b1a45eca7cf647c4b4d69ddaaeb05e2","unresolved":false,"context_lines":[{"line_number":104,"context_line":"                                \"trunk %s\"), trunk)"},{"line_number":105,"context_line":"                return"},{"line_number":106,"context_line":"            for p in self.core_plugin.get_ports(el, {\u0027id\u0027: subports}):"},{"line_number":107,"context_line":"                if p.get(\u0027binding:host_id\u0027) !\u003d trunk_host:"},{"line_number":108,"context_line":"                    self.core_plugin.update_port("},{"line_number":109,"context_line":"                        el, p[\u0027id\u0027], {\u0027port\u0027: {\u0027binding:host_id\u0027: trunk_host}})"},{"line_number":110,"context_line":""}],"source_content_type":"text/x-python","patch_set":14,"id":"bacf61ea_420b1a24","line":107,"updated":"2016-08-01 21:47:28.000000000","message":"constant?","commit_id":"bc23b9387ed4103ae5f04b82e163e8bf85daeff1"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"b4887e6777b7b5e243890d4416341771a0169cbe","unresolved":false,"context_lines":[{"line_number":103,"context_line":"                LOG.warning(_LW(\"Agent requested binding update on unbound \""},{"line_number":104,"context_line":"                                \"trunk %s\"), trunk)"},{"line_number":105,"context_line":"                return"},{"line_number":106,"context_line":"            for p in self.core_plugin.get_ports(el, {\u0027id\u0027: subports}):"},{"line_number":107,"context_line":"                if p.get(\u0027binding:host_id\u0027) !\u003d trunk_host:"},{"line_number":108,"context_line":"                    self.core_plugin.update_port("},{"line_number":109,"context_line":"                        el, p[\u0027id\u0027], {\u0027port\u0027: {\u0027binding:host_id\u0027: trunk_host}})"}],"source_content_type":"text/x-python","patch_set":16,"id":"bacf61ea_b8fe4536","line":106,"updated":"2016-08-02 23:55:52.000000000","message":"we should store the outcome of get_ports and return it to the caller.","commit_id":"6443829c04c7c5e7a209b85e8440c264566479dd"},{"author":{"_account_id":13770,"name":"Adolfo Duarte","email":"adduarte@redhat.com","username":"adolfoduarte"},"change_message_id":"6e532401223b22d621807fb6170778e8bc1df7cc","unresolved":false,"context_lines":[{"line_number":103,"context_line":"                LOG.warning(_LW(\"Agent requested binding update on unbound \""},{"line_number":104,"context_line":"                                \"trunk %s\"), trunk)"},{"line_number":105,"context_line":"                return"},{"line_number":106,"context_line":"            for p in self.core_plugin.get_ports(el, {\u0027id\u0027: subports}):"},{"line_number":107,"context_line":"                if p.get(\u0027binding:host_id\u0027) !\u003d trunk_host:"},{"line_number":108,"context_line":"                    self.core_plugin.update_port("},{"line_number":109,"context_line":"                        el, p[\u0027id\u0027], {\u0027port\u0027: {\u0027binding:host_id\u0027: trunk_host}})"}],"source_content_type":"text/x-python","patch_set":16,"id":"bacf61ea_95921f9e","line":106,"in_reply_to":"bacf61ea_b8fe4536","updated":"2016-08-03 06:53:28.000000000","message":"Done","commit_id":"6443829c04c7c5e7a209b85e8440c264566479dd"},{"author":{"_account_id":8655,"name":"Jakub Libosvar","email":"libosvar@redhat.com","username":"jlibosva"},"change_message_id":"314af9f5641bf0a4a84b31a5c13a9fb6888a7830","unresolved":false,"context_lines":[{"line_number":30,"context_line":""},{"line_number":31,"context_line":"LOG \u003d logging.getLogger(__name__)"},{"line_number":32,"context_line":""},{"line_number":33,"context_line":"# This module contains stub (client-side) and skeleton (server-side)"},{"line_number":34,"context_line":"# proxy code that executes in the Neutron server process space. This"},{"line_number":35,"context_line":"# is needed if any of the trunk service plugin drivers has a remote"},{"line_number":36,"context_line":"# component (e.g. agent), that needs to communicate with the Neutron"}],"source_content_type":"text/x-python","patch_set":17,"id":"bacf61ea_ea1443a0","line":33,"updated":"2016-08-03 15:37:54.000000000","message":"Kudos for this documentation, makes it more easy to understand the code.","commit_id":"124d59e8a167663da2a5369bb5a684bfe1886bd5"},{"author":{"_account_id":8655,"name":"Jakub Libosvar","email":"libosvar@redhat.com","username":"jlibosva"},"change_message_id":"314af9f5641bf0a4a84b31a5c13a9fb6888a7830","unresolved":false,"context_lines":[{"line_number":79,"context_line":""},{"line_number":80,"context_line":"    @property"},{"line_number":81,"context_line":"    def core_plugin(self):"},{"line_number":82,"context_line":"        if not self._core_plugin:"},{"line_number":83,"context_line":"            self._core_plugin \u003d manager.NeutronManager.get_plugin()"},{"line_number":84,"context_line":"        return self._core_plugin"},{"line_number":85,"context_line":""}],"source_content_type":"text/x-python","patch_set":17,"id":"bacf61ea_8adb07ed","line":82,"range":{"start_line":82,"start_character":8,"end_line":82,"end_character":33},"updated":"2016-08-03 15:37:54.000000000","message":"Suggestion: Instead of mixing class and instance attributes, how about:\n\n if not hasattr(self, \u0027_core_plugin):\n     self._core_plugin \u003d manager...","commit_id":"124d59e8a167663da2a5369bb5a684bfe1886bd5"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"d0af2a16fed3388c2f3d1f202a273db341451d90","unresolved":false,"context_lines":[{"line_number":79,"context_line":""},{"line_number":80,"context_line":"    @property"},{"line_number":81,"context_line":"    def core_plugin(self):"},{"line_number":82,"context_line":"        if not self._core_plugin:"},{"line_number":83,"context_line":"            self._core_plugin \u003d manager.NeutronManager.get_plugin()"},{"line_number":84,"context_line":"        return self._core_plugin"},{"line_number":85,"context_line":""}],"source_content_type":"text/x-python","patch_set":17,"id":"bacf61ea_dc2f829f","line":82,"range":{"start_line":82,"start_character":8,"end_line":82,"end_character":33},"in_reply_to":"bacf61ea_8adb07ed","updated":"2016-08-03 16:27:32.000000000","message":"style choice IMO","commit_id":"124d59e8a167663da2a5369bb5a684bfe1886bd5"},{"author":{"_account_id":8655,"name":"Jakub Libosvar","email":"libosvar@redhat.com","username":"jlibosva"},"change_message_id":"314af9f5641bf0a4a84b31a5c13a9fb6888a7830","unresolved":false,"context_lines":[{"line_number":84,"context_line":"        return self._core_plugin"},{"line_number":85,"context_line":""},{"line_number":86,"context_line":"    @property"},{"line_number":87,"context_line":"    def trunk_plugin(self):"},{"line_number":88,"context_line":"        if not self._trunk_plugin:"},{"line_number":89,"context_line":"            self._trunk_plugin \u003d (manager.NeutronManager."},{"line_number":90,"context_line":"                                  get_service_plugins()[\u0027trunk\u0027])"}],"source_content_type":"text/x-python","patch_set":17,"id":"bacf61ea_97ca0b4e","line":87,"range":{"start_line":87,"start_character":8,"end_line":87,"end_character":20},"updated":"2016-08-03 15:37:54.000000000","message":"Why don\u0027t we use objects instead of calling into the plugin?\n\ne.g. instead of \n\n trunk \u003d self.trunk_plugin.get_trunk(context, trunk_id)\n\ncalling\n\n trunk \u003d trunk_obj.get_object(context, id\u003dtrunk_id)","commit_id":"124d59e8a167663da2a5369bb5a684bfe1886bd5"},{"author":{"_account_id":4187,"name":"Ryan Tidwell","email":"rtidwell@suse.com","username":"ryan-tidwell"},"change_message_id":"8b7fb80ceefdb95ae57d48479a56237d7d7bb6be","unresolved":false,"context_lines":[{"line_number":84,"context_line":"        return self._core_plugin"},{"line_number":85,"context_line":""},{"line_number":86,"context_line":"    @property"},{"line_number":87,"context_line":"    def trunk_plugin(self):"},{"line_number":88,"context_line":"        if not self._trunk_plugin:"},{"line_number":89,"context_line":"            self._trunk_plugin \u003d (manager.NeutronManager."},{"line_number":90,"context_line":"                                  get_service_plugins()[\u0027trunk\u0027])"}],"source_content_type":"text/x-python","patch_set":17,"id":"bacf61ea_286db999","line":87,"range":{"start_line":87,"start_character":8,"end_line":87,"end_character":20},"in_reply_to":"bacf61ea_3c15fe48","updated":"2016-08-03 17:18:17.000000000","message":"It is worth considering. In cases where the service plugin isn\u0027t loaded, the server-side RPC scaffolding won\u0027t even be loaded. The server-side drivers are loaded by the service plugin imports. If the thinking is to somehow toggle on whether self._trunk_plugin to assert whether trunk functionality should be exposed, I would say that the fact the RPC scaffolding here is being invoked is validation that the trunk functionality has been enabled.\n\nIn addition if for some strange reason someone implements the extension in another way and wants to re-use these RPC components, this will be more re-usable in that it\u0027s not tied to the service plugin implementation.","commit_id":"124d59e8a167663da2a5369bb5a684bfe1886bd5"},{"author":{"_account_id":13770,"name":"Adolfo Duarte","email":"adduarte@redhat.com","username":"adolfoduarte"},"change_message_id":"7099107cd73b4a45b17bddd00314bb097bf45761","unresolved":false,"context_lines":[{"line_number":84,"context_line":"        return self._core_plugin"},{"line_number":85,"context_line":""},{"line_number":86,"context_line":"    @property"},{"line_number":87,"context_line":"    def trunk_plugin(self):"},{"line_number":88,"context_line":"        if not self._trunk_plugin:"},{"line_number":89,"context_line":"            self._trunk_plugin \u003d (manager.NeutronManager."},{"line_number":90,"context_line":"                                  get_service_plugins()[\u0027trunk\u0027])"}],"source_content_type":"text/x-python","patch_set":17,"id":"bacf61ea_85fc8e3f","line":87,"range":{"start_line":87,"start_character":8,"end_line":87,"end_character":20},"in_reply_to":"bacf61ea_97ca0b4e","updated":"2016-08-03 17:22:25.000000000","message":"Will capture on a TODO so we can address in future PS.","commit_id":"124d59e8a167663da2a5369bb5a684bfe1886bd5"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"d0af2a16fed3388c2f3d1f202a273db341451d90","unresolved":false,"context_lines":[{"line_number":84,"context_line":"        return self._core_plugin"},{"line_number":85,"context_line":""},{"line_number":86,"context_line":"    @property"},{"line_number":87,"context_line":"    def trunk_plugin(self):"},{"line_number":88,"context_line":"        if not self._trunk_plugin:"},{"line_number":89,"context_line":"            self._trunk_plugin \u003d (manager.NeutronManager."},{"line_number":90,"context_line":"                                  get_service_plugins()[\u0027trunk\u0027])"}],"source_content_type":"text/x-python","patch_set":17,"id":"bacf61ea_3c15fe48","line":87,"range":{"start_line":87,"start_character":8,"end_line":87,"end_character":20},"in_reply_to":"bacf61ea_97ca0b4e","updated":"2016-08-03 16:27:32.000000000","message":"that\u0027s worth considering.","commit_id":"124d59e8a167663da2a5369bb5a684bfe1886bd5"},{"author":{"_account_id":8655,"name":"Jakub Libosvar","email":"libosvar@redhat.com","username":"jlibosva"},"change_message_id":"314af9f5641bf0a4a84b31a5c13a9fb6888a7830","unresolved":false,"context_lines":[{"line_number":85,"context_line":""},{"line_number":86,"context_line":"    @property"},{"line_number":87,"context_line":"    def trunk_plugin(self):"},{"line_number":88,"context_line":"        if not self._trunk_plugin:"},{"line_number":89,"context_line":"            self._trunk_plugin \u003d (manager.NeutronManager."},{"line_number":90,"context_line":"                                  get_service_plugins()[\u0027trunk\u0027])"},{"line_number":91,"context_line":"        return self._trunk_plugin"}],"source_content_type":"text/x-python","patch_set":17,"id":"bacf61ea_cae5ffa8","line":88,"range":{"start_line":88,"start_character":8,"end_line":88,"end_character":34},"updated":"2016-08-03 15:37:54.000000000","message":"Ditto","commit_id":"124d59e8a167663da2a5369bb5a684bfe1886bd5"},{"author":{"_account_id":8655,"name":"Jakub Libosvar","email":"libosvar@redhat.com","username":"jlibosva"},"change_message_id":"314af9f5641bf0a4a84b31a5c13a9fb6888a7830","unresolved":false,"context_lines":[{"line_number":87,"context_line":"    def trunk_plugin(self):"},{"line_number":88,"context_line":"        if not self._trunk_plugin:"},{"line_number":89,"context_line":"            self._trunk_plugin \u003d (manager.NeutronManager."},{"line_number":90,"context_line":"                                  get_service_plugins()[\u0027trunk\u0027])"},{"line_number":91,"context_line":"        return self._trunk_plugin"},{"line_number":92,"context_line":""},{"line_number":93,"context_line":"    def update_subport_bindings(self, context, subports):"}],"source_content_type":"text/x-python","patch_set":17,"id":"bacf61ea_8513f85b","line":90,"range":{"start_line":90,"start_character":56,"end_line":90,"end_character":63},"updated":"2016-08-03 15:37:54.000000000","message":"Should we have it as a constant?","commit_id":"124d59e8a167663da2a5369bb5a684bfe1886bd5"},{"author":{"_account_id":8655,"name":"Jakub Libosvar","email":"libosvar@redhat.com","username":"jlibosva"},"change_message_id":"314af9f5641bf0a4a84b31a5c13a9fb6888a7830","unresolved":false,"context_lines":[{"line_number":99,"context_line":"            ports_by_trunk[s[\u0027trunk_id\u0027]].append(s[\u0027port_id\u0027])"},{"line_number":100,"context_line":"        for trunk, subports in ports_by_trunk.items():"},{"line_number":101,"context_line":"            trunk_port_id \u003d self.trunk_plugin.get_trunk(el, trunk)[\u0027port_id\u0027]"},{"line_number":102,"context_line":"            trunk_port \u003d self.core_plugin.get_port(el, trunk_port_id)"},{"line_number":103,"context_line":"            trunk_host \u003d trunk_port.get(HOST_ID)"},{"line_number":104,"context_line":"            if not trunk_host:"},{"line_number":105,"context_line":"                LOG.warning(_LW(\"Agent requested binding update on unbound \""}],"source_content_type":"text/x-python","patch_set":17,"id":"bacf61ea_b7d62fef","line":102,"range":{"start_line":102,"start_character":25,"end_line":102,"end_character":50},"updated":"2016-08-03 15:37:54.000000000","message":"Maybe we should add TODO: to replce calling into core plugin with objects, once Port conversion is finished.","commit_id":"124d59e8a167663da2a5369bb5a684bfe1886bd5"},{"author":{"_account_id":13770,"name":"Adolfo Duarte","email":"adduarte@redhat.com","username":"adolfoduarte"},"change_message_id":"7099107cd73b4a45b17bddd00314bb097bf45761","unresolved":false,"context_lines":[{"line_number":99,"context_line":"            ports_by_trunk[s[\u0027trunk_id\u0027]].append(s[\u0027port_id\u0027])"},{"line_number":100,"context_line":"        for trunk, subports in ports_by_trunk.items():"},{"line_number":101,"context_line":"            trunk_port_id \u003d self.trunk_plugin.get_trunk(el, trunk)[\u0027port_id\u0027]"},{"line_number":102,"context_line":"            trunk_port \u003d self.core_plugin.get_port(el, trunk_port_id)"},{"line_number":103,"context_line":"            trunk_host \u003d trunk_port.get(HOST_ID)"},{"line_number":104,"context_line":"            if not trunk_host:"},{"line_number":105,"context_line":"                LOG.warning(_LW(\"Agent requested binding update on unbound \""}],"source_content_type":"text/x-python","patch_set":17,"id":"bacf61ea_c5bb2674","line":102,"range":{"start_line":102,"start_character":25,"end_line":102,"end_character":50},"in_reply_to":"bacf61ea_b7d62fef","updated":"2016-08-03 17:22:25.000000000","message":"Done","commit_id":"124d59e8a167663da2a5369bb5a684bfe1886bd5"},{"author":{"_account_id":8655,"name":"Jakub Libosvar","email":"libosvar@redhat.com","username":"jlibosva"},"change_message_id":"314af9f5641bf0a4a84b31a5c13a9fb6888a7830","unresolved":false,"context_lines":[{"line_number":104,"context_line":"            if not trunk_host:"},{"line_number":105,"context_line":"                LOG.warning(_LW(\"Agent requested binding update on unbound \""},{"line_number":106,"context_line":"                                \"trunk %s\"), trunk)"},{"line_number":107,"context_line":"                return"},{"line_number":108,"context_line":"            _core_subports \u003d self.core_plugin.get_ports(el, {\u0027id\u0027: subports})"},{"line_number":109,"context_line":"            for p in _core_subports:"},{"line_number":110,"context_line":"                if p.get(HOST_ID) !\u003d trunk_host:"}],"source_content_type":"text/x-python","patch_set":17,"id":"bacf61ea_7735d7d9","line":107,"range":{"start_line":107,"start_character":16,"end_line":107,"end_character":22},"updated":"2016-08-03 15:37:54.000000000","message":"Do we want to stop processing all other trunks in case one trunk is not bound? Maybe continue makes more sense. Also Python prefers:\n\n try:\n     trunk_host \u003d trunk_port[HOST_ID]\n except KeyError:\n     LOG.warning()\n     continue","commit_id":"124d59e8a167663da2a5369bb5a684bfe1886bd5"},{"author":{"_account_id":13770,"name":"Adolfo Duarte","email":"adduarte@redhat.com","username":"adolfoduarte"},"change_message_id":"7099107cd73b4a45b17bddd00314bb097bf45761","unresolved":false,"context_lines":[{"line_number":104,"context_line":"            if not trunk_host:"},{"line_number":105,"context_line":"                LOG.warning(_LW(\"Agent requested binding update on unbound \""},{"line_number":106,"context_line":"                                \"trunk %s\"), trunk)"},{"line_number":107,"context_line":"                return"},{"line_number":108,"context_line":"            _core_subports \u003d self.core_plugin.get_ports(el, {\u0027id\u0027: subports})"},{"line_number":109,"context_line":"            for p in _core_subports:"},{"line_number":110,"context_line":"                if p.get(HOST_ID) !\u003d trunk_host:"}],"source_content_type":"text/x-python","patch_set":17,"id":"bacf61ea_c825fdae","line":107,"range":{"start_line":107,"start_character":16,"end_line":107,"end_character":22},"in_reply_to":"bacf61ea_7735d7d9","updated":"2016-08-03 17:22:25.000000000","message":"Will use the try/catch block. \nWe should explore further implications of continue processing. It seems possible but we should work out the scenarios.\nagain. will add TODO just so we don\u0027t loose the thought as we move patch forward to new PS","commit_id":"124d59e8a167663da2a5369bb5a684bfe1886bd5"},{"author":{"_account_id":16800,"name":"Rawlin Peters","email":"rawlin.peters@hpe.com","username":"rawlin"},"change_message_id":"36aa5b522e744bb27d5d663263865c198be00cce","unresolved":false,"context_lines":[{"line_number":46,"context_line":"# For agent-side stub and skeleton proxy code, please look at agent.py"},{"line_number":47,"context_line":""},{"line_number":48,"context_line":""},{"line_number":49,"context_line":"def trunk_by_port_provider(resource, port_id, **kwargs):"},{"line_number":50,"context_line":"    \"\"\"Provider callback to supply trunk information by parent port.\"\"\""},{"line_number":51,"context_line":"    context \u003d kwargs.get(\u0027context\u0027)"},{"line_number":52,"context_line":"    if context is None:"}],"source_content_type":"text/x-python","patch_set":19,"id":"bacf61ea_2f5e5112","line":49,"range":{"start_line":49,"start_character":4,"end_line":49,"end_character":26},"updated":"2016-08-04 00:02:52.000000000","message":"question: why this method and also get_trunk_details() in agent.py? Do they provide the same thing?","commit_id":"0add8405148c2df4b8ae49a885d75b49aff8bc98"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"47411a1f59e7cecf6b83d378584fa26990794c5b","unresolved":false,"context_lines":[{"line_number":46,"context_line":"# For agent-side stub and skeleton proxy code, please look at agent.py"},{"line_number":47,"context_line":""},{"line_number":48,"context_line":""},{"line_number":49,"context_line":"def trunk_by_port_provider(resource, port_id, **kwargs):"},{"line_number":50,"context_line":"    \"\"\"Provider callback to supply trunk information by parent port.\"\"\""},{"line_number":51,"context_line":"    context \u003d kwargs.get(\u0027context\u0027)"},{"line_number":52,"context_line":"    if context is None:"}],"source_content_type":"text/x-python","patch_set":19,"id":"bacf61ea_521ec863","line":49,"range":{"start_line":49,"start_character":4,"end_line":49,"end_character":26},"in_reply_to":"bacf61ea_2f5e5112","updated":"2016-08-04 00:09:42.000000000","message":"I don\u0027t understand the first part of your question. This method is not in the agent module. However [1] is the agent-side stub proxy code, ie. the code that the agent invokes locally to fetch remotely the information provided by this method, by means of the RPC callback registry and the server-side skeleton proxy code done at line 74.\n\n[1] https://review.openstack.org/#/c/347662/19/neutron/services/trunk/rpc/agent.py@88","commit_id":"0add8405148c2df4b8ae49a885d75b49aff8bc98"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"e4e0a5a03ccdf66f33a2d6b64a385ef724a0be5b","unresolved":false,"context_lines":[{"line_number":46,"context_line":"# For agent-side stub and skeleton proxy code, please look at agent.py"},{"line_number":47,"context_line":""},{"line_number":48,"context_line":""},{"line_number":49,"context_line":"def trunk_by_port_provider(resource, port_id, **kwargs):"},{"line_number":50,"context_line":"    \"\"\"Provider callback to supply trunk information by parent port.\"\"\""},{"line_number":51,"context_line":"    context \u003d kwargs.get(\u0027context\u0027)"},{"line_number":52,"context_line":"    if context is None:"}],"source_content_type":"text/x-python","patch_set":19,"id":"bacf61ea_b29c645e","line":49,"range":{"start_line":49,"start_character":4,"end_line":49,"end_character":26},"in_reply_to":"bacf61ea_32ed14f0","updated":"2016-08-04 00:26:51.000000000","message":"No the agent only gets trunk details via get_trunk_details. This goes to the registry.pull(). However for the pull() operation to work correctly, a producer of information must supply an information provider, and that\u0027s where trunk_by_port_provider comes in. So the agent only uses trunk_by_port_provider indirectly, but it can do so only by using the local stub proxy code get_trunk_details which translated into a remote pull.","commit_id":"0add8405148c2df4b8ae49a885d75b49aff8bc98"},{"author":{"_account_id":16800,"name":"Rawlin Peters","email":"rawlin.peters@hpe.com","username":"rawlin"},"change_message_id":"6ec8da061b9ca3f516e372e87bad8916e8fec4fa","unresolved":false,"context_lines":[{"line_number":46,"context_line":"# For agent-side stub and skeleton proxy code, please look at agent.py"},{"line_number":47,"context_line":""},{"line_number":48,"context_line":""},{"line_number":49,"context_line":"def trunk_by_port_provider(resource, port_id, **kwargs):"},{"line_number":50,"context_line":"    \"\"\"Provider callback to supply trunk information by parent port.\"\"\""},{"line_number":51,"context_line":"    context \u003d kwargs.get(\u0027context\u0027)"},{"line_number":52,"context_line":"    if context is None:"}],"source_content_type":"text/x-python","patch_set":19,"id":"bacf61ea_32ed14f0","line":49,"range":{"start_line":49,"start_character":4,"end_line":49,"end_character":26},"in_reply_to":"bacf61ea_521ec863","updated":"2016-08-04 00:23:54.000000000","message":"I think maybe I\u0027m missing something about the RPC API. It seems like the agent has two ways to get the trunk by the port_id. It can either use trunk_by_port_provider() here or get_trunk_details() from [1]. Is that right? Why do we need both?","commit_id":"0add8405148c2df4b8ae49a885d75b49aff8bc98"},{"author":{"_account_id":16800,"name":"Rawlin Peters","email":"rawlin.peters@hpe.com","username":"rawlin"},"change_message_id":"1c19fe30b334c686e4241ccb027085513992f277","unresolved":false,"context_lines":[{"line_number":46,"context_line":"# For agent-side stub and skeleton proxy code, please look at agent.py"},{"line_number":47,"context_line":""},{"line_number":48,"context_line":""},{"line_number":49,"context_line":"def trunk_by_port_provider(resource, port_id, **kwargs):"},{"line_number":50,"context_line":"    \"\"\"Provider callback to supply trunk information by parent port.\"\"\""},{"line_number":51,"context_line":"    context \u003d kwargs.get(\u0027context\u0027)"},{"line_number":52,"context_line":"    if context is None:"}],"source_content_type":"text/x-python","patch_set":19,"id":"bacf61ea_f207fc1a","line":49,"range":{"start_line":49,"start_character":4,"end_line":49,"end_character":26},"in_reply_to":"bacf61ea_b29c645e","updated":"2016-08-04 00:41:44.000000000","message":"Ok I think I understand it now. For some reason I was thinking that the pull() of the trunk resource in the agent module was already doing this behind the scenes.","commit_id":"0add8405148c2df4b8ae49a885d75b49aff8bc98"},{"author":{"_account_id":4187,"name":"Ryan Tidwell","email":"rtidwell@suse.com","username":"ryan-tidwell"},"change_message_id":"9f53e8acae301cc729d8e38cfa278a8371137a75","unresolved":false,"context_lines":[{"line_number":86,"context_line":"        return self._core_plugin"},{"line_number":87,"context_line":""},{"line_number":88,"context_line":"    @property"},{"line_number":89,"context_line":"    def trunk_plugin(self):"},{"line_number":90,"context_line":"        # TODO(armax): consider getting rid of this property if we"},{"line_number":91,"context_line":"        # can more easily go to the trunk object"},{"line_number":92,"context_line":"        if not self._trunk_plugin:"}],"source_content_type":"text/x-python","patch_set":19,"id":"bacf61ea_649cbfc0","line":89,"range":{"start_line":89,"start_character":8,"end_line":89,"end_character":20},"updated":"2016-08-04 16:44:59.000000000","message":"Echoing a comment on an earlier patch set, is there a need to keep a reference to the trunk plugin? Couldn\u0027t we access what we need directly through the trunk object module rather than calling directly into the plugin?","commit_id":"0add8405148c2df4b8ae49a885d75b49aff8bc98"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"27b3b12d3a2fa7cb1662870a98514b1f283ba85b","unresolved":false,"context_lines":[{"line_number":86,"context_line":"        return self._core_plugin"},{"line_number":87,"context_line":""},{"line_number":88,"context_line":"    @property"},{"line_number":89,"context_line":"    def trunk_plugin(self):"},{"line_number":90,"context_line":"        # TODO(armax): consider getting rid of this property if we"},{"line_number":91,"context_line":"        # can more easily go to the trunk object"},{"line_number":92,"context_line":"        if not self._trunk_plugin:"}],"source_content_type":"text/x-python","patch_set":19,"id":"bacf61ea_2a50d1d3","line":89,"range":{"start_line":89,"start_character":8,"end_line":89,"end_character":20},"in_reply_to":"bacf61ea_649cbfc0","updated":"2016-08-04 17:09:17.000000000","message":"See TODO, we can get rid of it, but I wouldn\u0027t worry about that right now.","commit_id":"0add8405148c2df4b8ae49a885d75b49aff8bc98"},{"author":{"_account_id":16800,"name":"Rawlin Peters","email":"rawlin.peters@hpe.com","username":"rawlin"},"change_message_id":"36aa5b522e744bb27d5d663263865c198be00cce","unresolved":false,"context_lines":[{"line_number":96,"context_line":""},{"line_number":97,"context_line":"    def update_subport_bindings(self, context, subports):"},{"line_number":98,"context_line":"        \"\"\"Update subport bindings to match parent port host binding.\"\"\""},{"line_number":99,"context_line":"        _core_subports \u003d None"},{"line_number":100,"context_line":"        el \u003d context.elevated()"},{"line_number":101,"context_line":"        ports_by_trunk \u003d collections.defaultdict(list)"},{"line_number":102,"context_line":"        for s in subports:"}],"source_content_type":"text/x-python","patch_set":19,"id":"bacf61ea_0cb1db8f","line":99,"range":{"start_line":99,"start_character":8,"end_line":99,"end_character":22},"updated":"2016-08-04 00:02:52.000000000","message":"nit: I think this would be better named \"child_ports\"","commit_id":"0add8405148c2df4b8ae49a885d75b49aff8bc98"},{"author":{"_account_id":4187,"name":"Ryan Tidwell","email":"rtidwell@suse.com","username":"ryan-tidwell"},"change_message_id":"9f53e8acae301cc729d8e38cfa278a8371137a75","unresolved":false,"context_lines":[{"line_number":103,"context_line":"            ports_by_trunk[s[\u0027trunk_id\u0027]].append(s[\u0027port_id\u0027])"},{"line_number":104,"context_line":"        for trunk, subports in ports_by_trunk.items():"},{"line_number":105,"context_line":"            # TODO(armax): consider what happens for partial failures"},{"line_number":106,"context_line":"            trunk_port_id \u003d self.trunk_plugin.get_trunk(el, trunk)[\u0027port_id\u0027]"},{"line_number":107,"context_line":"            trunk_port \u003d self.core_plugin.get_port(el, trunk_port_id)"},{"line_number":108,"context_line":"            trunk_host \u003d trunk_port.get(HOST_ID)"},{"line_number":109,"context_line":"            if not trunk_host:"}],"source_content_type":"text/x-python","patch_set":19,"id":"bacf61ea_694bfa87","line":106,"range":{"start_line":106,"start_character":33,"end_line":106,"end_character":45},"updated":"2016-08-04 16:44:59.000000000","message":"Are we expecting to be processing subports from different trunks on the same call? If so, this makes sense. Otherwise, it seems like a wasteful lookup to do on each iteration.","commit_id":"0add8405148c2df4b8ae49a885d75b49aff8bc98"},{"author":{"_account_id":13770,"name":"Adolfo Duarte","email":"adduarte@redhat.com","username":"adolfoduarte"},"change_message_id":"8b5b927befd8b5f2f1415c8f7da7aaee6e49c52b","unresolved":false,"context_lines":[{"line_number":103,"context_line":"            ports_by_trunk[s[\u0027trunk_id\u0027]].append(s[\u0027port_id\u0027])"},{"line_number":104,"context_line":"        for trunk, subports in ports_by_trunk.items():"},{"line_number":105,"context_line":"            # TODO(armax): consider what happens for partial failures"},{"line_number":106,"context_line":"            trunk_port_id \u003d self.trunk_plugin.get_trunk(el, trunk)[\u0027port_id\u0027]"},{"line_number":107,"context_line":"            trunk_port \u003d self.core_plugin.get_port(el, trunk_port_id)"},{"line_number":108,"context_line":"            trunk_host \u003d trunk_port.get(HOST_ID)"},{"line_number":109,"context_line":"            if not trunk_host:"}],"source_content_type":"text/x-python","patch_set":19,"id":"bacf61ea_4a49bab6","line":106,"range":{"start_line":106,"start_character":33,"end_line":106,"end_character":45},"in_reply_to":"bacf61ea_2a9a916e","updated":"2016-08-04 21:23:25.000000000","message":"in the case of multiple subports with a single trunk, this call gest made for every subport. I think either caching the trunk_port_id or get the trunk_port_id before entering this loop.","commit_id":"0add8405148c2df4b8ae49a885d75b49aff8bc98"},{"author":{"_account_id":13770,"name":"Adolfo Duarte","email":"adduarte@redhat.com","username":"adolfoduarte"},"change_message_id":"98fd88a00e71fe73612b2957cc24bd7c29bd42ba","unresolved":false,"context_lines":[{"line_number":103,"context_line":"            ports_by_trunk[s[\u0027trunk_id\u0027]].append(s[\u0027port_id\u0027])"},{"line_number":104,"context_line":"        for trunk, subports in ports_by_trunk.items():"},{"line_number":105,"context_line":"            # TODO(armax): consider what happens for partial failures"},{"line_number":106,"context_line":"            trunk_port_id \u003d self.trunk_plugin.get_trunk(el, trunk)[\u0027port_id\u0027]"},{"line_number":107,"context_line":"            trunk_port \u003d self.core_plugin.get_port(el, trunk_port_id)"},{"line_number":108,"context_line":"            trunk_host \u003d trunk_port.get(HOST_ID)"},{"line_number":109,"context_line":"            if not trunk_host:"}],"source_content_type":"text/x-python","patch_set":19,"id":"bacf61ea_55a92e23","line":106,"range":{"start_line":106,"start_character":33,"end_line":106,"end_character":45},"in_reply_to":"bacf61ea_4546cb4f","updated":"2016-08-05 15:46:07.000000000","message":"Rawlin, you are correct. I missed that. I thought it was subort, but your are right, it is subports. so only once per trunk id. \nwe still need to look at the return value though. see L118. \nIn your example only [\u0027child_port_3\u0027, \u0027child_port_4\u0027] will be returned.","commit_id":"0add8405148c2df4b8ae49a885d75b49aff8bc98"},{"author":{"_account_id":16800,"name":"Rawlin Peters","email":"rawlin.peters@hpe.com","username":"rawlin"},"change_message_id":"bbeb351490c539ce183a21f5c998ba32b2af461e","unresolved":false,"context_lines":[{"line_number":103,"context_line":"            ports_by_trunk[s[\u0027trunk_id\u0027]].append(s[\u0027port_id\u0027])"},{"line_number":104,"context_line":"        for trunk, subports in ports_by_trunk.items():"},{"line_number":105,"context_line":"            # TODO(armax): consider what happens for partial failures"},{"line_number":106,"context_line":"            trunk_port_id \u003d self.trunk_plugin.get_trunk(el, trunk)[\u0027port_id\u0027]"},{"line_number":107,"context_line":"            trunk_port \u003d self.core_plugin.get_port(el, trunk_port_id)"},{"line_number":108,"context_line":"            trunk_host \u003d trunk_port.get(HOST_ID)"},{"line_number":109,"context_line":"            if not trunk_host:"}],"source_content_type":"text/x-python","patch_set":19,"id":"bacf61ea_4546cb4f","line":106,"range":{"start_line":106,"start_character":33,"end_line":106,"end_character":45},"in_reply_to":"bacf61ea_4a49bab6","updated":"2016-08-04 21:31:44.000000000","message":"Am I missing something?\n\nports_by_trunk will look like this:\n\n {\u0027trunk_1\u0027: [\u0027child_port_1\u0027, \u0027child_port_2\u0027],\n  \u0027trunk_2\u0027: [\u0027child_port_3\u0027, \u0027child_port_4\u0027]}\n\nThe loop iterates over ports_by_trunk.items(), so each iteration will have a new trunk and new list of subports belonging to said trunk. I still don\u0027t see what\u0027s wrong here.","commit_id":"0add8405148c2df4b8ae49a885d75b49aff8bc98"},{"author":{"_account_id":4187,"name":"Ryan Tidwell","email":"rtidwell@suse.com","username":"ryan-tidwell"},"change_message_id":"fbf4ced06c0bd0c47873613d43f89a1996cf7f17","unresolved":false,"context_lines":[{"line_number":103,"context_line":"            ports_by_trunk[s[\u0027trunk_id\u0027]].append(s[\u0027port_id\u0027])"},{"line_number":104,"context_line":"        for trunk, subports in ports_by_trunk.items():"},{"line_number":105,"context_line":"            # TODO(armax): consider what happens for partial failures"},{"line_number":106,"context_line":"            trunk_port_id \u003d self.trunk_plugin.get_trunk(el, trunk)[\u0027port_id\u0027]"},{"line_number":107,"context_line":"            trunk_port \u003d self.core_plugin.get_port(el, trunk_port_id)"},{"line_number":108,"context_line":"            trunk_host \u003d trunk_port.get(HOST_ID)"},{"line_number":109,"context_line":"            if not trunk_host:"}],"source_content_type":"text/x-python","patch_set":19,"id":"bacf61ea_8c31dca4","line":106,"range":{"start_line":106,"start_character":33,"end_line":106,"end_character":45},"in_reply_to":"bacf61ea_55a92e23","updated":"2016-08-05 18:21:45.000000000","message":"OK, I didn\u0027t pay close enough attention to L103. This should be OK.","commit_id":"0add8405148c2df4b8ae49a885d75b49aff8bc98"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"27b3b12d3a2fa7cb1662870a98514b1f283ba85b","unresolved":false,"context_lines":[{"line_number":103,"context_line":"            ports_by_trunk[s[\u0027trunk_id\u0027]].append(s[\u0027port_id\u0027])"},{"line_number":104,"context_line":"        for trunk, subports in ports_by_trunk.items():"},{"line_number":105,"context_line":"            # TODO(armax): consider what happens for partial failures"},{"line_number":106,"context_line":"            trunk_port_id \u003d self.trunk_plugin.get_trunk(el, trunk)[\u0027port_id\u0027]"},{"line_number":107,"context_line":"            trunk_port \u003d self.core_plugin.get_port(el, trunk_port_id)"},{"line_number":108,"context_line":"            trunk_host \u003d trunk_port.get(HOST_ID)"},{"line_number":109,"context_line":"            if not trunk_host:"}],"source_content_type":"text/x-python","patch_set":19,"id":"bacf61ea_cab13503","line":106,"range":{"start_line":106,"start_character":33,"end_line":106,"end_character":45},"in_reply_to":"bacf61ea_694bfa87","updated":"2016-08-04 17:09:17.000000000","message":"I guess this was done this way based on how LinuxBridge driver works, and I suppose this is general enough to accommodate both cases where subports belong to the same trunk or not. We can address waste by caching the trunk_port_id and skip the lookup.","commit_id":"0add8405148c2df4b8ae49a885d75b49aff8bc98"},{"author":{"_account_id":16800,"name":"Rawlin Peters","email":"rawlin.peters@hpe.com","username":"rawlin"},"change_message_id":"9278aa2d8af6958157ad6a482f91499af45656b6","unresolved":false,"context_lines":[{"line_number":103,"context_line":"            ports_by_trunk[s[\u0027trunk_id\u0027]].append(s[\u0027port_id\u0027])"},{"line_number":104,"context_line":"        for trunk, subports in ports_by_trunk.items():"},{"line_number":105,"context_line":"            # TODO(armax): consider what happens for partial failures"},{"line_number":106,"context_line":"            trunk_port_id \u003d self.trunk_plugin.get_trunk(el, trunk)[\u0027port_id\u0027]"},{"line_number":107,"context_line":"            trunk_port \u003d self.core_plugin.get_port(el, trunk_port_id)"},{"line_number":108,"context_line":"            trunk_host \u003d trunk_port.get(HOST_ID)"},{"line_number":109,"context_line":"            if not trunk_host:"}],"source_content_type":"text/x-python","patch_set":19,"id":"bacf61ea_2a9a916e","line":106,"range":{"start_line":106,"start_character":33,"end_line":106,"end_character":45},"in_reply_to":"bacf61ea_694bfa87","updated":"2016-08-04 17:17:34.000000000","message":"It seems like at least with the OVS driver, the agent would only be issuing this RPC call after finishing up the subport wiring for a single trunk. In that case, this loop would only iterate once and would only have one lookup. If for whatever reason subports from multiple trunks were to be processed, there would still only be one lookup per trunk. The lookup is necessary per-trunk, so I\u0027m not seeing something wrong here.","commit_id":"0add8405148c2df4b8ae49a885d75b49aff8bc98"},{"author":{"_account_id":13770,"name":"Adolfo Duarte","email":"adduarte@redhat.com","username":"adolfoduarte"},"change_message_id":"8b5b927befd8b5f2f1415c8f7da7aaee6e49c52b","unresolved":false,"context_lines":[{"line_number":115,"context_line":"                if p.get(HOST_ID) !\u003d trunk_host:"},{"line_number":116,"context_line":"                    self.core_plugin.update_port("},{"line_number":117,"context_line":"                        el, p[\u0027id\u0027], {\u0027port\u0027: {HOST_ID: trunk_host}})"},{"line_number":118,"context_line":"        return _core_subports"},{"line_number":119,"context_line":""},{"line_number":120,"context_line":"    def update_trunk_status(self, context, trunk_id, status):"},{"line_number":121,"context_line":"        \"\"\"Update the trunk status to reflect outcome of data plane wiring.\"\"\""}],"source_content_type":"text/x-python","patch_set":19,"id":"bacf61ea_aaef9685","line":118,"range":{"start_line":118,"start_character":7,"end_line":118,"end_character":29},"updated":"2016-08-04 21:23:25.000000000","message":"hmm now that I look at this, it will only return the _core_ports, (child_ports) for the last trunk in the list. \nI think we need to return more than that.","commit_id":"0add8405148c2df4b8ae49a885d75b49aff8bc98"},{"author":{"_account_id":13770,"name":"Adolfo Duarte","email":"adduarte@redhat.com","username":"adolfoduarte"},"change_message_id":"b85f2e1b0616ad216bb606ef1e528bea69a4804e","unresolved":false,"context_lines":[{"line_number":116,"context_line":"                if p.get(HOST_ID) !\u003d trunk_host:"},{"line_number":117,"context_line":"                    self.core_plugin.update_port("},{"line_number":118,"context_line":"                        el, p[\u0027id\u0027], {\u0027port\u0027: {HOST_ID: trunk_host}})"},{"line_number":119,"context_line":"            _child_subports[trunk] \u003d _core_subports"},{"line_number":120,"context_line":"        return _child_subports"},{"line_number":121,"context_line":""},{"line_number":122,"context_line":"    def update_trunk_status(self, context, trunk_id, status):"}],"source_content_type":"text/x-python","patch_set":21,"id":"bacf61ea_a3581f8b","line":119,"range":{"start_line":119,"start_character":27,"end_line":119,"end_character":33},"updated":"2016-08-06 04:47:35.000000000","message":"This is still not right. if trunk is of type dict it will not hash and can\u0027t be used as key in dictionary. I thinkis best to use the trunk_id which would need to have to get this far anyways.","commit_id":"253d16fa7c2028120d79728e60b0c581b487df1b"},{"author":{"_account_id":13770,"name":"Adolfo Duarte","email":"adduarte@redhat.com","username":"adolfoduarte"},"change_message_id":"3e9016d74b27065d4386e48620410de35d3ddeb4","unresolved":false,"context_lines":[{"line_number":116,"context_line":"                if p.get(HOST_ID) !\u003d trunk_host:"},{"line_number":117,"context_line":"                    self.core_plugin.update_port("},{"line_number":118,"context_line":"                        el, p[\u0027id\u0027], {\u0027port\u0027: {HOST_ID: trunk_host}})"},{"line_number":119,"context_line":"            _child_subports[trunk] \u003d _core_subports"},{"line_number":120,"context_line":"        return _child_subports"},{"line_number":121,"context_line":""},{"line_number":122,"context_line":"    def update_trunk_status(self, context, trunk_id, status):"}],"source_content_type":"text/x-python","patch_set":21,"id":"bacf61ea_a3e65fad","line":119,"range":{"start_line":119,"start_character":27,"end_line":119,"end_character":33},"in_reply_to":"bacf61ea_a3581f8b","updated":"2016-08-06 04:53:28.000000000","message":"On the other hand, with Trunk being of the ovo flavor why would any function not return a Trunk object?","commit_id":"253d16fa7c2028120d79728e60b0c581b487df1b"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"891327523647e50470a1c37116c56870c0b361ee","unresolved":false,"context_lines":[{"line_number":48,"context_line":""},{"line_number":49,"context_line":"def trunk_by_port_provider(resource, port_id, **kwargs):"},{"line_number":50,"context_line":"    \"\"\"Provider callback to supply trunk information by parent port.\"\"\""},{"line_number":51,"context_line":"    context \u003d kwargs.get(\u0027context\u0027)"},{"line_number":52,"context_line":"    if context is None:"},{"line_number":53,"context_line":"        LOG.debug("},{"line_number":54,"context_line":"            \u0027Received %(resource)s %(port_id)s without context\u0027,"}],"source_content_type":"text/x-python","patch_set":22,"id":"9ad45d7e_ec0003ad","line":51,"range":{"start_line":51,"start_character":14,"end_line":51,"end_character":35},"updated":"2016-08-08 20:54:05.000000000","message":"nit: Why not just add context to the list of arguments? It is a required parameter:\n\n  def trunk_by_port_provider(resource, port_id, context, **kwargs):\n\nIs it really a possibility that it would be called with context? And, if it does, do you really want to log at debug level and then return (essentially ignore that the method is not being called correctly)?","commit_id":"e512d27a030f0c0ff23a52ab38d5ada83522413a"},{"author":{"_account_id":13770,"name":"Adolfo Duarte","email":"adduarte@redhat.com","username":"adolfoduarte"},"change_message_id":"d0e9872bd37f395bb7f05117a6676025964af55c","unresolved":false,"context_lines":[{"line_number":48,"context_line":""},{"line_number":49,"context_line":"def trunk_by_port_provider(resource, port_id, **kwargs):"},{"line_number":50,"context_line":"    \"\"\"Provider callback to supply trunk information by parent port.\"\"\""},{"line_number":51,"context_line":"    context \u003d kwargs.get(\u0027context\u0027)"},{"line_number":52,"context_line":"    if context is None:"},{"line_number":53,"context_line":"        LOG.debug("},{"line_number":54,"context_line":"            \u0027Received %(resource)s %(port_id)s without context\u0027,"}],"source_content_type":"text/x-python","patch_set":22,"id":"9ad45d7e_22ba1fe2","line":51,"range":{"start_line":51,"start_character":14,"end_line":51,"end_character":35},"in_reply_to":"9ad45d7e_ec0003ad","updated":"2016-08-08 22:51:14.000000000","message":"Done","commit_id":"e512d27a030f0c0ff23a52ab38d5ada83522413a"},{"author":{"_account_id":6788,"name":"Rossella Sblendido","email":"rsblendido@suse.com","username":"rossella-o"},"change_message_id":"61559e4830fa9307accebfc0883388497606b1e6","unresolved":false,"context_lines":[{"line_number":95,"context_line":"        return self._trunk_plugin"},{"line_number":96,"context_line":""},{"line_number":97,"context_line":"    def update_subport_bindings(self, context, subports):"},{"line_number":98,"context_line":"        \"\"\"Update subport bindings to match parent port host binding.\"\"\""},{"line_number":99,"context_line":"        _child_subports \u003d {}"},{"line_number":100,"context_line":"        el \u003d context.elevated()"},{"line_number":101,"context_line":"        ports_by_trunk_id \u003d collections.defaultdict(list)"}],"source_content_type":"text/x-python","patch_set":22,"id":"9ad45d7e_3bc5fd8d","line":98,"range":{"start_line":98,"start_character":43,"end_line":98,"end_character":44},"updated":"2016-08-09 15:37:26.000000000","message":"nit: \"Update subport bindings to match trunk host bindings.\"","commit_id":"e512d27a030f0c0ff23a52ab38d5ada83522413a"},{"author":{"_account_id":13770,"name":"Adolfo Duarte","email":"adduarte@redhat.com","username":"adolfoduarte"},"change_message_id":"a5a9642380a2f3b2a0e0c5312054161ba6ab780a","unresolved":false,"context_lines":[{"line_number":95,"context_line":"        return self._trunk_plugin"},{"line_number":96,"context_line":""},{"line_number":97,"context_line":"    def update_subport_bindings(self, context, subports):"},{"line_number":98,"context_line":"        \"\"\"Update subport bindings to match parent port host binding.\"\"\""},{"line_number":99,"context_line":"        _child_subports \u003d {}"},{"line_number":100,"context_line":"        el \u003d context.elevated()"},{"line_number":101,"context_line":"        ports_by_trunk_id \u003d collections.defaultdict(list)"}],"source_content_type":"text/x-python","patch_set":22,"id":"9ad45d7e_aae866b5","line":98,"range":{"start_line":98,"start_character":43,"end_line":98,"end_character":44},"in_reply_to":"9ad45d7e_3bc5fd8d","updated":"2016-08-09 23:47:36.000000000","message":"Done","commit_id":"e512d27a030f0c0ff23a52ab38d5ada83522413a"},{"author":{"_account_id":8788,"name":"Miguel Angel Ajo","email":"mangelajo@redhat.com","username":"mangelajo"},"change_message_id":"4cb6881b3a442d1c079995ac885539aa60318e1c","unresolved":false,"context_lines":[{"line_number":103,"context_line":"            ports_by_trunk_id[s[\u0027trunk_id\u0027]].append(s[\u0027port_id\u0027])"},{"line_number":104,"context_line":"        for trunk_id, subports in ports_by_trunk_id.items():"},{"line_number":105,"context_line":"            # TODO(armax): consider what happens for partial failures"},{"line_number":106,"context_line":"            trunk \u003d self.trunk_plugin.get_trunk(el, trunk_id)"},{"line_number":107,"context_line":"            trunk_port_id \u003d trunk[\u0027port_id\u0027]"},{"line_number":108,"context_line":"            trunk_port \u003d self.core_plugin.get_port(el, trunk_port_id)"},{"line_number":109,"context_line":"            trunk_host \u003d trunk_port.get(HOST_ID)"}],"source_content_type":"text/x-python","patch_set":22,"id":"9ad45d7e_f8b9b8cc","line":106,"updated":"2016-08-09 12:31:54.000000000","message":"Given that this is the RPC layer, and not some abstract point up in the trunk plugin implementation.\nCouldn\u0027t you just do\n\nneutron.objects.trunk.Trunk.get_object(id \u003d trunk_id) ?\n\nand get rid of trunk_plugin attribute?","commit_id":"e512d27a030f0c0ff23a52ab38d5ada83522413a"},{"author":{"_account_id":13770,"name":"Adolfo Duarte","email":"adduarte@redhat.com","username":"adolfoduarte"},"change_message_id":"a5a9642380a2f3b2a0e0c5312054161ba6ab780a","unresolved":false,"context_lines":[{"line_number":103,"context_line":"            ports_by_trunk_id[s[\u0027trunk_id\u0027]].append(s[\u0027port_id\u0027])"},{"line_number":104,"context_line":"        for trunk_id, subports in ports_by_trunk_id.items():"},{"line_number":105,"context_line":"            # TODO(armax): consider what happens for partial failures"},{"line_number":106,"context_line":"            trunk \u003d self.trunk_plugin.get_trunk(el, trunk_id)"},{"line_number":107,"context_line":"            trunk_port_id \u003d trunk[\u0027port_id\u0027]"},{"line_number":108,"context_line":"            trunk_port \u003d self.core_plugin.get_port(el, trunk_port_id)"},{"line_number":109,"context_line":"            trunk_host \u003d trunk_port.get(HOST_ID)"}],"source_content_type":"text/x-python","patch_set":22,"id":"9ad45d7e_eaf9be81","line":106,"in_reply_to":"9ad45d7e_253caec7","updated":"2016-08-09 23:47:36.000000000","message":"will be making the change to use Trunk.get_object on next PS","commit_id":"e512d27a030f0c0ff23a52ab38d5ada83522413a"},{"author":{"_account_id":13770,"name":"Adolfo Duarte","email":"adduarte@redhat.com","username":"adolfoduarte"},"change_message_id":"a5a9642380a2f3b2a0e0c5312054161ba6ab780a","unresolved":false,"context_lines":[{"line_number":103,"context_line":"            ports_by_trunk_id[s[\u0027trunk_id\u0027]].append(s[\u0027port_id\u0027])"},{"line_number":104,"context_line":"        for trunk_id, subports in ports_by_trunk_id.items():"},{"line_number":105,"context_line":"            # TODO(armax): consider what happens for partial failures"},{"line_number":106,"context_line":"            trunk \u003d self.trunk_plugin.get_trunk(el, trunk_id)"},{"line_number":107,"context_line":"            trunk_port_id \u003d trunk[\u0027port_id\u0027]"},{"line_number":108,"context_line":"            trunk_port \u003d self.core_plugin.get_port(el, trunk_port_id)"},{"line_number":109,"context_line":"            trunk_host \u003d trunk_port.get(HOST_ID)"}],"source_content_type":"text/x-python","patch_set":22,"id":"9ad45d7e_2add960e","line":106,"in_reply_to":"9ad45d7e_f8b9b8cc","updated":"2016-08-09 23:47:36.000000000","message":"Done","commit_id":"e512d27a030f0c0ff23a52ab38d5ada83522413a"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"4a1d800180cfb7b504aeb176841a5e2f0f82defd","unresolved":false,"context_lines":[{"line_number":103,"context_line":"            ports_by_trunk_id[s[\u0027trunk_id\u0027]].append(s[\u0027port_id\u0027])"},{"line_number":104,"context_line":"        for trunk_id, subports in ports_by_trunk_id.items():"},{"line_number":105,"context_line":"            # TODO(armax): consider what happens for partial failures"},{"line_number":106,"context_line":"            trunk \u003d self.trunk_plugin.get_trunk(el, trunk_id)"},{"line_number":107,"context_line":"            trunk_port_id \u003d trunk[\u0027port_id\u0027]"},{"line_number":108,"context_line":"            trunk_port \u003d self.core_plugin.get_port(el, trunk_port_id)"},{"line_number":109,"context_line":"            trunk_host \u003d trunk_port.get(HOST_ID)"}],"source_content_type":"text/x-python","patch_set":22,"id":"9ad45d7e_253caec7","line":106,"in_reply_to":"9ad45d7e_f8b9b8cc","updated":"2016-08-09 21:08:32.000000000","message":"see line 89 :)","commit_id":"e512d27a030f0c0ff23a52ab38d5ada83522413a"},{"author":{"_account_id":8788,"name":"Miguel Angel Ajo","email":"mangelajo@redhat.com","username":"mangelajo"},"change_message_id":"4cb6881b3a442d1c079995ac885539aa60318e1c","unresolved":false,"context_lines":[{"line_number":104,"context_line":"        for trunk_id, subports in ports_by_trunk_id.items():"},{"line_number":105,"context_line":"            # TODO(armax): consider what happens for partial failures"},{"line_number":106,"context_line":"            trunk \u003d self.trunk_plugin.get_trunk(el, trunk_id)"},{"line_number":107,"context_line":"            trunk_port_id \u003d trunk[\u0027port_id\u0027]"},{"line_number":108,"context_line":"            trunk_port \u003d self.core_plugin.get_port(el, trunk_port_id)"},{"line_number":109,"context_line":"            trunk_host \u003d trunk_port.get(HOST_ID)"},{"line_number":110,"context_line":"            if not trunk_host:"}],"source_content_type":"text/x-python","patch_set":22,"id":"9ad45d7e_d87834f5","line":107,"updated":"2016-08-09 12:31:54.000000000","message":"trunk.port_id then.","commit_id":"e512d27a030f0c0ff23a52ab38d5ada83522413a"},{"author":{"_account_id":13770,"name":"Adolfo Duarte","email":"adduarte@redhat.com","username":"adolfoduarte"},"change_message_id":"a5a9642380a2f3b2a0e0c5312054161ba6ab780a","unresolved":false,"context_lines":[{"line_number":104,"context_line":"        for trunk_id, subports in ports_by_trunk_id.items():"},{"line_number":105,"context_line":"            # TODO(armax): consider what happens for partial failures"},{"line_number":106,"context_line":"            trunk \u003d self.trunk_plugin.get_trunk(el, trunk_id)"},{"line_number":107,"context_line":"            trunk_port_id \u003d trunk[\u0027port_id\u0027]"},{"line_number":108,"context_line":"            trunk_port \u003d self.core_plugin.get_port(el, trunk_port_id)"},{"line_number":109,"context_line":"            trunk_host \u003d trunk_port.get(HOST_ID)"},{"line_number":110,"context_line":"            if not trunk_host:"}],"source_content_type":"text/x-python","patch_set":22,"id":"9ad45d7e_aa0d0692","line":107,"in_reply_to":"9ad45d7e_d87834f5","updated":"2016-08-09 23:47:36.000000000","message":"Done","commit_id":"e512d27a030f0c0ff23a52ab38d5ada83522413a"},{"author":{"_account_id":8788,"name":"Miguel Angel Ajo","email":"mangelajo@redhat.com","username":"mangelajo"},"change_message_id":"4cb6881b3a442d1c079995ac885539aa60318e1c","unresolved":false,"context_lines":[{"line_number":105,"context_line":"            # TODO(armax): consider what happens for partial failures"},{"line_number":106,"context_line":"            trunk \u003d self.trunk_plugin.get_trunk(el, trunk_id)"},{"line_number":107,"context_line":"            trunk_port_id \u003d trunk[\u0027port_id\u0027]"},{"line_number":108,"context_line":"            trunk_port \u003d self.core_plugin.get_port(el, trunk_port_id)"},{"line_number":109,"context_line":"            trunk_host \u003d trunk_port.get(HOST_ID)"},{"line_number":110,"context_line":"            if not trunk_host:"},{"line_number":111,"context_line":"                LOG.warning(_LW(\"Agent requested binding update on unbound \""}],"source_content_type":"text/x-python","patch_set":22,"id":"9ad45d7e_381070a8","line":108,"updated":"2016-08-09 12:31:54.000000000","message":"no Port object yet \u0027:D tsk! :)","commit_id":"e512d27a030f0c0ff23a52ab38d5ada83522413a"},{"author":{"_account_id":13770,"name":"Adolfo Duarte","email":"adduarte@redhat.com","username":"adolfoduarte"},"change_message_id":"a5a9642380a2f3b2a0e0c5312054161ba6ab780a","unresolved":false,"context_lines":[{"line_number":105,"context_line":"            # TODO(armax): consider what happens for partial failures"},{"line_number":106,"context_line":"            trunk \u003d self.trunk_plugin.get_trunk(el, trunk_id)"},{"line_number":107,"context_line":"            trunk_port_id \u003d trunk[\u0027port_id\u0027]"},{"line_number":108,"context_line":"            trunk_port \u003d self.core_plugin.get_port(el, trunk_port_id)"},{"line_number":109,"context_line":"            trunk_host \u003d trunk_port.get(HOST_ID)"},{"line_number":110,"context_line":"            if not trunk_host:"},{"line_number":111,"context_line":"                LOG.warning(_LW(\"Agent requested binding update on unbound \""}],"source_content_type":"text/x-python","patch_set":22,"id":"9ad45d7e_2a22b600","line":108,"in_reply_to":"9ad45d7e_381070a8","updated":"2016-08-09 23:47:36.000000000","message":"we\u0027ll have to leave this as a TODO... see L90","commit_id":"e512d27a030f0c0ff23a52ab38d5ada83522413a"},{"author":{"_account_id":4187,"name":"Ryan Tidwell","email":"rtidwell@suse.com","username":"ryan-tidwell"},"change_message_id":"383aaf8a7f4af441b1e7d6cf7fb4a81d8592c79d","unresolved":false,"context_lines":[{"line_number":96,"context_line":"                LOG.warning(_LW(\"Agent requested binding update on unbound \""},{"line_number":97,"context_line":"                                \"trunk %s\"), trunk_id)"},{"line_number":98,"context_line":"                continue"},{"line_number":99,"context_line":"            _core_subports \u003d self.core_plugin.get_ports(el, {\u0027id\u0027: subports})"},{"line_number":100,"context_line":"            for p in _core_subports:"},{"line_number":101,"context_line":"                if p.get(HOST_ID) !\u003d trunk_host:"},{"line_number":102,"context_line":"                    self.core_plugin.update_port("}],"source_content_type":"text/x-python","patch_set":23,"id":"9ad45d7e_97e81eb6","line":99,"range":{"start_line":99,"start_character":56,"end_line":99,"end_character":58},"updated":"2016-08-10 06:34:37.000000000","message":"Is there a reason for elevating context here and L104, but not on L89?","commit_id":"028a0035130483ceb21ac50e747db1f3e343092d"},{"author":{"_account_id":13770,"name":"Adolfo Duarte","email":"adduarte@redhat.com","username":"adolfoduarte"},"change_message_id":"581e7109cc0b8e6fe486ad7ebed85d0d7996132d","unresolved":false,"context_lines":[{"line_number":96,"context_line":"                LOG.warning(_LW(\"Agent requested binding update on unbound \""},{"line_number":97,"context_line":"                                \"trunk %s\"), trunk_id)"},{"line_number":98,"context_line":"                continue"},{"line_number":99,"context_line":"            _core_subports \u003d self.core_plugin.get_ports(el, {\u0027id\u0027: subports})"},{"line_number":100,"context_line":"            for p in _core_subports:"},{"line_number":101,"context_line":"                if p.get(HOST_ID) !\u003d trunk_host:"},{"line_number":102,"context_line":"                    self.core_plugin.update_port("}],"source_content_type":"text/x-python","patch_set":23,"id":"9ad45d7e_d25f443f","line":99,"range":{"start_line":99,"start_character":56,"end_line":99,"end_character":58},"in_reply_to":"9ad45d7e_97e81eb6","updated":"2016-08-10 07:19:46.000000000","message":"mistake. will fix","commit_id":"028a0035130483ceb21ac50e747db1f3e343092d"},{"author":{"_account_id":13770,"name":"Adolfo Duarte","email":"adduarte@redhat.com","username":"adolfoduarte"},"change_message_id":"e9716fc28a847df6e8d857cab7483c7eede1c1db","unresolved":false,"context_lines":[{"line_number":96,"context_line":"                LOG.warning(_LW(\"Agent requested binding update on unbound \""},{"line_number":97,"context_line":"                                \"trunk %s\"), trunk_id)"},{"line_number":98,"context_line":"                continue"},{"line_number":99,"context_line":"            _core_subports \u003d self.core_plugin.get_ports(el, {\u0027id\u0027: subports})"},{"line_number":100,"context_line":"            for p in _core_subports:"},{"line_number":101,"context_line":"                if p.get(HOST_ID) !\u003d trunk_host:"},{"line_number":102,"context_line":"                    self.core_plugin.update_port("}],"source_content_type":"text/x-python","patch_set":23,"id":"9ad45d7e_dff55aed","line":99,"range":{"start_line":99,"start_character":56,"end_line":99,"end_character":58},"in_reply_to":"9ad45d7e_d25f443f","updated":"2016-08-10 22:50:24.000000000","message":"Done","commit_id":"028a0035130483ceb21ac50e747db1f3e343092d"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"2ebbaa4067646df80ccfecf2e9ba1078477fff76","unresolved":false,"context_lines":[{"line_number":77,"context_line":"        if not self._core_plugin:"},{"line_number":78,"context_line":"            self._core_plugin \u003d manager.NeutronManager.get_plugin()"},{"line_number":79,"context_line":"        return self._core_plugin"},{"line_number":80,"context_line":""},{"line_number":81,"context_line":"    def update_subport_bindings(self, context, subports):"},{"line_number":82,"context_line":"        \"\"\"Update subport bindings to match trunk host binding.\"\"\""},{"line_number":83,"context_line":"        _child_subports \u003d {}"}],"source_content_type":"text/x-python","patch_set":24,"id":"9ad45d7e_9250f933","line":80,"updated":"2016-08-10 23:52:22.000000000","message":"So to recap, I think there are a couple of scenarios we need to be aware of here. Assumed the fact that the agent invokes this method to acknowledge that a subport is being processed and data plane wiring is taking place, then I believe that all subports must have their binding host match the parent port\u0027s binding host. In particular, I see the following use cases:\n\n1) VM Delete, Trunk delete\n2) Subport detach from trunk A, Subport attach to trunk B (or equivalent one: interface detach from VM A, interface attach to VM B).\n\nThere may be more, but these seem the most obvious ones. If these happen in short sequence or in face of failures, then we might be exposed to potential races or stale bindings (unless we rectify of course :))\n\nLooking at conditions 90, 95 and 101, if we keep condition 90 in place we risk having stale bindings on the subports for use case 1, that\u0027s probably not the end of the world. We can solve this in a number of ways, but nothing that can\u0027t be done as a follow up.\n\nAs for condition 95, I think we want to remove it to allow the subport\u0027s binding to be cleared when operations of use case 1 do indeed happen \u0027slowly\u0027. As for condition 101, I think we want to remove it to make sure all subports match the parent port\u0027s binding when, in use case 2, two agents are involved in the process of updating the trunk or trunks.","commit_id":"b5a5684dcafed2ed1da5d8fe25434f09fe0edf81"},{"author":{"_account_id":13770,"name":"Adolfo Duarte","email":"adduarte@redhat.com","username":"adolfoduarte"},"change_message_id":"8330b4a5aeb9b8925e99e1349b0fe2f50b1c4c70","unresolved":false,"context_lines":[{"line_number":77,"context_line":"        if not self._core_plugin:"},{"line_number":78,"context_line":"            self._core_plugin \u003d manager.NeutronManager.get_plugin()"},{"line_number":79,"context_line":"        return self._core_plugin"},{"line_number":80,"context_line":""},{"line_number":81,"context_line":"    def update_subport_bindings(self, context, subports):"},{"line_number":82,"context_line":"        \"\"\"Update subport bindings to match trunk host binding.\"\"\""},{"line_number":83,"context_line":"        _child_subports \u003d {}"}],"source_content_type":"text/x-python","patch_set":24,"id":"9ad45d7e_4eaed598","line":80,"in_reply_to":"9ad45d7e_9250f933","updated":"2016-08-11 05:59:26.000000000","message":"Removing condition on 95\nRemoving condition on 101","commit_id":"b5a5684dcafed2ed1da5d8fe25434f09fe0edf81"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"c05eaa37f5f8417d577768c3d45b179afbe297dd","unresolved":false,"context_lines":[{"line_number":78,"context_line":"            self._core_plugin \u003d manager.NeutronManager.get_plugin()"},{"line_number":79,"context_line":"        return self._core_plugin"},{"line_number":80,"context_line":""},{"line_number":81,"context_line":"    def update_subport_bindings(self, context, subports):"},{"line_number":82,"context_line":"        \"\"\"Update subport bindings to match trunk host binding.\"\"\""},{"line_number":83,"context_line":"        _child_subports \u003d {}"},{"line_number":84,"context_line":"        el \u003d context.elevated()"}],"source_content_type":"text/x-python","patch_set":24,"id":"9ad45d7e_278116c4","line":81,"updated":"2016-08-10 21:23:53.000000000","message":"It would be great to expand on the docstring here: so are we expecting to have a list of subports that may be potentially belong to different trunks? I\u0027d like to have Kevin chime in who was the one drafting this method for the first time.","commit_id":"b5a5684dcafed2ed1da5d8fe25434f09fe0edf81"},{"author":{"_account_id":13770,"name":"Adolfo Duarte","email":"adduarte@redhat.com","username":"adolfoduarte"},"change_message_id":"ebc41b82734d2b5898f7f92534b0bfb33eb81314","unresolved":false,"context_lines":[{"line_number":78,"context_line":"            self._core_plugin \u003d manager.NeutronManager.get_plugin()"},{"line_number":79,"context_line":"        return self._core_plugin"},{"line_number":80,"context_line":""},{"line_number":81,"context_line":"    def update_subport_bindings(self, context, subports):"},{"line_number":82,"context_line":"        \"\"\"Update subport bindings to match trunk host binding.\"\"\""},{"line_number":83,"context_line":"        _child_subports \u003d {}"},{"line_number":84,"context_line":"        el \u003d context.elevated()"}],"source_content_type":"text/x-python","patch_set":24,"id":"9ad45d7e_bfa226ac","line":81,"in_reply_to":"9ad45d7e_278116c4","updated":"2016-08-10 23:38:58.000000000","message":"As it stands, yes this method should be able to handle a list of subports with multiple trunk_ids, \nand it returns a dictionary using trunk_ids as keys with list of ports for each particular trunk.","commit_id":"b5a5684dcafed2ed1da5d8fe25434f09fe0edf81"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"44deb1d4377c78d95b5815cab048666cc768e745","unresolved":false,"context_lines":[{"line_number":79,"context_line":"        return self._core_plugin"},{"line_number":80,"context_line":""},{"line_number":81,"context_line":"    def update_subport_bindings(self, context, subports):"},{"line_number":82,"context_line":"        \"\"\"Update subport bindings to match trunk host binding.\"\"\""},{"line_number":83,"context_line":"        _child_subports \u003d {}"},{"line_number":84,"context_line":"        el \u003d context.elevated()"},{"line_number":85,"context_line":"        ports_by_trunk_id \u003d collections.defaultdict(list)"}],"source_content_type":"text/x-python","patch_set":24,"id":"9ad45d7e_68a92824","line":82,"updated":"2016-08-10 17:38:56.000000000","message":"I think this method implementation needs some considerations wrt to failures and concurrency. We also need to add state machine transition into place. I think it\u0027s by far complete however it gets the objective across, ie. allow the agent to collaborate with the server the subport binding process.\n\nNow we can decide to punt on it for the time being, wait for the agent side to solidify a bit more and revise accordingly or iterate in the vacuum. I think the former may turn out to be more productive, and we can assume that this simply a v1 of this method with few iterations to take place in follow up patches.","commit_id":"b5a5684dcafed2ed1da5d8fe25434f09fe0edf81"},{"author":{"_account_id":13770,"name":"Adolfo Duarte","email":"adduarte@redhat.com","username":"adolfoduarte"},"change_message_id":"ebc41b82734d2b5898f7f92534b0bfb33eb81314","unresolved":false,"context_lines":[{"line_number":79,"context_line":"        return self._core_plugin"},{"line_number":80,"context_line":""},{"line_number":81,"context_line":"    def update_subport_bindings(self, context, subports):"},{"line_number":82,"context_line":"        \"\"\"Update subport bindings to match trunk host binding.\"\"\""},{"line_number":83,"context_line":"        _child_subports \u003d {}"},{"line_number":84,"context_line":"        el \u003d context.elevated()"},{"line_number":85,"context_line":"        ports_by_trunk_id \u003d collections.defaultdict(list)"}],"source_content_type":"text/x-python","patch_set":24,"id":"9ad45d7e_df843a0c","line":82,"in_reply_to":"9ad45d7e_68a92824","updated":"2016-08-10 23:38:58.000000000","message":"Agreed, we need more information about agent expected behavior before we can make this method more robust. Particularly we need to know what the agent expects as the returned data.","commit_id":"b5a5684dcafed2ed1da5d8fe25434f09fe0edf81"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"c05eaa37f5f8417d577768c3d45b179afbe297dd","unresolved":false,"context_lines":[{"line_number":87,"context_line":"            ports_by_trunk_id[s[\u0027trunk_id\u0027]].append(s[\u0027port_id\u0027])"},{"line_number":88,"context_line":"        for trunk_id, subports in ports_by_trunk_id.items():"},{"line_number":89,"context_line":"            trunk \u003d trunk_objects.Trunk.get_object(el, id\u003dtrunk_id)"},{"line_number":90,"context_line":"            if not trunk:"},{"line_number":91,"context_line":"                continue"},{"line_number":92,"context_line":"            trunk_port_id \u003d trunk.port_id"},{"line_number":93,"context_line":"            trunk_port \u003d self.core_plugin.get_port(el, trunk_port_id)"}],"source_content_type":"text/x-python","patch_set":24,"id":"9ad45d7e_025a002a","line":90,"updated":"2016-08-10 21:23:53.000000000","message":"Let\u0027s think about this scenario a bit more: the agent has subports of a trunk that is no longer present.\n\nNow a trunk can be deleted only if its parent port is unbound. Therefore this situation may happen when in short sequence the following happens:\n\n1) VM is deleted, then it turns will alert the agent that the physical port is gone.\n2) Parent port binding is cleared\n3) user deletes the trunk (as he/she can).\n4) the agent is lagging behind.\n\nIf we continue, there\u0027s a chance we leave all the subports binding in stale state, and that\u0027s bad. We should probably reconsider preventing trunk deletion if any of the ports participating in the trunk (parent + subports) are still bound to allow the agent to catch up.\n\nWe can fix that, but perhaps a debug trace would be nice.","commit_id":"b5a5684dcafed2ed1da5d8fe25434f09fe0edf81"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"a36e8a0c1785c62c2dbd6fbef1ee5a9b62ae3a96","unresolved":false,"context_lines":[{"line_number":87,"context_line":"            ports_by_trunk_id[s[\u0027trunk_id\u0027]].append(s[\u0027port_id\u0027])"},{"line_number":88,"context_line":"        for trunk_id, subports in ports_by_trunk_id.items():"},{"line_number":89,"context_line":"            trunk \u003d trunk_objects.Trunk.get_object(el, id\u003dtrunk_id)"},{"line_number":90,"context_line":"            if not trunk:"},{"line_number":91,"context_line":"                continue"},{"line_number":92,"context_line":"            trunk_port_id \u003d trunk.port_id"},{"line_number":93,"context_line":"            trunk_port \u003d self.core_plugin.get_port(el, trunk_port_id)"}],"source_content_type":"text/x-python","patch_set":24,"id":"9ad45d7e_8d4901ba","line":90,"in_reply_to":"9ad45d7e_025a002a","updated":"2016-08-10 21:49:50.000000000","message":"Let\u0027s mull over on this a bit, perhaps a stale binding is not so bad, for now we can definitely emit a trace and err on the side of caution.","commit_id":"b5a5684dcafed2ed1da5d8fe25434f09fe0edf81"},{"author":{"_account_id":13770,"name":"Adolfo Duarte","email":"adduarte@redhat.com","username":"adolfoduarte"},"change_message_id":"ebc41b82734d2b5898f7f92534b0bfb33eb81314","unresolved":false,"context_lines":[{"line_number":87,"context_line":"            ports_by_trunk_id[s[\u0027trunk_id\u0027]].append(s[\u0027port_id\u0027])"},{"line_number":88,"context_line":"        for trunk_id, subports in ports_by_trunk_id.items():"},{"line_number":89,"context_line":"            trunk \u003d trunk_objects.Trunk.get_object(el, id\u003dtrunk_id)"},{"line_number":90,"context_line":"            if not trunk:"},{"line_number":91,"context_line":"                continue"},{"line_number":92,"context_line":"            trunk_port_id \u003d trunk.port_id"},{"line_number":93,"context_line":"            trunk_port \u003d self.core_plugin.get_port(el, trunk_port_id)"}],"source_content_type":"text/x-python","patch_set":24,"id":"9ad45d7e_52fe81ae","line":90,"in_reply_to":"9ad45d7e_8d4901ba","updated":"2016-08-10 23:38:58.000000000","message":"what about if we approach from the other side. \nOn trunk deletion, all the trunk\u0027s subports are unbound. It would catch any stale bindings we might leave behind here.","commit_id":"b5a5684dcafed2ed1da5d8fe25434f09fe0edf81"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"c05eaa37f5f8417d577768c3d45b179afbe297dd","unresolved":false,"context_lines":[{"line_number":92,"context_line":"            trunk_port_id \u003d trunk.port_id"},{"line_number":93,"context_line":"            trunk_port \u003d self.core_plugin.get_port(el, trunk_port_id)"},{"line_number":94,"context_line":"            trunk_host \u003d trunk_port.get(HOST_ID)"},{"line_number":95,"context_line":"            if not trunk_host:"},{"line_number":96,"context_line":"                LOG.warning(_LW(\"Agent requested binding update on unbound \""},{"line_number":97,"context_line":"                                \"trunk %s\"), trunk_id)"},{"line_number":98,"context_line":"                continue"}],"source_content_type":"text/x-python","patch_set":24,"id":"9ad45d7e_825d5017","line":95,"updated":"2016-08-10 21:23:53.000000000","message":"I think that if we fixed the situation as described at line 90 we should never hit here and if we do we should probably log at erorr and tell the admin to file a bug :)","commit_id":"b5a5684dcafed2ed1da5d8fe25434f09fe0edf81"},{"author":{"_account_id":13770,"name":"Adolfo Duarte","email":"adduarte@redhat.com","username":"adolfoduarte"},"change_message_id":"ebc41b82734d2b5898f7f92534b0bfb33eb81314","unresolved":false,"context_lines":[{"line_number":92,"context_line":"            trunk_port_id \u003d trunk.port_id"},{"line_number":93,"context_line":"            trunk_port \u003d self.core_plugin.get_port(el, trunk_port_id)"},{"line_number":94,"context_line":"            trunk_host \u003d trunk_port.get(HOST_ID)"},{"line_number":95,"context_line":"            if not trunk_host:"},{"line_number":96,"context_line":"                LOG.warning(_LW(\"Agent requested binding update on unbound \""},{"line_number":97,"context_line":"                                \"trunk %s\"), trunk_id)"},{"line_number":98,"context_line":"                continue"}],"source_content_type":"text/x-python","patch_set":24,"id":"9ad45d7e_d25a71f1","line":95,"in_reply_to":"9ad45d7e_825d5017","updated":"2016-08-10 23:38:58.000000000","message":"The only way we can reach this code is if the parent_port is unbound at the moment the get_port call is made. It seems very unlikely but still not convinced it is impossible. Lets change this to an Error instead of warning.","commit_id":"b5a5684dcafed2ed1da5d8fe25434f09fe0edf81"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"2ebbaa4067646df80ccfecf2e9ba1078477fff76","unresolved":false,"context_lines":[{"line_number":96,"context_line":"                LOG.warning(_LW(\"Agent requested binding update on unbound \""},{"line_number":97,"context_line":"                                \"trunk %s\"), trunk_id)"},{"line_number":98,"context_line":"                continue"},{"line_number":99,"context_line":"            _core_subports \u003d self.core_plugin.get_ports(el, {\u0027id\u0027: subports})"},{"line_number":100,"context_line":"            for p in _core_subports:"},{"line_number":101,"context_line":"                if p.get(HOST_ID) !\u003d trunk_host:"},{"line_number":102,"context_line":"                    self.core_plugin.update_port("}],"source_content_type":"text/x-python","patch_set":24,"id":"9ad45d7e_b5836755","line":99,"updated":"2016-08-10 23:52:22.000000000","message":"if we skip condition 101 then we can avoid this call as we already have the IDs.","commit_id":"b5a5684dcafed2ed1da5d8fe25434f09fe0edf81"},{"author":{"_account_id":13770,"name":"Adolfo Duarte","email":"adduarte@redhat.com","username":"adolfoduarte"},"change_message_id":"8330b4a5aeb9b8925e99e1349b0fe2f50b1c4c70","unresolved":false,"context_lines":[{"line_number":96,"context_line":"                LOG.warning(_LW(\"Agent requested binding update on unbound \""},{"line_number":97,"context_line":"                                \"trunk %s\"), trunk_id)"},{"line_number":98,"context_line":"                continue"},{"line_number":99,"context_line":"            _core_subports \u003d self.core_plugin.get_ports(el, {\u0027id\u0027: subports})"},{"line_number":100,"context_line":"            for p in _core_subports:"},{"line_number":101,"context_line":"                if p.get(HOST_ID) !\u003d trunk_host:"},{"line_number":102,"context_line":"                    self.core_plugin.update_port("}],"source_content_type":"text/x-python","patch_set":24,"id":"9ad45d7e_4e01b569","line":99,"in_reply_to":"9ad45d7e_b5836755","updated":"2016-08-11 05:59:26.000000000","message":"Done","commit_id":"b5a5684dcafed2ed1da5d8fe25434f09fe0edf81"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"c05eaa37f5f8417d577768c3d45b179afbe297dd","unresolved":false,"context_lines":[{"line_number":98,"context_line":"                continue"},{"line_number":99,"context_line":"            _core_subports \u003d self.core_plugin.get_ports(el, {\u0027id\u0027: subports})"},{"line_number":100,"context_line":"            for p in _core_subports:"},{"line_number":101,"context_line":"                if p.get(HOST_ID) !\u003d trunk_host:"},{"line_number":102,"context_line":"                    self.core_plugin.update_port("},{"line_number":103,"context_line":"                        el, p[\u0027id\u0027], {\u0027port\u0027: {HOST_ID: trunk_host}})"},{"line_number":104,"context_line":"            updated_ports \u003d self.core_plugin.get_ports(el, {\u0027id\u0027: subports})"}],"source_content_type":"text/x-python","patch_set":24,"id":"9ad45d7e_027fa066","line":101,"updated":"2016-08-10 21:23:53.000000000","message":"In case p.get(HOST_ID) is not empty, I think there\u0027s an error because we shouldn\u0027t re-bind a bound port.","commit_id":"b5a5684dcafed2ed1da5d8fe25434f09fe0edf81"},{"author":{"_account_id":13770,"name":"Adolfo Duarte","email":"adduarte@redhat.com","username":"adolfoduarte"},"change_message_id":"ebc41b82734d2b5898f7f92534b0bfb33eb81314","unresolved":false,"context_lines":[{"line_number":98,"context_line":"                continue"},{"line_number":99,"context_line":"            _core_subports \u003d self.core_plugin.get_ports(el, {\u0027id\u0027: subports})"},{"line_number":100,"context_line":"            for p in _core_subports:"},{"line_number":101,"context_line":"                if p.get(HOST_ID) !\u003d trunk_host:"},{"line_number":102,"context_line":"                    self.core_plugin.update_port("},{"line_number":103,"context_line":"                        el, p[\u0027id\u0027], {\u0027port\u0027: {HOST_ID: trunk_host}})"},{"line_number":104,"context_line":"            updated_ports \u003d self.core_plugin.get_ports(el, {\u0027id\u0027: subports})"}],"source_content_type":"text/x-python","patch_set":24,"id":"9ad45d7e_32978d49","line":101,"in_reply_to":"9ad45d7e_027fa066","updated":"2016-08-10 23:38:58.000000000","message":"good point.\nDone","commit_id":"b5a5684dcafed2ed1da5d8fe25434f09fe0edf81"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"c05eaa37f5f8417d577768c3d45b179afbe297dd","unresolved":false,"context_lines":[{"line_number":101,"context_line":"                if p.get(HOST_ID) !\u003d trunk_host:"},{"line_number":102,"context_line":"                    self.core_plugin.update_port("},{"line_number":103,"context_line":"                        el, p[\u0027id\u0027], {\u0027port\u0027: {HOST_ID: trunk_host}})"},{"line_number":104,"context_line":"            updated_ports \u003d self.core_plugin.get_ports(el, {\u0027id\u0027: subports})"},{"line_number":105,"context_line":"            _child_subports[trunk_id] \u003d updated_ports"},{"line_number":106,"context_line":"        return _child_subports"},{"line_number":107,"context_line":""}],"source_content_type":"text/x-python","patch_set":24,"id":"9ad45d7e_a2bcd406","line":104,"updated":"2016-08-10 21:23:53.000000000","message":"I am on the fence as to whether we need to acquire ports again, however, we may want to wrap this line into a util method that potentially extract only what we care about the port details to return to the agent as the port object may be pretty big and perhaps all we need is just the network, mac address and a few other attributes.","commit_id":"b5a5684dcafed2ed1da5d8fe25434f09fe0edf81"},{"author":{"_account_id":13770,"name":"Adolfo Duarte","email":"adduarte@redhat.com","username":"adolfoduarte"},"change_message_id":"8330b4a5aeb9b8925e99e1349b0fe2f50b1c4c70","unresolved":false,"context_lines":[{"line_number":101,"context_line":"                if p.get(HOST_ID) !\u003d trunk_host:"},{"line_number":102,"context_line":"                    self.core_plugin.update_port("},{"line_number":103,"context_line":"                        el, p[\u0027id\u0027], {\u0027port\u0027: {HOST_ID: trunk_host}})"},{"line_number":104,"context_line":"            updated_ports \u003d self.core_plugin.get_ports(el, {\u0027id\u0027: subports})"},{"line_number":105,"context_line":"            _child_subports[trunk_id] \u003d updated_ports"},{"line_number":106,"context_line":"        return _child_subports"},{"line_number":107,"context_line":""}],"source_content_type":"text/x-python","patch_set":24,"id":"9ad45d7e_79ae01e7","line":104,"in_reply_to":"9ad45d7e_72f0e591","updated":"2016-08-11 05:59:26.000000000","message":"with the changes introduced by removing condition on 95 and contidion on 101 we should make this a dictionary of subport_id lists\nDONE","commit_id":"b5a5684dcafed2ed1da5d8fe25434f09fe0edf81"},{"author":{"_account_id":13770,"name":"Adolfo Duarte","email":"adduarte@redhat.com","username":"adolfoduarte"},"change_message_id":"ebc41b82734d2b5898f7f92534b0bfb33eb81314","unresolved":false,"context_lines":[{"line_number":101,"context_line":"                if p.get(HOST_ID) !\u003d trunk_host:"},{"line_number":102,"context_line":"                    self.core_plugin.update_port("},{"line_number":103,"context_line":"                        el, p[\u0027id\u0027], {\u0027port\u0027: {HOST_ID: trunk_host}})"},{"line_number":104,"context_line":"            updated_ports \u003d self.core_plugin.get_ports(el, {\u0027id\u0027: subports})"},{"line_number":105,"context_line":"            _child_subports[trunk_id] \u003d updated_ports"},{"line_number":106,"context_line":"        return _child_subports"},{"line_number":107,"context_line":""}],"source_content_type":"text/x-python","patch_set":24,"id":"9ad45d7e_72f0e591","line":104,"in_reply_to":"9ad45d7e_a2bcd406","updated":"2016-08-10 23:38:58.000000000","message":"The thinking here was that the caller of the method can do some checking of its own with the returned data, which means we should return a data structure containing the final state of the subports. But I think the idea of triming that down to only necessary info is good. We\u0027ll need to wait on agent to solidify as you mentioned above.","commit_id":"b5a5684dcafed2ed1da5d8fe25434f09fe0edf81"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"c05eaa37f5f8417d577768c3d45b179afbe297dd","unresolved":false,"context_lines":[{"line_number":107,"context_line":""},{"line_number":108,"context_line":"    def update_trunk_status(self, context, trunk_id, status):"},{"line_number":109,"context_line":"        \"\"\"Update the trunk status to reflect outcome of data plane wiring.\"\"\""},{"line_number":110,"context_line":"        el \u003d context.elevated()"},{"line_number":111,"context_line":"        trunk \u003d trunk_objects.Trunk.get_object(el, id\u003dtrunk_id)"},{"line_number":112,"context_line":"        if trunk:"},{"line_number":113,"context_line":"            trunk.status \u003d status"}],"source_content_type":"text/x-python","patch_set":24,"id":"9ad45d7e_624dbc3d","line":110,"updated":"2016-08-10 21:23:53.000000000","message":"no need to elevate.","commit_id":"b5a5684dcafed2ed1da5d8fe25434f09fe0edf81"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"2ebbaa4067646df80ccfecf2e9ba1078477fff76","unresolved":false,"context_lines":[{"line_number":107,"context_line":""},{"line_number":108,"context_line":"    def update_trunk_status(self, context, trunk_id, status):"},{"line_number":109,"context_line":"        \"\"\"Update the trunk status to reflect outcome of data plane wiring.\"\"\""},{"line_number":110,"context_line":"        el \u003d context.elevated()"},{"line_number":111,"context_line":"        trunk \u003d trunk_objects.Trunk.get_object(el, id\u003dtrunk_id)"},{"line_number":112,"context_line":"        if trunk:"},{"line_number":113,"context_line":"            trunk.status \u003d status"}],"source_content_type":"text/x-python","patch_set":24,"id":"9ad45d7e_522a0191","line":110,"in_reply_to":"9ad45d7e_32414daa","updated":"2016-08-10 23:52:22.000000000","message":"um, you may be right we need to elevate here, disregard my comment","commit_id":"b5a5684dcafed2ed1da5d8fe25434f09fe0edf81"},{"author":{"_account_id":13770,"name":"Adolfo Duarte","email":"adduarte@redhat.com","username":"adolfoduarte"},"change_message_id":"ebc41b82734d2b5898f7f92534b0bfb33eb81314","unresolved":false,"context_lines":[{"line_number":107,"context_line":""},{"line_number":108,"context_line":"    def update_trunk_status(self, context, trunk_id, status):"},{"line_number":109,"context_line":"        \"\"\"Update the trunk status to reflect outcome of data plane wiring.\"\"\""},{"line_number":110,"context_line":"        el \u003d context.elevated()"},{"line_number":111,"context_line":"        trunk \u003d trunk_objects.Trunk.get_object(el, id\u003dtrunk_id)"},{"line_number":112,"context_line":"        if trunk:"},{"line_number":113,"context_line":"            trunk.status \u003d status"}],"source_content_type":"text/x-python","patch_set":24,"id":"9ad45d7e_32414daa","line":110,"in_reply_to":"9ad45d7e_624dbc3d","updated":"2016-08-10 23:38:58.000000000","message":"so do we need to elevate on L84 above? \nDone","commit_id":"b5a5684dcafed2ed1da5d8fe25434f09fe0edf81"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"c05eaa37f5f8417d577768c3d45b179afbe297dd","unresolved":false,"context_lines":[{"line_number":108,"context_line":"    def update_trunk_status(self, context, trunk_id, status):"},{"line_number":109,"context_line":"        \"\"\"Update the trunk status to reflect outcome of data plane wiring.\"\"\""},{"line_number":110,"context_line":"        el \u003d context.elevated()"},{"line_number":111,"context_line":"        trunk \u003d trunk_objects.Trunk.get_object(el, id\u003dtrunk_id)"},{"line_number":112,"context_line":"        if trunk:"},{"line_number":113,"context_line":"            trunk.status \u003d status"},{"line_number":114,"context_line":"            trunk.update()"}],"source_content_type":"text/x-python","patch_set":24,"id":"9ad45d7e_8250b0d5","line":111,"updated":"2016-08-10 21:23:53.000000000","message":"these should be wrapped in a transaction. I am not convinced this is complete but it would do for now. In fact there may be certain state transitions we may be unable to fulfil. Like ERROR to BUILD?","commit_id":"b5a5684dcafed2ed1da5d8fe25434f09fe0edf81"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"2ebbaa4067646df80ccfecf2e9ba1078477fff76","unresolved":false,"context_lines":[{"line_number":108,"context_line":"    def update_trunk_status(self, context, trunk_id, status):"},{"line_number":109,"context_line":"        \"\"\"Update the trunk status to reflect outcome of data plane wiring.\"\"\""},{"line_number":110,"context_line":"        el \u003d context.elevated()"},{"line_number":111,"context_line":"        trunk \u003d trunk_objects.Trunk.get_object(el, id\u003dtrunk_id)"},{"line_number":112,"context_line":"        if trunk:"},{"line_number":113,"context_line":"            trunk.status \u003d status"},{"line_number":114,"context_line":"            trunk.update()"}],"source_content_type":"text/x-python","patch_set":24,"id":"9ad45d7e_d214314e","line":111,"in_reply_to":"9ad45d7e_528e81d0","updated":"2016-08-10 23:52:22.000000000","message":"both get and update must be within the same transaction statement.","commit_id":"b5a5684dcafed2ed1da5d8fe25434f09fe0edf81"},{"author":{"_account_id":13770,"name":"Adolfo Duarte","email":"adduarte@redhat.com","username":"adolfoduarte"},"change_message_id":"ebc41b82734d2b5898f7f92534b0bfb33eb81314","unresolved":false,"context_lines":[{"line_number":108,"context_line":"    def update_trunk_status(self, context, trunk_id, status):"},{"line_number":109,"context_line":"        \"\"\"Update the trunk status to reflect outcome of data plane wiring.\"\"\""},{"line_number":110,"context_line":"        el \u003d context.elevated()"},{"line_number":111,"context_line":"        trunk \u003d trunk_objects.Trunk.get_object(el, id\u003dtrunk_id)"},{"line_number":112,"context_line":"        if trunk:"},{"line_number":113,"context_line":"            trunk.status \u003d status"},{"line_number":114,"context_line":"            trunk.update()"}],"source_content_type":"text/x-python","patch_set":24,"id":"9ad45d7e_528e81d0","line":111,"in_reply_to":"9ad45d7e_8250b0d5","updated":"2016-08-10 23:38:58.000000000","message":"Trunk.get_object is already wrapped in a transaction if that is what you mean.[1]\n? a call to trunk.status \u003d status; trunk.update()\nwill put any string into the status of the object. \nShould we be checking to make sure we are not passed any bogus strings as status? for example no ERROR or BUILD?\n\n[1]https://github.com/openstack/neutron/blob/master/neutron/objects/base.py#L372","commit_id":"b5a5684dcafed2ed1da5d8fe25434f09fe0edf81"},{"author":{"_account_id":13770,"name":"Adolfo Duarte","email":"adduarte@redhat.com","username":"adolfoduarte"},"change_message_id":"8330b4a5aeb9b8925e99e1349b0fe2f50b1c4c70","unresolved":false,"context_lines":[{"line_number":108,"context_line":"    def update_trunk_status(self, context, trunk_id, status):"},{"line_number":109,"context_line":"        \"\"\"Update the trunk status to reflect outcome of data plane wiring.\"\"\""},{"line_number":110,"context_line":"        el \u003d context.elevated()"},{"line_number":111,"context_line":"        trunk \u003d trunk_objects.Trunk.get_object(el, id\u003dtrunk_id)"},{"line_number":112,"context_line":"        if trunk:"},{"line_number":113,"context_line":"            trunk.status \u003d status"},{"line_number":114,"context_line":"            trunk.update()"}],"source_content_type":"text/x-python","patch_set":24,"id":"9ad45d7e_f9883173","line":111,"in_reply_to":"9ad45d7e_d214314e","updated":"2016-08-11 05:59:26.000000000","message":"Done","commit_id":"b5a5684dcafed2ed1da5d8fe25434f09fe0edf81"},{"author":{"_account_id":6788,"name":"Rossella Sblendido","email":"rsblendido@suse.com","username":"rossella-o"},"change_message_id":"c9d7876ca4177c828f4cb87e6448604ea2470b15","unresolved":false,"context_lines":[{"line_number":81,"context_line":"    def update_subport_bindings(self, context, subports):"},{"line_number":82,"context_line":"        \"\"\"Update subport bindings to match trunk host binding.\"\"\""},{"line_number":83,"context_line":"        el \u003d context.elevated()"},{"line_number":84,"context_line":"        ports_by_trunk_id \u003d collections.defaultdict(list)"},{"line_number":85,"context_line":"        updated_ports \u003d collections.defaultdict(list)"},{"line_number":86,"context_line":"        for s in subports:"},{"line_number":87,"context_line":"            ports_by_trunk_id[s[\u0027trunk_id\u0027]].append(s[\u0027port_id\u0027])"}],"source_content_type":"text/x-python","patch_set":26,"id":"9ad45d7e_e5e4a3ad","line":84,"updated":"2016-08-12 15:30:46.000000000","message":"the agent process only one trunk at the time...I don\u0027t think we need here to process subports for multiple trunks","commit_id":"31a4a66dcae0698e91640bc5eaf110425e304371"},{"author":{"_account_id":13770,"name":"Adolfo Duarte","email":"adduarte@redhat.com","username":"adolfoduarte"},"change_message_id":"8e5d9264debee026def7e7fd88c0530efbda9e67","unresolved":false,"context_lines":[{"line_number":81,"context_line":"    def update_subport_bindings(self, context, subports):"},{"line_number":82,"context_line":"        \"\"\"Update subport bindings to match trunk host binding.\"\"\""},{"line_number":83,"context_line":"        el \u003d context.elevated()"},{"line_number":84,"context_line":"        ports_by_trunk_id \u003d collections.defaultdict(list)"},{"line_number":85,"context_line":"        updated_ports \u003d collections.defaultdict(list)"},{"line_number":86,"context_line":"        for s in subports:"},{"line_number":87,"context_line":"            ports_by_trunk_id[s[\u0027trunk_id\u0027]].append(s[\u0027port_id\u0027])"}],"source_content_type":"text/x-python","patch_set":26,"id":"9ad45d7e_d2daf6e8","line":84,"in_reply_to":"9ad45d7e_1b7834f8","updated":"2016-08-12 19:01:07.000000000","message":"Will continue to process multiple trunks\nDONE","commit_id":"31a4a66dcae0698e91640bc5eaf110425e304371"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"4bbdaa412368116f7fb2b2c2f3c65245be3e16f4","unresolved":false,"context_lines":[{"line_number":81,"context_line":"    def update_subport_bindings(self, context, subports):"},{"line_number":82,"context_line":"        \"\"\"Update subport bindings to match trunk host binding.\"\"\""},{"line_number":83,"context_line":"        el \u003d context.elevated()"},{"line_number":84,"context_line":"        ports_by_trunk_id \u003d collections.defaultdict(list)"},{"line_number":85,"context_line":"        updated_ports \u003d collections.defaultdict(list)"},{"line_number":86,"context_line":"        for s in subports:"},{"line_number":87,"context_line":"            ports_by_trunk_id[s[\u0027trunk_id\u0027]].append(s[\u0027port_id\u0027])"}],"source_content_type":"text/x-python","patch_set":26,"id":"9ad45d7e_1b7834f8","line":84,"in_reply_to":"9ad45d7e_e5e4a3ad","updated":"2016-08-12 15:54:06.000000000","message":"This is to accommodate implementations that do, like I believe the one Kevin is going for in the LB case.","commit_id":"31a4a66dcae0698e91640bc5eaf110425e304371"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"9eeb0415b2c29b7e28944da2564baeb5f10a32ae","unresolved":false,"context_lines":[{"line_number":87,"context_line":"            ports_by_trunk_id[s[\u0027trunk_id\u0027]].append(s[\u0027port_id\u0027])"},{"line_number":88,"context_line":"        for trunk_id, subport_ids in ports_by_trunk_id.items():"},{"line_number":89,"context_line":"            trunk \u003d trunk_objects.Trunk.get_object(el, id\u003dtrunk_id)"},{"line_number":90,"context_line":"            if not trunk:"},{"line_number":91,"context_line":"                continue"},{"line_number":92,"context_line":"            trunk_port_id \u003d trunk.port_id"},{"line_number":93,"context_line":"            trunk_port \u003d self.core_plugin.get_port(el, trunk_port_id)"}],"source_content_type":"text/x-python","patch_set":26,"id":"9ad45d7e_508754b4","line":90,"updated":"2016-08-12 01:01:47.000000000","message":"as I suggested earlier, a debug trace is friendly to the developer.","commit_id":"31a4a66dcae0698e91640bc5eaf110425e304371"},{"author":{"_account_id":13770,"name":"Adolfo Duarte","email":"adduarte@redhat.com","username":"adolfoduarte"},"change_message_id":"8e5d9264debee026def7e7fd88c0530efbda9e67","unresolved":false,"context_lines":[{"line_number":87,"context_line":"            ports_by_trunk_id[s[\u0027trunk_id\u0027]].append(s[\u0027port_id\u0027])"},{"line_number":88,"context_line":"        for trunk_id, subport_ids in ports_by_trunk_id.items():"},{"line_number":89,"context_line":"            trunk \u003d trunk_objects.Trunk.get_object(el, id\u003dtrunk_id)"},{"line_number":90,"context_line":"            if not trunk:"},{"line_number":91,"context_line":"                continue"},{"line_number":92,"context_line":"            trunk_port_id \u003d trunk.port_id"},{"line_number":93,"context_line":"            trunk_port \u003d self.core_plugin.get_port(el, trunk_port_id)"}],"source_content_type":"text/x-python","patch_set":26,"id":"9ad45d7e_52ed668d","line":90,"in_reply_to":"9ad45d7e_508754b4","updated":"2016-08-12 19:01:07.000000000","message":"DONE","commit_id":"31a4a66dcae0698e91640bc5eaf110425e304371"},{"author":{"_account_id":6788,"name":"Rossella Sblendido","email":"rsblendido@suse.com","username":"rossella-o"},"change_message_id":"c9d7876ca4177c828f4cb87e6448604ea2470b15","unresolved":false,"context_lines":[{"line_number":96,"context_line":"                self.core_plugin.update_port("},{"line_number":97,"context_line":"                    el, port_id, {\u0027port\u0027: {HOST_ID: trunk_host}})"},{"line_number":98,"context_line":"                updated_ports[trunk_id].append(port_id)"},{"line_number":99,"context_line":"        return updated_ports"},{"line_number":100,"context_line":""},{"line_number":101,"context_line":"    def update_trunk_status(self, context, trunk_id, status):"},{"line_number":102,"context_line":"        \"\"\"Update the trunk status to reflect outcome of data plane wiring.\"\"\""}],"source_content_type":"text/x-python","patch_set":26,"id":"9ad45d7e_25623b17","line":99,"updated":"2016-08-12 15:30:46.000000000","message":"talking with Armando I understood that this call should provide the MAC address of the parent ports of the subports...did I misunderstood? If yes how is the agent going to get the MAC address of those ports?","commit_id":"31a4a66dcae0698e91640bc5eaf110425e304371"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"4bbdaa412368116f7fb2b2c2f3c65245be3e16f4","unresolved":false,"context_lines":[{"line_number":96,"context_line":"                self.core_plugin.update_port("},{"line_number":97,"context_line":"                    el, port_id, {\u0027port\u0027: {HOST_ID: trunk_host}})"},{"line_number":98,"context_line":"                updated_ports[trunk_id].append(port_id)"},{"line_number":99,"context_line":"        return updated_ports"},{"line_number":100,"context_line":""},{"line_number":101,"context_line":"    def update_trunk_status(self, context, trunk_id, status):"},{"line_number":102,"context_line":"        \"\"\"Update the trunk status to reflect outcome of data plane wiring.\"\"\""}],"source_content_type":"text/x-python","patch_set":26,"id":"9ad45d7e_fbf1e06b","line":99,"in_reply_to":"9ad45d7e_25623b17","updated":"2016-08-12 15:54:06.000000000","message":"Yes, this is wrong. We should get the updated_port on line 96 and append that one instead.","commit_id":"31a4a66dcae0698e91640bc5eaf110425e304371"},{"author":{"_account_id":13770,"name":"Adolfo Duarte","email":"adduarte@redhat.com","username":"adolfoduarte"},"change_message_id":"8e5d9264debee026def7e7fd88c0530efbda9e67","unresolved":false,"context_lines":[{"line_number":96,"context_line":"                self.core_plugin.update_port("},{"line_number":97,"context_line":"                    el, port_id, {\u0027port\u0027: {HOST_ID: trunk_host}})"},{"line_number":98,"context_line":"                updated_ports[trunk_id].append(port_id)"},{"line_number":99,"context_line":"        return updated_ports"},{"line_number":100,"context_line":""},{"line_number":101,"context_line":"    def update_trunk_status(self, context, trunk_id, status):"},{"line_number":102,"context_line":"        \"\"\"Update the trunk status to reflect outcome of data plane wiring.\"\"\""}],"source_content_type":"text/x-python","patch_set":26,"id":"9ad45d7e_fded4bf0","line":99,"in_reply_to":"9ad45d7e_fbf1e06b","updated":"2016-08-12 19:01:07.000000000","message":"DONE","commit_id":"31a4a66dcae0698e91640bc5eaf110425e304371"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"39b62586e48af97a7e90d49fc23d019e0f8a5ef3","unresolved":false,"context_lines":[{"line_number":96,"context_line":"            for port_id in subport_ids:"},{"line_number":97,"context_line":"                updated_port \u003d self.core_plugin.update_port("},{"line_number":98,"context_line":"                    el, port_id, {\u0027port\u0027: {HOST_ID: trunk_host}})"},{"line_number":99,"context_line":"                # TODO(fitoduarte): depending on agent implemenation we might"},{"line_number":100,"context_line":"                # not need to return the whole updated_port dictionary."},{"line_number":101,"context_line":"                # Once agent is implemented, revisit to trim any unecessary"},{"line_number":102,"context_line":"                # data"}],"source_content_type":"text/x-python","patch_set":27,"id":"7ac969e8_e0b81ee8","line":99,"updated":"2016-08-13 00:10:57.000000000","message":"implementation","commit_id":"5f06e02006e4d1289d23ac532999f5e5064a8d0d"}],"neutron/tests/unit/services/trunk/drivers/openvswitch/test_driver.py":[{"author":{"_account_id":16800,"name":"Rawlin Peters","email":"rawlin.peters@hpe.com","username":"rawlin"},"change_message_id":"09fba962bbf473b3d95f63166e52b9c391c11473","unresolved":false,"context_lines":[{"line_number":26,"context_line":"from neutron.tests.unit.plugins.ml2 import test_plugin"},{"line_number":27,"context_line":""},{"line_number":28,"context_line":""},{"line_number":29,"context_line":"class OVSSeverDriver(test_plugin.Ml2PluginV2TestCase):"},{"line_number":30,"context_line":""},{"line_number":31,"context_line":"    def setUp(self):"},{"line_number":32,"context_line":"        super(OVSSeverDriver, self).setUp()"}],"source_content_type":"text/x-python","patch_set":2,"id":"bacf61ea_e3f2e26e","line":29,"range":{"start_line":29,"start_character":6,"end_line":29,"end_character":20},"updated":"2016-07-27 20:03:57.000000000","message":"was this an intentional change? The old name was OVSDriverPluginTestCase","commit_id":"ff6f4ae079db59efdb6bc4fbeb1ddc967eec54c9"},{"author":{"_account_id":16800,"name":"Rawlin Peters","email":"rawlin.peters@hpe.com","username":"rawlin"},"change_message_id":"21cefa16c0e4b17d565b05156e9a9f3ddf1db250","unresolved":false,"context_lines":[{"line_number":26,"context_line":"from neutron.tests.unit.plugins.ml2 import test_plugin"},{"line_number":27,"context_line":""},{"line_number":28,"context_line":""},{"line_number":29,"context_line":"class OVSSeverDriver(test_plugin.Ml2PluginV2TestCase):"},{"line_number":30,"context_line":""},{"line_number":31,"context_line":"    def setUp(self):"},{"line_number":32,"context_line":"        super(OVSSeverDriver, self).setUp()"}],"source_content_type":"text/x-python","patch_set":2,"id":"bacf61ea_2ea50104","line":29,"range":{"start_line":29,"start_character":6,"end_line":29,"end_character":20},"in_reply_to":"bacf61ea_2317da52","updated":"2016-07-27 20:14:12.000000000","message":"Ok that makes sense.\n\nThere is a typo in \"OVSSeverDriver\" -\u003e OVSServerDriver","commit_id":"ff6f4ae079db59efdb6bc4fbeb1ddc967eec54c9"},{"author":{"_account_id":13770,"name":"Adolfo Duarte","email":"adduarte@redhat.com","username":"adolfoduarte"},"change_message_id":"ac4bf803e0106354f04d8c83083e22bf4c8e3073","unresolved":false,"context_lines":[{"line_number":26,"context_line":"from neutron.tests.unit.plugins.ml2 import test_plugin"},{"line_number":27,"context_line":""},{"line_number":28,"context_line":""},{"line_number":29,"context_line":"class OVSSeverDriver(test_plugin.Ml2PluginV2TestCase):"},{"line_number":30,"context_line":""},{"line_number":31,"context_line":"    def setUp(self):"},{"line_number":32,"context_line":"        super(OVSSeverDriver, self).setUp()"}],"source_content_type":"text/x-python","patch_set":2,"id":"bacf61ea_2317da52","line":29,"range":{"start_line":29,"start_character":6,"end_line":29,"end_character":20},"in_reply_to":"bacf61ea_e3f2e26e","updated":"2016-07-27 20:09:13.000000000","message":"Yes. Since the driver files  are now being split by server and agent, OVSDriverPluginTestCase seemed too generic.","commit_id":"ff6f4ae079db59efdb6bc4fbeb1ddc967eec54c9"},{"author":{"_account_id":16800,"name":"Rawlin Peters","email":"rawlin.peters@hpe.com","username":"rawlin"},"change_message_id":"21cefa16c0e4b17d565b05156e9a9f3ddf1db250","unresolved":false,"context_lines":[{"line_number":29,"context_line":"class OVSSeverDriver(test_plugin.Ml2PluginV2TestCase):"},{"line_number":30,"context_line":""},{"line_number":31,"context_line":"    def setUp(self):"},{"line_number":32,"context_line":"        super(OVSSeverDriver, self).setUp()"},{"line_number":33,"context_line":"        self.plugin \u003d manager.NeutronManager.get_plugin()"},{"line_number":34,"context_line":"        ovs_driver.register()"},{"line_number":35,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"bacf61ea_6eaff9e3","line":32,"range":{"start_line":32,"start_character":14,"end_line":32,"end_character":28},"updated":"2016-07-27 20:14:12.000000000","message":"OVSServerDriver","commit_id":"ff6f4ae079db59efdb6bc4fbeb1ddc967eec54c9"},{"author":{"_account_id":16800,"name":"Rawlin Peters","email":"rawlin.peters@hpe.com","username":"rawlin"},"change_message_id":"21cefa16c0e4b17d565b05156e9a9f3ddf1db250","unresolved":false,"context_lines":[{"line_number":35,"context_line":""},{"line_number":36,"context_line":"    @mock.patch(\u0027neutron.services.trunk.drivers.openvswitch.driver.\u0027"},{"line_number":37,"context_line":"                \u0027add_subports_handler\u0027)"},{"line_number":38,"context_line":"    def test_subports_after_create_handler_registeration(self, handler_mock):"},{"line_number":39,"context_line":"        subport \u003d trunk_objects.SubPort(context\u003dself.context,"},{"line_number":40,"context_line":"                                        port_id\u003duuidutils.generate_uuid(),"},{"line_number":41,"context_line":"                                        segmentation_id\u003d2,"}],"source_content_type":"text/x-python","patch_set":2,"id":"bacf61ea_2e7ce171","line":38,"range":{"start_line":38,"start_character":43,"end_line":38,"end_character":56},"updated":"2016-07-27 20:14:12.000000000","message":"registration","commit_id":"ff6f4ae079db59efdb6bc4fbeb1ddc967eec54c9"},{"author":{"_account_id":16800,"name":"Rawlin Peters","email":"rawlin.peters@hpe.com","username":"rawlin"},"change_message_id":"21cefa16c0e4b17d565b05156e9a9f3ddf1db250","unresolved":false,"context_lines":[{"line_number":55,"context_line":""},{"line_number":56,"context_line":"    @mock.patch(\u0027neutron.services.trunk.drivers.openvswitch.driver.\u0027"},{"line_number":57,"context_line":"                \u0027remove_subports_handler\u0027)"},{"line_number":58,"context_line":"    def test_subports_after_delete_handler_registeration(self, handler_mock):"},{"line_number":59,"context_line":"        subport \u003d trunk_objects.SubPort(context\u003dself.context,"},{"line_number":60,"context_line":"                                        port_id\u003duuidutils.generate_uuid(),"},{"line_number":61,"context_line":"                                        segmentation_id\u003d2,"}],"source_content_type":"text/x-python","patch_set":2,"id":"bacf61ea_8e8d0d7e","line":58,"range":{"start_line":58,"start_character":43,"end_line":58,"end_character":56},"updated":"2016-07-27 20:14:12.000000000","message":"registration","commit_id":"ff6f4ae079db59efdb6bc4fbeb1ddc967eec54c9"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"83ccb42f79c61bab4bb0c847ed2b53c40541a159","unresolved":false,"context_lines":[{"line_number":26,"context_line":"from neutron.tests.unit.plugins.ml2 import test_plugin"},{"line_number":27,"context_line":""},{"line_number":28,"context_line":""},{"line_number":29,"context_line":"class OVSTrunkDriverTestCase(test_plugin.Ml2PluginV2TestCase):"},{"line_number":30,"context_line":""},{"line_number":31,"context_line":"    def setUp(self):"},{"line_number":32,"context_line":"        super(OVSTrunkDriverTestCase, self).setUp()"}],"source_content_type":"text/x-python","patch_set":5,"id":"bacf61ea_e47c7aed","line":29,"updated":"2016-07-28 15:28:06.000000000","message":"this test is to be revised.","commit_id":"0a9f320f1f38a36f80ef1564308f4f678d7931b7"},{"author":{"_account_id":19999,"name":"Trinath Somanchi","email":"trinaths.dev@gmail.com","username":"trinath-somanchi"},"change_message_id":"0e670b1c3fbb89bbc8b3ef030643302a0a19c887","unresolved":false,"context_lines":[{"line_number":34,"context_line":"        ovs_driver.register()"},{"line_number":35,"context_line":""},{"line_number":36,"context_line":"    @mock.patch(\u0027neutron.services.trunk.rpc.backend.iopenvswitch.driver.\u0027"},{"line_number":37,"context_line":"                \u0027add_subports_handler\u0027)"},{"line_number":38,"context_line":"    def test_subports_after_create_handler_registeration(self, handler_mock):"},{"line_number":39,"context_line":"        subport \u003d trunk_objects.SubPort(context\u003dself.context,"},{"line_number":40,"context_line":"                                        port_id\u003duuidutils.generate_uuid(),"}],"source_content_type":"text/x-python","patch_set":5,"id":"bacf61ea_9f9b59c9","line":37,"updated":"2016-07-28 10:54:26.000000000","message":"I doubt the above path. Please re-verify.\ns/iopenvswitch/openvswitch/ !","commit_id":"0a9f320f1f38a36f80ef1564308f4f678d7931b7"},{"author":{"_account_id":19999,"name":"Trinath Somanchi","email":"trinaths.dev@gmail.com","username":"trinath-somanchi"},"change_message_id":"0e670b1c3fbb89bbc8b3ef030643302a0a19c887","unresolved":false,"context_lines":[{"line_number":36,"context_line":"    @mock.patch(\u0027neutron.services.trunk.rpc.backend.iopenvswitch.driver.\u0027"},{"line_number":37,"context_line":"                \u0027add_subports_handler\u0027)"},{"line_number":38,"context_line":"    def test_subports_after_create_handler_registeration(self, handler_mock):"},{"line_number":39,"context_line":"        subport \u003d trunk_objects.SubPort(context\u003dself.context,"},{"line_number":40,"context_line":"                                        port_id\u003duuidutils.generate_uuid(),"},{"line_number":41,"context_line":"                                        segmentation_id\u003d2,"},{"line_number":42,"context_line":"                                        segmentation_type\u003d\u0027vlan\u0027)"}],"source_content_type":"text/x-python","patch_set":5,"id":"bacf61ea_fff6d5d5","line":39,"updated":"2016-07-28 10:54:26.000000000","message":"s/registeration/registration/ !","commit_id":"0a9f320f1f38a36f80ef1564308f4f678d7931b7"},{"author":{"_account_id":19999,"name":"Trinath Somanchi","email":"trinaths.dev@gmail.com","username":"trinath-somanchi"},"change_message_id":"0e670b1c3fbb89bbc8b3ef030643302a0a19c887","unresolved":false,"context_lines":[{"line_number":56,"context_line":"    @mock.patch(\u0027neutron.services.trunk.drivers.openvswitch.driver.\u0027"},{"line_number":57,"context_line":"                \u0027remove_subports_handler\u0027)"},{"line_number":58,"context_line":"    def test_subports_after_delete_handler_registeration(self, handler_mock):"},{"line_number":59,"context_line":"        subport \u003d trunk_objects.SubPort(context\u003dself.context,"},{"line_number":60,"context_line":"                                        port_id\u003duuidutils.generate_uuid(),"},{"line_number":61,"context_line":"                                        segmentation_id\u003d2,"},{"line_number":62,"context_line":"                                        segmentation_type\u003d\u0027vlan\u0027)"}],"source_content_type":"text/x-python","patch_set":5,"id":"bacf61ea_7fa665c2","line":59,"updated":"2016-07-28 10:54:26.000000000","message":"typo: s/registeration/registration/ !","commit_id":"0a9f320f1f38a36f80ef1564308f4f678d7931b7"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"be782c653b1a45eca7cf647c4b4d69ddaaeb05e2","unresolved":false,"context_lines":[{"line_number":26,"context_line":"from neutron.tests.unit.plugins.ml2 import test_plugin"},{"line_number":27,"context_line":""},{"line_number":28,"context_line":""},{"line_number":29,"context_line":"class OVSTrunkDriverTestCase(test_plugin.Ml2PluginV2TestCase):"},{"line_number":30,"context_line":""},{"line_number":31,"context_line":"    def setUp(self):"},{"line_number":32,"context_line":"        super(OVSTrunkDriverTestCase, self).setUp()"}],"source_content_type":"text/x-python","patch_set":14,"id":"bacf61ea_a2449649","line":29,"updated":"2016-08-01 21:47:28.000000000","message":"I guess this test must be rewritten at this point.","commit_id":"bc23b9387ed4103ae5f04b82e163e8bf85daeff1"}],"neutron/tests/unit/services/trunk/rpc/__init__.py":[{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"c05eaa37f5f8417d577768c3d45b179afbe297dd","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":24,"id":"9ad45d7e_62d3fc04","side":"PARENT","line":1,"updated":"2016-08-10 21:23:53.000000000","message":"Just thinking out loud: I am thinking that some of these tests would be more effective if they were integration tests, but some degree of unit coverage is desirable nonetheless. I guess we can revisit as we go.","commit_id":"46b6e129ff293672453e886e11922dbf059cd6ee"}],"neutron/tests/unit/services/trunk/rpc/test_agent.py":[{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"change_message_id":"107419ceb81046cbcb2da0206330cf6562951d31","unresolved":false,"context_lines":[{"line_number":13,"context_line":""},{"line_number":14,"context_line":"import mock"},{"line_number":15,"context_line":"import oslo_messaging"},{"line_number":16,"context_line":""},{"line_number":17,"context_line":""},{"line_number":18,"context_line":"from neutron.api.rpc.callbacks import resources"},{"line_number":19,"context_line":"from neutron.api.rpc.handlers import resources_rpc"}],"source_content_type":"text/x-python","patch_set":17,"id":"bacf61ea_190f7789","line":16,"updated":"2016-08-03 13:13:36.000000000","message":"one too many new lines","commit_id":"124d59e8a167663da2a5369bb5a684bfe1886bd5"},{"author":{"_account_id":13770,"name":"Adolfo Duarte","email":"adduarte@redhat.com","username":"adolfoduarte"},"change_message_id":"fbc6557d1c5a87da449890f0222c62f032e89c6c","unresolved":false,"context_lines":[{"line_number":13,"context_line":""},{"line_number":14,"context_line":"import mock"},{"line_number":15,"context_line":"import oslo_messaging"},{"line_number":16,"context_line":""},{"line_number":17,"context_line":""},{"line_number":18,"context_line":"from neutron.api.rpc.callbacks import resources"},{"line_number":19,"context_line":"from neutron.api.rpc.handlers import resources_rpc"}],"source_content_type":"text/x-python","patch_set":17,"id":"bacf61ea_2b749a9a","line":16,"in_reply_to":"bacf61ea_190f7789","updated":"2016-08-03 15:48:26.000000000","message":"Done","commit_id":"124d59e8a167663da2a5369bb5a684bfe1886bd5"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"change_message_id":"107419ceb81046cbcb2da0206330cf6562951d31","unresolved":false,"context_lines":[{"line_number":21,"context_line":"from neutron.services.trunk.rpc.agent import TrunkStub"},{"line_number":22,"context_line":"from neutron.services.trunk.rpc import constants as rpc_consts"},{"line_number":23,"context_line":"from neutron.tests import base"},{"line_number":24,"context_line":"from oslo_config import cfg"},{"line_number":25,"context_line":""},{"line_number":26,"context_line":""},{"line_number":27,"context_line":"class TrunkSkeletonTest(base.BaseTestCase):"}],"source_content_type":"text/x-python","patch_set":17,"id":"bacf61ea_5921effb","line":24,"updated":"2016-08-03 13:13:36.000000000","message":"oslo is 3rd party should be above","commit_id":"124d59e8a167663da2a5369bb5a684bfe1886bd5"},{"author":{"_account_id":13770,"name":"Adolfo Duarte","email":"adduarte@redhat.com","username":"adolfoduarte"},"change_message_id":"fbc6557d1c5a87da449890f0222c62f032e89c6c","unresolved":false,"context_lines":[{"line_number":21,"context_line":"from neutron.services.trunk.rpc.agent import TrunkStub"},{"line_number":22,"context_line":"from neutron.services.trunk.rpc import constants as rpc_consts"},{"line_number":23,"context_line":"from neutron.tests import base"},{"line_number":24,"context_line":"from oslo_config import cfg"},{"line_number":25,"context_line":""},{"line_number":26,"context_line":""},{"line_number":27,"context_line":"class TrunkSkeletonTest(base.BaseTestCase):"}],"source_content_type":"text/x-python","patch_set":17,"id":"bacf61ea_0b7716a0","line":24,"in_reply_to":"bacf61ea_5921effb","updated":"2016-08-03 15:48:26.000000000","message":"Done","commit_id":"124d59e8a167663da2a5369bb5a684bfe1886bd5"},{"author":{"_account_id":16800,"name":"Rawlin Peters","email":"rawlin.peters@hpe.com","username":"rawlin"},"change_message_id":"36aa5b522e744bb27d5d663263865c198be00cce","unresolved":false,"context_lines":[{"line_number":35,"context_line":"        mocked_register.assert_has_calls(calls, any_order\u003dTrue)"},{"line_number":36,"context_line":""},{"line_number":37,"context_line":"        # Test to see if the call to rpc.get_server has the correct"},{"line_number":38,"context_line":"        # target and the corect endpoints"},{"line_number":39,"context_line":"        topic \u003d resources_rpc.resource_type_versioned_topic(resources.SUBPORT)"},{"line_number":40,"context_line":"        subport_target \u003d oslo_messaging.Target("},{"line_number":41,"context_line":"            topic\u003dtopic, server\u003dcfg.CONF.host, fanout\u003dTrue)"}],"source_content_type":"text/x-python","patch_set":19,"id":"bacf61ea_6f3a099a","line":38,"range":{"start_line":38,"start_character":25,"end_line":38,"end_character":31},"updated":"2016-08-04 00:02:52.000000000","message":"correct","commit_id":"0add8405148c2df4b8ae49a885d75b49aff8bc98"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"39b62586e48af97a7e90d49fc23d019e0f8a5ef3","unresolved":false,"context_lines":[{"line_number":17,"context_line":""},{"line_number":18,"context_line":"from neutron.api.rpc.callbacks import resources"},{"line_number":19,"context_line":"from neutron.api.rpc.handlers import resources_rpc"},{"line_number":20,"context_line":"from neutron.services.trunk.rpc.agent import TrunkSkeleton"},{"line_number":21,"context_line":"from neutron.services.trunk.rpc.agent import TrunkStub"},{"line_number":22,"context_line":"from neutron.services.trunk.rpc import constants as rpc_consts"},{"line_number":23,"context_line":"from neutron.tests import base"}],"source_content_type":"text/x-python","patch_set":27,"id":"7ac969e8_c0a082a8","line":20,"updated":"2016-08-13 00:10:57.000000000","message":"you\u0027re support to import the module agent.","commit_id":"5f06e02006e4d1289d23ac532999f5e5064a8d0d"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"39b62586e48af97a7e90d49fc23d019e0f8a5ef3","unresolved":false,"context_lines":[{"line_number":57,"context_line":"            topic\u003drpc_consts.TRUNK_BASE_TOPIC,"},{"line_number":58,"context_line":"            version\u003d\u00271.0\u0027,"},{"line_number":59,"context_line":"            namespace\u003drpc_consts.TRUNK_BASE_NAMESPACE)"},{"line_number":60,"context_line":"        self.assertEqual(local_target, test_obj.rpc_client.target)"}],"source_content_type":"text/x-python","patch_set":27,"id":"7ac969e8_0099fa6e","line":60,"updated":"2016-08-13 00:10:57.000000000","message":"this test is a change detector and as such it provides no value. We should remove it.","commit_id":"5f06e02006e4d1289d23ac532999f5e5064a8d0d"}],"neutron/tests/unit/services/trunk/rpc/test_backend.py":[{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"change_message_id":"107419ceb81046cbcb2da0206330cf6562951d31","unresolved":false,"context_lines":[{"line_number":12,"context_line":"# under the License."},{"line_number":13,"context_line":""},{"line_number":14,"context_line":"import mock"},{"line_number":15,"context_line":""},{"line_number":16,"context_line":""},{"line_number":17,"context_line":"from neutron.callbacks import events"},{"line_number":18,"context_line":"from neutron.services.trunk import constants as trunk_consts"}],"source_content_type":"text/x-python","patch_set":17,"id":"bacf61ea_991b67ca","line":15,"updated":"2016-08-03 13:13:36.000000000","message":"one too many new lines","commit_id":"124d59e8a167663da2a5369bb5a684bfe1886bd5"},{"author":{"_account_id":13770,"name":"Adolfo Duarte","email":"adduarte@redhat.com","username":"adolfoduarte"},"change_message_id":"fbc6557d1c5a87da449890f0222c62f032e89c6c","unresolved":false,"context_lines":[{"line_number":12,"context_line":"# under the License."},{"line_number":13,"context_line":""},{"line_number":14,"context_line":"import mock"},{"line_number":15,"context_line":""},{"line_number":16,"context_line":""},{"line_number":17,"context_line":"from neutron.callbacks import events"},{"line_number":18,"context_line":"from neutron.services.trunk import constants as trunk_consts"}],"source_content_type":"text/x-python","patch_set":17,"id":"bacf61ea_2b4dba72","line":15,"in_reply_to":"bacf61ea_991b67ca","updated":"2016-08-03 15:48:26.000000000","message":"Done","commit_id":"124d59e8a167663da2a5369bb5a684bfe1886bd5"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"c05eaa37f5f8417d577768c3d45b179afbe297dd","unresolved":false,"context_lines":[{"line_number":19,"context_line":"from neutron.tests import base"},{"line_number":20,"context_line":""},{"line_number":21,"context_line":""},{"line_number":22,"context_line":"class ServerSideRpcBackendTest(base.BaseTestCase):"},{"line_number":23,"context_line":""},{"line_number":24,"context_line":"    @mock.patch(\"neutron.api.rpc.callbacks.resource_manager.\""},{"line_number":25,"context_line":"                \"ResourceCallbacksManager.register\")"}],"source_content_type":"text/x-python","patch_set":24,"id":"9ad45d7e_82fef0ab","line":22,"updated":"2016-08-10 21:23:53.000000000","message":"add todo to remind us to improve the coverage of this module?","commit_id":"b5a5684dcafed2ed1da5d8fe25434f09fe0edf81"},{"author":{"_account_id":13770,"name":"Adolfo Duarte","email":"adduarte@redhat.com","username":"adolfoduarte"},"change_message_id":"8330b4a5aeb9b8925e99e1349b0fe2f50b1c4c70","unresolved":false,"context_lines":[{"line_number":19,"context_line":"from neutron.tests import base"},{"line_number":20,"context_line":""},{"line_number":21,"context_line":""},{"line_number":22,"context_line":"class ServerSideRpcBackendTest(base.BaseTestCase):"},{"line_number":23,"context_line":""},{"line_number":24,"context_line":"    @mock.patch(\"neutron.api.rpc.callbacks.resource_manager.\""},{"line_number":25,"context_line":"                \"ResourceCallbacksManager.register\")"}],"source_content_type":"text/x-python","patch_set":24,"id":"9ad45d7e_f5a2fffa","line":22,"in_reply_to":"9ad45d7e_82fef0ab","updated":"2016-08-11 05:59:26.000000000","message":"Done","commit_id":"b5a5684dcafed2ed1da5d8fe25434f09fe0edf81"}],"neutron/tests/unit/services/trunk/rpc/test_server.py":[{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"change_message_id":"107419ceb81046cbcb2da0206330cf6562951d31","unresolved":false,"context_lines":[{"line_number":12,"context_line":"# under the License."},{"line_number":13,"context_line":""},{"line_number":14,"context_line":"import mock"},{"line_number":15,"context_line":""},{"line_number":16,"context_line":"import oslo_messaging"},{"line_number":17,"context_line":""},{"line_number":18,"context_line":"from neutron.api.rpc.callbacks import events"}],"source_content_type":"text/x-python","patch_set":17,"id":"bacf61ea_d962ff3c","line":15,"updated":"2016-08-03 13:13:36.000000000","message":"this can be deleted","commit_id":"124d59e8a167663da2a5369bb5a684bfe1886bd5"},{"author":{"_account_id":13770,"name":"Adolfo Duarte","email":"adduarte@redhat.com","username":"adolfoduarte"},"change_message_id":"fbc6557d1c5a87da449890f0222c62f032e89c6c","unresolved":false,"context_lines":[{"line_number":12,"context_line":"# under the License."},{"line_number":13,"context_line":""},{"line_number":14,"context_line":"import mock"},{"line_number":15,"context_line":""},{"line_number":16,"context_line":"import oslo_messaging"},{"line_number":17,"context_line":""},{"line_number":18,"context_line":"from neutron.api.rpc.callbacks import events"}],"source_content_type":"text/x-python","patch_set":17,"id":"bacf61ea_2b82da52","line":15,"in_reply_to":"bacf61ea_d962ff3c","updated":"2016-08-03 15:48:26.000000000","message":"Done","commit_id":"124d59e8a167663da2a5369bb5a684bfe1886bd5"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"change_message_id":"107419ceb81046cbcb2da0206330cf6562951d31","unresolved":false,"context_lines":[{"line_number":22,"context_line":"from neutron.services.trunk.rpc import constants"},{"line_number":23,"context_line":"from neutron.services.trunk.rpc import server"},{"line_number":24,"context_line":"from neutron.tests import base"},{"line_number":25,"context_line":"from oslo_config import cfg"},{"line_number":26,"context_line":""},{"line_number":27,"context_line":""},{"line_number":28,"context_line":"class TrunkSkeletonTest(base.BaseTestCase):"}],"source_content_type":"text/x-python","patch_set":17,"id":"bacf61ea_5968cf21","line":25,"updated":"2016-08-03 13:13:36.000000000","message":"oslo is third party","commit_id":"124d59e8a167663da2a5369bb5a684bfe1886bd5"},{"author":{"_account_id":13770,"name":"Adolfo Duarte","email":"adduarte@redhat.com","username":"adolfoduarte"},"change_message_id":"fbc6557d1c5a87da449890f0222c62f032e89c6c","unresolved":false,"context_lines":[{"line_number":22,"context_line":"from neutron.services.trunk.rpc import constants"},{"line_number":23,"context_line":"from neutron.services.trunk.rpc import server"},{"line_number":24,"context_line":"from neutron.tests import base"},{"line_number":25,"context_line":"from oslo_config import cfg"},{"line_number":26,"context_line":""},{"line_number":27,"context_line":""},{"line_number":28,"context_line":"class TrunkSkeletonTest(base.BaseTestCase):"}],"source_content_type":"text/x-python","patch_set":17,"id":"bacf61ea_0b855658","line":25,"in_reply_to":"bacf61ea_5968cf21","updated":"2016-08-03 15:48:26.000000000","message":"Done","commit_id":"124d59e8a167663da2a5369bb5a684bfe1886bd5"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"c05eaa37f5f8417d577768c3d45b179afbe297dd","unresolved":false,"context_lines":[{"line_number":91,"context_line":"            self.assertEqual(\u0027trunk_host_id\u0027, port[HOST_ID])"},{"line_number":92,"context_line":""},{"line_number":93,"context_line":"    @mock.patch(\u0027neutron.api.rpc.callbacks.producer.registry.provide\u0027)"},{"line_number":94,"context_line":"    def test_update_trunk_status(self, _):"},{"line_number":95,"context_line":"        with self.port() as _parent_port:"},{"line_number":96,"context_line":"            parent_port \u003d _parent_port"},{"line_number":97,"context_line":"        trunk \u003d self._create_test_trunk(parent_port)"}],"source_content_type":"text/x-python","patch_set":24,"id":"9ad45d7e_22a90491","line":94,"updated":"2016-08-10 21:23:53.000000000","message":"this is many tests into one, and we don\u0027t have to test all conditions, as we may want to check initial states and potentially prevent certain state transitions. \n\nMy suggestion would be to simplify this or remove it altogether. A TODO to remind us to improve the coverage would be nice.","commit_id":"b5a5684dcafed2ed1da5d8fe25434f09fe0edf81"},{"author":{"_account_id":13770,"name":"Adolfo Duarte","email":"adduarte@redhat.com","username":"adolfoduarte"},"change_message_id":"8330b4a5aeb9b8925e99e1349b0fe2f50b1c4c70","unresolved":false,"context_lines":[{"line_number":91,"context_line":"            self.assertEqual(\u0027trunk_host_id\u0027, port[HOST_ID])"},{"line_number":92,"context_line":""},{"line_number":93,"context_line":"    @mock.patch(\u0027neutron.api.rpc.callbacks.producer.registry.provide\u0027)"},{"line_number":94,"context_line":"    def test_update_trunk_status(self, _):"},{"line_number":95,"context_line":"        with self.port() as _parent_port:"},{"line_number":96,"context_line":"            parent_port \u003d _parent_port"},{"line_number":97,"context_line":"        trunk \u003d self._create_test_trunk(parent_port)"}],"source_content_type":"text/x-python","patch_set":24,"id":"9ad45d7e_75e56f36","line":94,"in_reply_to":"9ad45d7e_22a90491","updated":"2016-08-11 05:59:26.000000000","message":"lets keep the initial transition and test changing to active, just to keep a canary on the method for now, until we get better tests. helps avoid typos or simple mistakes.\nWe do have to decide which transitions we will allow. \nDone","commit_id":"b5a5684dcafed2ed1da5d8fe25434f09fe0edf81"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"24de059b9fb3120f1197d8c9417f8c5318414779","unresolved":false,"context_lines":[{"line_number":20,"context_line":"from neutron.api.rpc.handlers import resources_rpc"},{"line_number":21,"context_line":"from neutron.extensions.portbindings import HOST_ID"},{"line_number":22,"context_line":"from neutron import manager"},{"line_number":23,"context_line":"from neutron.objects.trunk import SubPort"},{"line_number":24,"context_line":"from neutron.services.trunk import constants"},{"line_number":25,"context_line":"from neutron.services.trunk import drivers"},{"line_number":26,"context_line":"from neutron.services.trunk import plugin as trunk_plugin"}],"source_content_type":"text/x-python","patch_set":27,"id":"7ac969e8_602c2eac","line":23,"range":{"start_line":23,"start_character":39,"end_line":23,"end_character":40},"updated":"2016-08-13 00:21:48.000000000","message":"same","commit_id":"5f06e02006e4d1289d23ac532999f5e5064a8d0d"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"39b62586e48af97a7e90d49fc23d019e0f8a5ef3","unresolved":false,"context_lines":[{"line_number":83,"context_line":"        test_obj \u003d server.TrunkSkeleton()"},{"line_number":84,"context_line":"        test_obj._trunk_plugin \u003d self.trunk_plugin"},{"line_number":85,"context_line":"        test_obj._core_plugin \u003d self.core_plugin"},{"line_number":86,"context_line":"        # mocked_update_port \u003d mock.patch()"},{"line_number":87,"context_line":"        updated_subports \u003d test_obj.update_subport_bindings(self.context,"},{"line_number":88,"context_line":"                                                            subports\u003dsubports)"},{"line_number":89,"context_line":"        self.assertIn(trunk[\u0027id\u0027], updated_subports)"}],"source_content_type":"text/x-python","patch_set":27,"id":"7ac969e8_00b0dadc","line":86,"updated":"2016-08-13 00:10:57.000000000","message":"leftover?","commit_id":"5f06e02006e4d1289d23ac532999f5e5064a8d0d"},{"author":{"_account_id":6788,"name":"Rossella Sblendido","email":"rsblendido@suse.com","username":"rossella-o"},"change_message_id":"75189b580c37c17038ce27d71fa2ec88bc16ddb7","unresolved":false,"context_lines":[{"line_number":66,"context_line":"        with self.port() as _parent_port:"},{"line_number":67,"context_line":"            parent_port \u003d _parent_port"},{"line_number":68,"context_line":"        trunk \u003d self._create_test_trunk(parent_port)"},{"line_number":69,"context_line":"        port_data \u003d {portbindings.HOST_ID: \u0027trunk_host_id\u0027}"},{"line_number":70,"context_line":"        self.core_plugin.update_port("},{"line_number":71,"context_line":"            self.context, parent_port[\u0027port\u0027][\u0027id\u0027], {\u0027port\u0027: port_data})"},{"line_number":72,"context_line":"        subports \u003d []"}],"source_content_type":"text/x-python","patch_set":29,"id":"3ac371cc_5e1d95bc","line":69,"range":{"start_line":69,"start_character":43,"end_line":69,"end_character":58},"updated":"2016-08-14 08:30:58.000000000","message":"nit: this could be declared as variable since it\u0027s used again at line 90","commit_id":"86d5f8e1a3697e26fd490c07b8558bd20bdeadce"}]}
