)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"fb3c3d886906dd7f20fdcf341cf41a676a1f6d6a","unresolved":false,"context_lines":[{"line_number":8,"context_line":""},{"line_number":9,"context_line":"This patch fills in the trunk_details field with trunk_id and"},{"line_number":10,"context_line":"sub_ports, exposing trunk-related information on the ports"},{"line_number":11,"context_line":"resource to consumers of the Neutron API."},{"line_number":12,"context_line":""},{"line_number":13,"context_line":"Change-Id: I1678301734e7f945e6f0400e62970b908da77a71"},{"line_number":14,"context_line":"Partially-implements: blueprint vlan-aware-vms"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":11,"id":"1aa78d24_1cce8659","line":11,"updated":"2016-07-13 16:56:34.000000000","message":"rebasing on top of https://review.openstack.org/#/c/341677/ should solve the debate.","commit_id":"b3e7ab76835447efd96cf9149e69015c72532a83"},{"author":{"_account_id":4187,"name":"Ryan Tidwell","email":"rtidwell@suse.com","username":"ryan-tidwell"},"change_message_id":"21ba5c91e2a350569a00b1199e60a85b244134d2","unresolved":false,"context_lines":[{"line_number":8,"context_line":""},{"line_number":9,"context_line":"This patch fills in the trunk_details field with trunk_id and"},{"line_number":10,"context_line":"sub_ports, exposing trunk-related information on the ports"},{"line_number":11,"context_line":"resource to consumers of the Neutron API."},{"line_number":12,"context_line":""},{"line_number":13,"context_line":"Change-Id: I1678301734e7f945e6f0400e62970b908da77a71"},{"line_number":14,"context_line":"Partially-implements: blueprint vlan-aware-vms"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":11,"id":"1aa78d24_ebadb185","line":11,"in_reply_to":"1aa78d24_1cce8659","updated":"2016-07-13 17:29:11.000000000","message":"will rebase shortly","commit_id":"b3e7ab76835447efd96cf9149e69015c72532a83"}],"neutron/services/trunk/models.py":[{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"8e1bb45ddf5603664147977bd5f1cfe8eb934e64","unresolved":false,"context_lines":[{"line_number":49,"context_line":"                                       ondelete\u003d\u0027CASCADE\u0027),"},{"line_number":50,"context_line":"                         nullable\u003dFalse)"},{"line_number":51,"context_line":""},{"line_number":52,"context_line":"    trunk \u003d sa.orm.relationship("},{"line_number":53,"context_line":"        Trunk,"},{"line_number":54,"context_line":"        backref\u003dsa.orm.backref(\u0027sub_ports\u0027, lazy\u003d\u0027joined\u0027, uselist\u003dTrue,"},{"line_number":55,"context_line":"                               cascade\u003d\u0027delete\u0027))"}],"source_content_type":"text/x-python","patch_set":13,"id":"1aa78d24_83016909","line":52,"updated":"2016-07-13 21:59:32.000000000","message":"is this still needed? I can\u0027t see it used anywhere.","commit_id":"5c5a7cc7b95d044c220ccd7a612253f4fda730e4"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"5b62bf5527d42dd763c1ab801524d8be027be8d0","unresolved":false,"context_lines":[{"line_number":49,"context_line":"                                       ondelete\u003d\u0027CASCADE\u0027),"},{"line_number":50,"context_line":"                         nullable\u003dFalse)"},{"line_number":51,"context_line":""},{"line_number":52,"context_line":"    trunk \u003d sa.orm.relationship("},{"line_number":53,"context_line":"        Trunk,"},{"line_number":54,"context_line":"        backref\u003dsa.orm.backref(\u0027sub_ports\u0027, lazy\u003d\u0027joined\u0027, uselist\u003dTrue,"},{"line_number":55,"context_line":"                               cascade\u003d\u0027delete\u0027))"}],"source_content_type":"text/x-python","patch_set":13,"id":"1aa78d24_fe43a011","line":52,"in_reply_to":"1aa78d24_83016909","updated":"2016-07-13 22:06:19.000000000","message":"nm","commit_id":"5c5a7cc7b95d044c220ccd7a612253f4fda730e4"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"81660ae61c42c25c1d6616b569b466d60efc1b5f","unresolved":false,"context_lines":[{"line_number":49,"context_line":"                                       ondelete\u003d\u0027CASCADE\u0027),"},{"line_number":50,"context_line":"                         nullable\u003dFalse)"},{"line_number":51,"context_line":""},{"line_number":52,"context_line":"    trunk \u003d sa.orm.relationship("},{"line_number":53,"context_line":"        Trunk,"},{"line_number":54,"context_line":"        backref\u003dsa.orm.backref(\u0027sub_ports\u0027, lazy\u003d\u0027joined\u0027, uselist\u003dTrue,"},{"line_number":55,"context_line":"                               cascade\u003d\u0027delete\u0027))"}],"source_content_type":"text/x-python","patch_set":13,"id":"1aa78d24_fedf2038","line":52,"in_reply_to":"1aa78d24_fe43a011","updated":"2016-07-13 22:30:37.000000000","message":"scrap what I said, however I have a question:\n\nI wonder if it is more natural for the purpose of this use case do the following and scratch this one:\n\nsub_ports \u003d sa.orm.relationship(\"SubPort\", lazy\u003d\u0027joined\u0027, uselist\u003dTrue)\n\nto line 34.","commit_id":"5c5a7cc7b95d044c220ccd7a612253f4fda730e4"},{"author":{"_account_id":4187,"name":"Ryan Tidwell","email":"rtidwell@suse.com","username":"ryan-tidwell"},"change_message_id":"6ad3f079c57135f589f272eff1ffdb74de537eda","unresolved":false,"context_lines":[{"line_number":49,"context_line":"                                       ondelete\u003d\u0027CASCADE\u0027),"},{"line_number":50,"context_line":"                         nullable\u003dFalse)"},{"line_number":51,"context_line":""},{"line_number":52,"context_line":"    trunk \u003d sa.orm.relationship("},{"line_number":53,"context_line":"        Trunk,"},{"line_number":54,"context_line":"        backref\u003dsa.orm.backref(\u0027sub_ports\u0027, lazy\u003d\u0027joined\u0027, uselist\u003dTrue,"},{"line_number":55,"context_line":"                               cascade\u003d\u0027delete\u0027))"}],"source_content_type":"text/x-python","patch_set":13,"id":"1aa78d24_1d44b119","line":52,"in_reply_to":"1aa78d24_fedf2038","updated":"2016-07-13 22:52:25.000000000","message":"I don\u0027t have strong feelings about it, but this is my handywork :) If this doesn\u0027t feel as natural to you that\u0027s an indication it might be friendlier to do it the way you suggest.","commit_id":"5c5a7cc7b95d044c220ccd7a612253f4fda730e4"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"439ea92ac6f3ef0562164bfdb2682ec8c4d95f7f","unresolved":false,"context_lines":[{"line_number":61,"context_line":"        backref\u003dsa.orm.backref(\u0027trunk_port\u0027, lazy\u003d\u0027joined\u0027, uselist\u003dFalse,"},{"line_number":62,"context_line":"                               cascade\u003d\u0027delete\u0027))"},{"line_number":63,"context_line":""},{"line_number":64,"context_line":"    sub_ports \u003d sa.orm.relationship("},{"line_number":65,"context_line":"        SubPort,"},{"line_number":66,"context_line":"        backref\u003dsa.orm.backref(\u0027SubPort\u0027, lazy\u003d\u0027joined\u0027, uselist\u003dTrue))"},{"line_number":67,"context_line":""}],"source_content_type":"text/x-python","patch_set":14,"id":"1aa78d24_ef70de75","line":64,"updated":"2016-07-14 18:30:01.000000000","message":"you don\u0027t need to shuffle, you need this line:\n\nsa.orm.relationship(\"SubPort\", lazy\u003d\u0027joined\u0027, uselist\u003dTrue)\n\nI did, and it worked for me.","commit_id":"ae220ea92c3a99542531c1645893ef6ea488e6fc"},{"author":{"_account_id":4187,"name":"Ryan Tidwell","email":"rtidwell@suse.com","username":"ryan-tidwell"},"change_message_id":"64ab43722fce308ae91bfec4e45efb2387026e9a","unresolved":false,"context_lines":[{"line_number":61,"context_line":"        backref\u003dsa.orm.backref(\u0027trunk_port\u0027, lazy\u003d\u0027joined\u0027, uselist\u003dFalse,"},{"line_number":62,"context_line":"                               cascade\u003d\u0027delete\u0027))"},{"line_number":63,"context_line":""},{"line_number":64,"context_line":"    sub_ports \u003d sa.orm.relationship("},{"line_number":65,"context_line":"        SubPort,"},{"line_number":66,"context_line":"        backref\u003dsa.orm.backref(\u0027SubPort\u0027, lazy\u003d\u0027joined\u0027, uselist\u003dTrue))"},{"line_number":67,"context_line":""}],"source_content_type":"text/x-python","patch_set":14,"id":"1aa78d24_cc27ebb3","line":64,"in_reply_to":"1aa78d24_ef70de75","updated":"2016-07-14 20:03:20.000000000","message":"OK, I see. You simply quoted SubPort instead of referencing the class. When you do it this way the shuffle is needed.","commit_id":"ae220ea92c3a99542531c1645893ef6ea488e6fc"}],"neutron/services/trunk/plugin.py":[{"author":{"_account_id":16800,"name":"Rawlin Peters","email":"rawlin.peters@hpe.com","username":"rawlin"},"change_message_id":"2a2dd7eecfd1b42f567b0b9996adb638c04b331a","unresolved":false,"context_lines":[{"line_number":44,"context_line":"                                              port_id\u003dport_db.id)"},{"line_number":45,"context_line":"        if obj:"},{"line_number":46,"context_line":"            port_res[\u0027trunk_details\u0027][\u0027trunk_id\u0027] \u003d obj[0][\u0027id\u0027]"},{"line_number":47,"context_line":"            subports \u003d [x.to_dict() for x in obj[0][\u0027sub_ports\u0027]]"},{"line_number":48,"context_line":"            port_res[\u0027trunk_details\u0027][\u0027sub_ports\u0027] \u003d subports"},{"line_number":49,"context_line":"        return port_res"},{"line_number":50,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"3aaa91ec_84483a89","line":47,"range":{"start_line":47,"start_character":12,"end_line":47,"end_character":65},"updated":"2016-06-27 22:58:41.000000000","message":"The \u0027trunk_id\u0027 in each subport would be the same as port_res[\u0027trunk_details\u0027][\u0027trunk_id\u0027]. Should we clean out the redundant \u0027trunk_id\u0027s in the subports?","commit_id":"c91f6966675db923c0f3893e6ecc817006ac1750"},{"author":{"_account_id":4187,"name":"Ryan Tidwell","email":"rtidwell@suse.com","username":"ryan-tidwell"},"change_message_id":"d192a5878ef10d88384c0f645b60f73d312e08d7","unresolved":false,"context_lines":[{"line_number":44,"context_line":"                                              port_id\u003dport_db.id)"},{"line_number":45,"context_line":"        if obj:"},{"line_number":46,"context_line":"            port_res[\u0027trunk_details\u0027][\u0027trunk_id\u0027] \u003d obj[0][\u0027id\u0027]"},{"line_number":47,"context_line":"            subports \u003d [x.to_dict() for x in obj[0][\u0027sub_ports\u0027]]"},{"line_number":48,"context_line":"            port_res[\u0027trunk_details\u0027][\u0027sub_ports\u0027] \u003d subports"},{"line_number":49,"context_line":"        return port_res"},{"line_number":50,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"3aaa91ec_ff30a7ea","line":47,"range":{"start_line":47,"start_character":12,"end_line":47,"end_character":65},"in_reply_to":"3aaa91ec_84483a89","updated":"2016-06-27 23:01:59.000000000","message":"It might be nice to just include the trunk_id in the subport dict. This would allow you to peel out the subport without needing to grab the trunk_id from elsewhere if you needed to call back to the server via RPC or REST API for some reason. Not strictly necessary to include it, but it could actually come in handy.","commit_id":"c91f6966675db923c0f3893e6ecc817006ac1750"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"7608021a6312244d388fa627a55d4c987ea748c3","unresolved":false,"context_lines":[{"line_number":40,"context_line":"    \"\"\"Add trunk details to a port.\"\"\""},{"line_number":41,"context_line":"    if manager.NeutronManager.get_service_plugins().get(\u0027trunk\u0027):"},{"line_number":42,"context_line":"        port_res[\u0027trunk_details\u0027] \u003d {}"},{"line_number":43,"context_line":"        obj \u003d trunk_objects.Trunk.get_objects(context.get_admin_context(),"},{"line_number":44,"context_line":"                                              port_id\u003dport_db.id)"},{"line_number":45,"context_line":"        if obj:"},{"line_number":46,"context_line":"            port_res[\u0027trunk_details\u0027][\u0027trunk_id\u0027] \u003d obj[0][\u0027id\u0027]"}],"source_content_type":"text/x-python","patch_set":2,"id":"3aaa91ec_eb7271e2","line":43,"range":{"start_line":43,"start_character":46,"end_line":43,"end_character":73},"updated":"2016-06-28 22:00:34.000000000","message":"I haven\u0027t seen any other extend functions get the context this way.  Most of them take the db object (port_db) and do sqlalchemy type things with it (e.g. trunk_port \u003d port_db.trunk_port).\n\nI\u0027ve not seen another one use any of the neutron.objects stuff either.  So, are we blazing a trail here?  I\u0027m not sure I like having to go grab admin context here for this but I\u0027m not really sure what the right answer is with these fancy new OVO objects.\n\nIt\u0027d be nice if we could just create a versioned object straight from port_db.trunk_port.  But, I don\u0027t see a way.  I see from_db_object [1] but it is not a classmethod which means you need an instance already and I think you still need the context to construct an instance.  Hmmm.","commit_id":"3a9364144e87522e8ca58a334a944fec33052c18"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"7608021a6312244d388fa627a55d4c987ea748c3","unresolved":false,"context_lines":[{"line_number":40,"context_line":"    \"\"\"Add trunk details to a port.\"\"\""},{"line_number":41,"context_line":"    if manager.NeutronManager.get_service_plugins().get(\u0027trunk\u0027):"},{"line_number":42,"context_line":"        port_res[\u0027trunk_details\u0027] \u003d {}"},{"line_number":43,"context_line":"        obj \u003d trunk_objects.Trunk.get_objects(context.get_admin_context(),"},{"line_number":44,"context_line":"                                              port_id\u003dport_db.id)"},{"line_number":45,"context_line":"        if obj:"},{"line_number":46,"context_line":"            port_res[\u0027trunk_details\u0027][\u0027trunk_id\u0027] \u003d obj[0][\u0027id\u0027]"}],"source_content_type":"text/x-python","patch_set":2,"id":"3aaa91ec_2ea64753","line":43,"range":{"start_line":43,"start_character":34,"end_line":43,"end_character":45},"updated":"2016-06-28 22:00:34.000000000","message":"Why not use get_object instead of get_objects?","commit_id":"3a9364144e87522e8ca58a334a944fec33052c18"},{"author":{"_account_id":4187,"name":"Ryan Tidwell","email":"rtidwell@suse.com","username":"ryan-tidwell"},"change_message_id":"9587da11b7af8dc9035907a1a17e57b6954fecc2","unresolved":false,"context_lines":[{"line_number":40,"context_line":"    \"\"\"Add trunk details to a port.\"\"\""},{"line_number":41,"context_line":"    if manager.NeutronManager.get_service_plugins().get(\u0027trunk\u0027):"},{"line_number":42,"context_line":"        port_res[\u0027trunk_details\u0027] \u003d {}"},{"line_number":43,"context_line":"        obj \u003d trunk_objects.Trunk.get_objects(context.get_admin_context(),"},{"line_number":44,"context_line":"                                              port_id\u003dport_db.id)"},{"line_number":45,"context_line":"        if obj:"},{"line_number":46,"context_line":"            port_res[\u0027trunk_details\u0027][\u0027trunk_id\u0027] \u003d obj[0][\u0027id\u0027]"}],"source_content_type":"text/x-python","patch_set":2,"id":"3aaa91ec_fc46b51f","line":43,"range":{"start_line":43,"start_character":34,"end_line":43,"end_character":45},"in_reply_to":"3aaa91ec_2ea64753","updated":"2016-06-28 22:51:49.000000000","message":"After looking long and hard I\u0027m not seeing a way to query for specific object without passing all of the key attributes. In this case, all I have is port_id. We know there will only ever be 1 subport with a given port_id given the unique constratin. However, get_object() seems to force you to scrounge up segmentation_type and segmentation_id as well. Those are fields we don\u0027t have at our disposal here.","commit_id":"3a9364144e87522e8ca58a334a944fec33052c18"},{"author":{"_account_id":4187,"name":"Ryan Tidwell","email":"rtidwell@suse.com","username":"ryan-tidwell"},"change_message_id":"9587da11b7af8dc9035907a1a17e57b6954fecc2","unresolved":false,"context_lines":[{"line_number":40,"context_line":"    \"\"\"Add trunk details to a port.\"\"\""},{"line_number":41,"context_line":"    if manager.NeutronManager.get_service_plugins().get(\u0027trunk\u0027):"},{"line_number":42,"context_line":"        port_res[\u0027trunk_details\u0027] \u003d {}"},{"line_number":43,"context_line":"        obj \u003d trunk_objects.Trunk.get_objects(context.get_admin_context(),"},{"line_number":44,"context_line":"                                              port_id\u003dport_db.id)"},{"line_number":45,"context_line":"        if obj:"},{"line_number":46,"context_line":"            port_res[\u0027trunk_details\u0027][\u0027trunk_id\u0027] \u003d obj[0][\u0027id\u0027]"}],"source_content_type":"text/x-python","patch_set":2,"id":"3aaa91ec_bc29cd39","line":43,"range":{"start_line":43,"start_character":46,"end_line":43,"end_character":73},"in_reply_to":"3aaa91ec_eb7271e2","updated":"2016-06-28 22:51:49.000000000","message":"Yeah, grabbing the admin context in this way feels strange. It would be nice to not be using an admin context here. However, I don\u0027t see any other way to get at a context.","commit_id":"3a9364144e87522e8ca58a334a944fec33052c18"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"7608021a6312244d388fa627a55d4c987ea748c3","unresolved":false,"context_lines":[{"line_number":43,"context_line":"        obj \u003d trunk_objects.Trunk.get_objects(context.get_admin_context(),"},{"line_number":44,"context_line":"                                              port_id\u003dport_db.id)"},{"line_number":45,"context_line":"        if obj:"},{"line_number":46,"context_line":"            port_res[\u0027trunk_details\u0027][\u0027trunk_id\u0027] \u003d obj[0][\u0027id\u0027]"},{"line_number":47,"context_line":"            subports \u003d [x.to_dict() for x in obj[0][\u0027sub_ports\u0027]]"},{"line_number":48,"context_line":"            port_res[\u0027trunk_details\u0027][\u0027sub_ports\u0027] \u003d subports"},{"line_number":49,"context_line":"        return port_res"}],"source_content_type":"text/x-python","patch_set":2,"id":"3aaa91ec_8bee4d89","line":46,"range":{"start_line":46,"start_character":52,"end_line":46,"end_character":58},"updated":"2016-06-28 22:00:34.000000000","message":"nit:  It might be nice to extract a local variable for this:\n\n  trunk \u003d obj[0]\n\nIt makes it a little more readable and confines the hard-coded access of the first element of the list to a single line of code.","commit_id":"3a9364144e87522e8ca58a334a944fec33052c18"},{"author":{"_account_id":4187,"name":"Ryan Tidwell","email":"rtidwell@suse.com","username":"ryan-tidwell"},"change_message_id":"d0eebf61db16451ea6ef2b114279c6820be778c5","unresolved":false,"context_lines":[{"line_number":39,"context_line":"    \"\"\"Add trunk details to a port.\"\"\""},{"line_number":40,"context_line":"    if manager.NeutronManager.get_service_plugins().get(\u0027trunk\u0027):"},{"line_number":41,"context_line":"        port_res[\u0027trunk_details\u0027] \u003d {}"},{"line_number":42,"context_line":"        trunks \u003d trunk_objects.Trunk.get_objects(context.get_admin_context(),"},{"line_number":43,"context_line":"                                                 port_id\u003dport_db.id)"},{"line_number":44,"context_line":"        if trunks:"},{"line_number":45,"context_line":"            port_res[\u0027trunk_details\u0027][\u0027trunk_id\u0027] \u003d trunks[0][\u0027id\u0027]"}],"source_content_type":"text/x-python","patch_set":3,"id":"3aaa91ec_574c0270","line":42,"updated":"2016-06-28 23:20:23.000000000","message":"Using get_objects() here and at L50 intentionally. Not seeing a way to query for an object simply by passing a single field when using get_object(). get_object() seems to require you to pass all  attributes. In this case we only have one of them handy (port_id). What am I missing?","commit_id":"2cb5350f62f254b06a17e4fe56552a00b6e9ee6d"},{"author":{"_account_id":21273,"name":"Ilya Chukhnakov","email":"Ilya.chukhnakov@gmail.com","username":"ichukhnakov"},"change_message_id":"3c625ec54e1e7c95324706254714ad83c06b3505","unresolved":false,"context_lines":[{"line_number":39,"context_line":"    \"\"\"Add trunk details to a port.\"\"\""},{"line_number":40,"context_line":"    if manager.NeutronManager.get_service_plugins().get(\u0027trunk\u0027):"},{"line_number":41,"context_line":"        port_res[\u0027trunk_details\u0027] \u003d {}"},{"line_number":42,"context_line":"        trunks \u003d trunk_objects.Trunk.get_objects(context.get_admin_context(),"},{"line_number":43,"context_line":"                                                 port_id\u003dport_db.id)"},{"line_number":44,"context_line":"        if trunks:"},{"line_number":45,"context_line":"            port_res[\u0027trunk_details\u0027][\u0027trunk_id\u0027] \u003d trunks[0][\u0027id\u0027]"}],"source_content_type":"text/x-python","patch_set":3,"id":"3aaa91ec_7b3c2893","line":42,"in_reply_to":"3aaa91ec_574c0270","updated":"2016-06-30 14:59:25.000000000","message":"I guess I need to un-abandon [1] then :) I thought we would not need it any more.\n\n[1] https://review.openstack.org/#/c/322024/","commit_id":"2cb5350f62f254b06a17e4fe56552a00b6e9ee6d"},{"author":{"_account_id":4187,"name":"Ryan Tidwell","email":"rtidwell@suse.com","username":"ryan-tidwell"},"change_message_id":"b67a68f84c60e2b22eb4eca8b569496e94335c4a","unresolved":false,"context_lines":[{"line_number":39,"context_line":"    \"\"\"Add trunk details to a port.\"\"\""},{"line_number":40,"context_line":"    if manager.NeutronManager.get_service_plugins().get(\u0027trunk\u0027):"},{"line_number":41,"context_line":"        port_res[\u0027trunk_details\u0027] \u003d {}"},{"line_number":42,"context_line":"        trunks \u003d trunk_objects.Trunk.get_objects(context.get_admin_context(),"},{"line_number":43,"context_line":"                                                 port_id\u003dport_db.id)"},{"line_number":44,"context_line":"        if trunks:"},{"line_number":45,"context_line":"            port_res[\u0027trunk_details\u0027][\u0027trunk_id\u0027] \u003d trunks[0][\u0027id\u0027]"}],"source_content_type":"text/x-python","patch_set":3,"id":"3aaa91ec_b4b5fded","line":42,"in_reply_to":"3aaa91ec_7b3c2893","updated":"2016-06-30 15:50:54.000000000","message":"Nice! Yes, let\u0027s revive that.","commit_id":"2cb5350f62f254b06a17e4fe56552a00b6e9ee6d"},{"author":{"_account_id":21273,"name":"Ilya Chukhnakov","email":"Ilya.chukhnakov@gmail.com","username":"ichukhnakov"},"change_message_id":"33abdfda380c678249128a52afb21d59af9a791b","unresolved":false,"context_lines":[{"line_number":39,"context_line":"    \"\"\"Add trunk details to a port.\"\"\""},{"line_number":40,"context_line":"    if manager.NeutronManager.get_service_plugins().get(\u0027trunk\u0027):"},{"line_number":41,"context_line":"        port_res[\u0027trunk_details\u0027] \u003d {}"},{"line_number":42,"context_line":"        trunks \u003d trunk_objects.Trunk.get_objects(context.get_admin_context(),"},{"line_number":43,"context_line":"                                                 port_id\u003dport_db.id)"},{"line_number":44,"context_line":"        if trunks:"},{"line_number":45,"context_line":"            port_res[\u0027trunk_details\u0027][\u0027trunk_id\u0027] \u003d trunks[0][\u0027id\u0027]"}],"source_content_type":"text/x-python","patch_set":3,"id":"3aaa91ec_b664af21","line":42,"in_reply_to":"3aaa91ec_b4b5fded","updated":"2016-07-01 12:58:55.000000000","message":"Done! Also updated it so \u0027unique_keys\u0027 are generated automagically from the model itself (i.e. you don\u0027t need to set \u0027unique_keys\u0027 in SubPort/Trunk).","commit_id":"2cb5350f62f254b06a17e4fe56552a00b6e9ee6d"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"3f114ce8e4c60577c19e33888ab6fcf5cf4fa99c","unresolved":false,"context_lines":[{"line_number":33,"context_line":""},{"line_number":34,"context_line":""},{"line_number":35,"context_line":"def _extend_port_trunk_details(core_plugin, port_res, port_db):"},{"line_number":36,"context_line":"    \"\"\"Add trunk details to a port.\"\"\""},{"line_number":37,"context_line":"    port_res[\u0027trunk_details\u0027] \u003d {}"},{"line_number":38,"context_line":""},{"line_number":39,"context_line":"    if port_db.trunk_port:"}],"source_content_type":"text/x-python","patch_set":8,"id":"1aa78d24_362f5ea2","line":36,"range":{"start_line":36,"start_character":7,"end_line":36,"end_character":34},"updated":"2016-07-06 22:49:13.000000000","message":"So, this patch set ditches the OVO objects and goes straight for the sqlalchemy relationships.  I suggested this on PS2 and I like it better.\n\nEventually, it would be nice to be able to do this with OVO objects.  But, I couldn\u0027t find a way.  I know Ryan looked hard for a way too.  I really didn\u0027t like the way we had to pull a context out of thin air to run queries with OVO objects.  We\u0027re going to have to get to the point where OVO objects do not require that.\n\nIt\u0027d be nice if they understood the relationships we set up in the sqlalchemy ORM.  Do they?  Even if they do, until we have ports fully converted over to OVO, we would still have to do the pull-context-out-of-thin-air hack.  Right?\n\nI\u0027d like to hear from an OVO expert on this.  But, I wouldn\u0027t hold up this patch set for it.","commit_id":"dbbde08da5618ad7ed9499ebbfa22083ce290e18"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"2a0e6dc6d2a843f76de9c12b528215bcc209fdb8","unresolved":false,"context_lines":[{"line_number":34,"context_line":""},{"line_number":35,"context_line":"def _extend_port_trunk_details(core_plugin, port_res, port_db):"},{"line_number":36,"context_line":"    \"\"\"Add trunk details to a port.\"\"\""},{"line_number":37,"context_line":"    port_res[\u0027trunk_details\u0027] \u003d {}"},{"line_number":38,"context_line":""},{"line_number":39,"context_line":"    if port_db.trunk_port:"},{"line_number":40,"context_line":"            port_res[\u0027trunk_details\u0027][\u0027trunk_id\u0027] \u003d port_db.trunk_port.id"}],"source_content_type":"text/x-python","patch_set":8,"id":"1aa78d24_168ea2cf","line":37,"range":{"start_line":37,"start_character":4,"end_line":37,"end_character":34},"updated":"2016-07-06 22:45:10.000000000","message":"nit:  I think you could do this and avoid too many verbose references to port_res[\u0027trunk_details\u0027] in the code below:\n\n  port_res[\u0027trunk_details\u0027] \u003d details \u003d {}\n\nThen just use details below.","commit_id":"dbbde08da5618ad7ed9499ebbfa22083ce290e18"},{"author":{"_account_id":4187,"name":"Ryan Tidwell","email":"rtidwell@suse.com","username":"ryan-tidwell"},"change_message_id":"2e95e46e2fd2b023d7dece51d2f8fb90bee16b2d","unresolved":false,"context_lines":[{"line_number":37,"context_line":"    port_res[\u0027trunk_details\u0027] \u003d {}"},{"line_number":38,"context_line":""},{"line_number":39,"context_line":"    if port_db.trunk_port:"},{"line_number":40,"context_line":"            port_res[\u0027trunk_details\u0027][\u0027trunk_id\u0027] \u003d port_db.trunk_port.id"},{"line_number":41,"context_line":"            subports \u003d [{\u0027segmentation_id\u0027: x.segmentation_id,"},{"line_number":42,"context_line":"                         \u0027segmentation_type\u0027: x.segmentation_type,"},{"line_number":43,"context_line":"                         \u0027port_id\u0027: x.port_id}"}],"source_content_type":"text/x-python","patch_set":8,"id":"1aa78d24_f605d645","line":40,"range":{"start_line":40,"start_character":0,"end_line":40,"end_character":12},"updated":"2016-07-06 22:42:44.000000000","message":"Doh! Too much indentation...","commit_id":"dbbde08da5618ad7ed9499ebbfa22083ce290e18"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"2a0e6dc6d2a843f76de9c12b528215bcc209fdb8","unresolved":false,"context_lines":[{"line_number":37,"context_line":"    port_res[\u0027trunk_details\u0027] \u003d {}"},{"line_number":38,"context_line":""},{"line_number":39,"context_line":"    if port_db.trunk_port:"},{"line_number":40,"context_line":"            port_res[\u0027trunk_details\u0027][\u0027trunk_id\u0027] \u003d port_db.trunk_port.id"},{"line_number":41,"context_line":"            subports \u003d [{\u0027segmentation_id\u0027: x.segmentation_id,"},{"line_number":42,"context_line":"                         \u0027segmentation_type\u0027: x.segmentation_type,"},{"line_number":43,"context_line":"                         \u0027port_id\u0027: x.port_id}"}],"source_content_type":"text/x-python","patch_set":8,"id":"1aa78d24_56666a51","line":40,"range":{"start_line":40,"start_character":8,"end_line":40,"end_character":12},"updated":"2016-07-06 22:45:10.000000000","message":"I\u0027m sure you\u0027ll fix this.","commit_id":"dbbde08da5618ad7ed9499ebbfa22083ce290e18"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"3d70215353193a625d90fd06b58edbea2982c4a3","unresolved":false,"context_lines":[{"line_number":34,"context_line":""},{"line_number":35,"context_line":"def _extend_port_trunk_details(core_plugin, port_res, port_db):"},{"line_number":36,"context_line":"    \"\"\"Add trunk details to a port.\"\"\""},{"line_number":37,"context_line":"    port_res[\u0027trunk_details\u0027] \u003d {}"},{"line_number":38,"context_line":""},{"line_number":39,"context_line":"    if port_db.trunk_port:"},{"line_number":40,"context_line":"        port_res[\u0027trunk_details\u0027][\u0027trunk_id\u0027] \u003d port_db.trunk_port.id"}],"source_content_type":"text/x-python","patch_set":9,"id":"1aa78d24_391d8f66","line":37,"range":{"start_line":37,"start_character":4,"end_line":37,"end_character":34},"updated":"2016-07-06 22:51:27.000000000","message":"nit:  Do consider my comment on PS8 here.","commit_id":"84ab8da14550f4297322c5144e7566b5827555c6"},{"author":{"_account_id":4187,"name":"Ryan Tidwell","email":"rtidwell@suse.com","username":"ryan-tidwell"},"change_message_id":"09c03fdb9b72cff3d7e89aed48f8c0c7225e8a73","unresolved":false,"context_lines":[{"line_number":34,"context_line":""},{"line_number":35,"context_line":"def _extend_port_trunk_details(core_plugin, port_res, port_db):"},{"line_number":36,"context_line":"    \"\"\"Add trunk details to a port.\"\"\""},{"line_number":37,"context_line":"    port_res[\u0027trunk_details\u0027] \u003d {}"},{"line_number":38,"context_line":""},{"line_number":39,"context_line":"    if port_db.trunk_port:"},{"line_number":40,"context_line":"        port_res[\u0027trunk_details\u0027][\u0027trunk_id\u0027] \u003d port_db.trunk_port.id"}],"source_content_type":"text/x-python","patch_set":9,"id":"1aa78d24_d900cb36","line":37,"range":{"start_line":37,"start_character":4,"end_line":37,"end_character":34},"in_reply_to":"1aa78d24_391d8f66","updated":"2016-07-06 23:16:33.000000000","message":"Done","commit_id":"84ab8da14550f4297322c5144e7566b5827555c6"},{"author":{"_account_id":21273,"name":"Ilya Chukhnakov","email":"Ilya.chukhnakov@gmail.com","username":"ichukhnakov"},"change_message_id":"7b1ebd8770a984bf56daa9f921d818ec3f8bdc11","unresolved":false,"context_lines":[{"line_number":42,"context_line":"                     \u0027segmentation_type\u0027: x.segmentation_type,"},{"line_number":43,"context_line":"                     \u0027port_id\u0027: x.port_id}"},{"line_number":44,"context_line":"                    for x in port_db.trunk_port.sub_ports]"},{"line_number":45,"context_line":"        port_res[\u0027trunk_details\u0027][\u0027sub_ports\u0027] \u003d subports"},{"line_number":46,"context_line":"    elif port_db.sub_port:"},{"line_number":47,"context_line":"        port_res[\u0027trunk_details\u0027] \u003d {"},{"line_number":48,"context_line":"            \u0027segmentation_id\u0027: port_db.sub_port.segmentation_id,"}],"source_content_type":"text/x-python","patch_set":9,"id":"1aa78d24_3990ef94","line":45,"range":{"start_line":45,"start_character":8,"end_line":45,"end_character":57},"updated":"2016-07-06 22:59:11.000000000","message":"That would be adding a pretty large blob to the port (about 400KB for 4K vlans). I think we should avoid that.","commit_id":"84ab8da14550f4297322c5144e7566b5827555c6"},{"author":{"_account_id":16800,"name":"Rawlin Peters","email":"rawlin.peters@hpe.com","username":"rawlin"},"change_message_id":"e746ba0ed8d3bd98424ffc9688d443c4e008bc19","unresolved":false,"context_lines":[{"line_number":42,"context_line":"                     \u0027segmentation_type\u0027: x.segmentation_type,"},{"line_number":43,"context_line":"                     \u0027port_id\u0027: x.port_id}"},{"line_number":44,"context_line":"                    for x in port_db.trunk_port.sub_ports]"},{"line_number":45,"context_line":"        port_res[\u0027trunk_details\u0027][\u0027sub_ports\u0027] \u003d subports"},{"line_number":46,"context_line":"    elif port_db.sub_port:"},{"line_number":47,"context_line":"        port_res[\u0027trunk_details\u0027] \u003d {"},{"line_number":48,"context_line":"            \u0027segmentation_id\u0027: port_db.sub_port.segmentation_id,"}],"source_content_type":"text/x-python","patch_set":9,"id":"1aa78d24_f1cf6027","line":45,"range":{"start_line":45,"start_character":8,"end_line":45,"end_character":57},"in_reply_to":"1aa78d24_0e364be7","updated":"2016-07-07 21:43:36.000000000","message":"@Ilya Nova will have to get an existing port and update it, and it\u0027s probably better that they don\u0027t have to make an additional REST call to Neutron to grab the subport data if the port has \u0027trunk_id\u0027 in order to populate any subport metadata. Then again it does seem reasonable.","commit_id":"84ab8da14550f4297322c5144e7566b5827555c6"},{"author":{"_account_id":16800,"name":"Rawlin Peters","email":"rawlin.peters@hpe.com","username":"rawlin"},"change_message_id":"2f5a74cf5d9fb67e2e67eb0ab8878553ddab00f9","unresolved":false,"context_lines":[{"line_number":42,"context_line":"                     \u0027segmentation_type\u0027: x.segmentation_type,"},{"line_number":43,"context_line":"                     \u0027port_id\u0027: x.port_id}"},{"line_number":44,"context_line":"                    for x in port_db.trunk_port.sub_ports]"},{"line_number":45,"context_line":"        port_res[\u0027trunk_details\u0027][\u0027sub_ports\u0027] \u003d subports"},{"line_number":46,"context_line":"    elif port_db.sub_port:"},{"line_number":47,"context_line":"        port_res[\u0027trunk_details\u0027] \u003d {"},{"line_number":48,"context_line":"            \u0027segmentation_id\u0027: port_db.sub_port.segmentation_id,"}],"source_content_type":"text/x-python","patch_set":9,"id":"1aa78d24_e7524266","line":45,"range":{"start_line":45,"start_character":8,"end_line":45,"end_character":57},"in_reply_to":"1aa78d24_27b44a33","updated":"2016-07-07 00:31:32.000000000","message":"@Ilya unless we modify the get_device_details() RPC to include a port\u0027s trunk_details, the agent won\u0027t even get this data without a different RPC call and won\u0027t be able to distinguish trunk ports from regular ports (except from the fact that the ports were added to a trunk bridge).\n\nIn terms of scale, I think having a port with potentially thousands of data items might be more efficiently passed around than passing around thousands of ports, but it does seem somewhat wasteful to have the list of subports exposed from the API if it\u0027s only required for a few areas.\n\nA trunk port in essence is a merge of potentially thousands of neutron ports, so I\u0027m not sure we can avoid these \"performance implications\" altogether.","commit_id":"84ab8da14550f4297322c5144e7566b5827555c6"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"3e1d5a64a6b72c44d640417603c08a0d1489cf58","unresolved":false,"context_lines":[{"line_number":42,"context_line":"                     \u0027segmentation_type\u0027: x.segmentation_type,"},{"line_number":43,"context_line":"                     \u0027port_id\u0027: x.port_id}"},{"line_number":44,"context_line":"                    for x in port_db.trunk_port.sub_ports]"},{"line_number":45,"context_line":"        port_res[\u0027trunk_details\u0027][\u0027sub_ports\u0027] \u003d subports"},{"line_number":46,"context_line":"    elif port_db.sub_port:"},{"line_number":47,"context_line":"        port_res[\u0027trunk_details\u0027] \u003d {"},{"line_number":48,"context_line":"            \u0027segmentation_id\u0027: port_db.sub_port.segmentation_id,"}],"source_content_type":"text/x-python","patch_set":9,"id":"1aa78d24_7c29c589","line":45,"range":{"start_line":45,"start_character":8,"end_line":45,"end_character":57},"in_reply_to":"1aa78d24_39774f03","updated":"2016-07-06 23:26:33.000000000","message":"That\u0027s the whole point of this extension though.","commit_id":"84ab8da14550f4297322c5144e7566b5827555c6"},{"author":{"_account_id":4187,"name":"Ryan Tidwell","email":"rtidwell@suse.com","username":"ryan-tidwell"},"change_message_id":"09c03fdb9b72cff3d7e89aed48f8c0c7225e8a73","unresolved":false,"context_lines":[{"line_number":42,"context_line":"                     \u0027segmentation_type\u0027: x.segmentation_type,"},{"line_number":43,"context_line":"                     \u0027port_id\u0027: x.port_id}"},{"line_number":44,"context_line":"                    for x in port_db.trunk_port.sub_ports]"},{"line_number":45,"context_line":"        port_res[\u0027trunk_details\u0027][\u0027sub_ports\u0027] \u003d subports"},{"line_number":46,"context_line":"    elif port_db.sub_port:"},{"line_number":47,"context_line":"        port_res[\u0027trunk_details\u0027] \u003d {"},{"line_number":48,"context_line":"            \u0027segmentation_id\u0027: port_db.sub_port.segmentation_id,"}],"source_content_type":"text/x-python","patch_set":9,"id":"1aa78d24_39774f03","line":45,"range":{"start_line":45,"start_character":8,"end_line":45,"end_character":57},"in_reply_to":"1aa78d24_3990ef94","updated":"2016-07-06 23:16:33.000000000","message":"If there\u0027s something to be gained from including subports in the trunk details I\u0027m not terribly concerned about that scale. If all we need to expose is the trunk_id then there\u0027s no sense including it.","commit_id":"84ab8da14550f4297322c5144e7566b5827555c6"},{"author":{"_account_id":21273,"name":"Ilya Chukhnakov","email":"Ilya.chukhnakov@gmail.com","username":"ichukhnakov"},"change_message_id":"3006ca07d090546dfe37ee98a7dcb2522cf8a4bc","unresolved":false,"context_lines":[{"line_number":42,"context_line":"                     \u0027segmentation_type\u0027: x.segmentation_type,"},{"line_number":43,"context_line":"                     \u0027port_id\u0027: x.port_id}"},{"line_number":44,"context_line":"                    for x in port_db.trunk_port.sub_ports]"},{"line_number":45,"context_line":"        port_res[\u0027trunk_details\u0027][\u0027sub_ports\u0027] \u003d subports"},{"line_number":46,"context_line":"    elif port_db.sub_port:"},{"line_number":47,"context_line":"        port_res[\u0027trunk_details\u0027] \u003d {"},{"line_number":48,"context_line":"            \u0027segmentation_id\u0027: port_db.sub_port.segmentation_id,"}],"source_content_type":"text/x-python","patch_set":9,"id":"1aa78d24_9208d5db","line":45,"range":{"start_line":45,"start_character":8,"end_line":45,"end_character":57},"in_reply_to":"1aa78d24_727a8989","updated":"2016-07-07 03:45:50.000000000","message":"\u003e except from the fact that the ports were added to a trunk bridge\n\nI\u0027ve probably missed the point. Do we modify get_device_details to include trunk_details or do we rely on the fact that the port is plugged into a trunk bridge (I kind of like the latter)?\n\nIf we do not rely on get_device_details, there\u0027s no problem at all - we just need the Trunk RPC call to fetch Trunk by port_id instead of trunk_id.","commit_id":"84ab8da14550f4297322c5144e7566b5827555c6"},{"author":{"_account_id":16800,"name":"Rawlin Peters","email":"rawlin.peters@hpe.com","username":"rawlin"},"change_message_id":"dd2472a31fcdf3229c72fd4b244dd8ad6cb01cd6","unresolved":false,"context_lines":[{"line_number":42,"context_line":"                     \u0027segmentation_type\u0027: x.segmentation_type,"},{"line_number":43,"context_line":"                     \u0027port_id\u0027: x.port_id}"},{"line_number":44,"context_line":"                    for x in port_db.trunk_port.sub_ports]"},{"line_number":45,"context_line":"        port_res[\u0027trunk_details\u0027][\u0027sub_ports\u0027] \u003d subports"},{"line_number":46,"context_line":"    elif port_db.sub_port:"},{"line_number":47,"context_line":"        port_res[\u0027trunk_details\u0027] \u003d {"},{"line_number":48,"context_line":"            \u0027segmentation_id\u0027: port_db.sub_port.segmentation_id,"}],"source_content_type":"text/x-python","patch_set":9,"id":"1aa78d24_ac763103","line":45,"range":{"start_line":45,"start_character":8,"end_line":45,"end_character":57},"in_reply_to":"1aa78d24_7a9ed307","updated":"2016-07-07 16:19:40.000000000","message":"I think we need to lay out what use cases we intend to use the \u0027trunk_details\u0027 extension for.\n\nMy initial approach to cascading a trunk\u0027s portbinding to its subports [1] takes advantage of the sub_ports list, but there are concerns about doing potentially thousands of port updates from a single API call b/c each port update can take between 0.1 to 1 second. I think whatever the final solution is, it will still need to update every subport of a trunk somehow, which is where this sub_ports list will come in handy. However, it could use a separate utility to get all of a trunk\u0027s subports without necessarily exposing this from the port API.\n\nThe main reason I can think of as to why we may need the sub_ports exposed from the API is for Nova to consume, like Armando mentioned. At some point in the future Nova should be able to expose that data from its metadata API so that guests can more easily configure all the vlan interfaces on the trunk interface. Attaching the list of subports to the trunk port makes it simple for Nova to consume.\n\n[1] https://review.openstack.org/#/c/336277/","commit_id":"84ab8da14550f4297322c5144e7566b5827555c6"},{"author":{"_account_id":4187,"name":"Ryan Tidwell","email":"rtidwell@suse.com","username":"ryan-tidwell"},"change_message_id":"86e560a982b2822ea2f2cb8665263c7743337bf6","unresolved":false,"context_lines":[{"line_number":42,"context_line":"                     \u0027segmentation_type\u0027: x.segmentation_type,"},{"line_number":43,"context_line":"                     \u0027port_id\u0027: x.port_id}"},{"line_number":44,"context_line":"                    for x in port_db.trunk_port.sub_ports]"},{"line_number":45,"context_line":"        port_res[\u0027trunk_details\u0027][\u0027sub_ports\u0027] \u003d subports"},{"line_number":46,"context_line":"    elif port_db.sub_port:"},{"line_number":47,"context_line":"        port_res[\u0027trunk_details\u0027] \u003d {"},{"line_number":48,"context_line":"            \u0027segmentation_id\u0027: port_db.sub_port.segmentation_id,"}],"source_content_type":"text/x-python","patch_set":9,"id":"1aa78d24_bcfded6f","line":45,"range":{"start_line":45,"start_character":8,"end_line":45,"end_character":57},"in_reply_to":"1aa78d24_7c29c589","updated":"2016-07-06 23:48:07.000000000","message":"Let\u0027s expose it then. I\u0027m not really concerned about the scale.","commit_id":"84ab8da14550f4297322c5144e7566b5827555c6"},{"author":{"_account_id":21273,"name":"Ilya Chukhnakov","email":"Ilya.chukhnakov@gmail.com","username":"ichukhnakov"},"change_message_id":"429a9aab25466448c90e5287f23407307848920f","unresolved":false,"context_lines":[{"line_number":42,"context_line":"                     \u0027segmentation_type\u0027: x.segmentation_type,"},{"line_number":43,"context_line":"                     \u0027port_id\u0027: x.port_id}"},{"line_number":44,"context_line":"                    for x in port_db.trunk_port.sub_ports]"},{"line_number":45,"context_line":"        port_res[\u0027trunk_details\u0027][\u0027sub_ports\u0027] \u003d subports"},{"line_number":46,"context_line":"    elif port_db.sub_port:"},{"line_number":47,"context_line":"        port_res[\u0027trunk_details\u0027] \u003d {"},{"line_number":48,"context_line":"            \u0027segmentation_id\u0027: port_db.sub_port.segmentation_id,"}],"source_content_type":"text/x-python","patch_set":9,"id":"1aa78d24_dc3d592c","line":45,"range":{"start_line":45,"start_character":8,"end_line":45,"end_character":57},"in_reply_to":"1aa78d24_7c29c589","updated":"2016-07-06 23:51:56.000000000","message":"Would not just the \u0027trunk_id\u0027 be enough here? Sure, it would require an additional rpc call on the agent side to fetch sub-ports, but otherwise it might heavily affect other uses of port that do not require trunk details.","commit_id":"84ab8da14550f4297322c5144e7566b5827555c6"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"ccaa5015d8ef50cac4806479909eecf93ec68970","unresolved":false,"context_lines":[{"line_number":42,"context_line":"                     \u0027segmentation_type\u0027: x.segmentation_type,"},{"line_number":43,"context_line":"                     \u0027port_id\u0027: x.port_id}"},{"line_number":44,"context_line":"                    for x in port_db.trunk_port.sub_ports]"},{"line_number":45,"context_line":"        port_res[\u0027trunk_details\u0027][\u0027sub_ports\u0027] \u003d subports"},{"line_number":46,"context_line":"    elif port_db.sub_port:"},{"line_number":47,"context_line":"        port_res[\u0027trunk_details\u0027] \u003d {"},{"line_number":48,"context_line":"            \u0027segmentation_id\u0027: port_db.sub_port.segmentation_id,"}],"source_content_type":"text/x-python","patch_set":9,"id":"1aa78d24_f09e7105","line":45,"range":{"start_line":45,"start_character":8,"end_line":45,"end_character":57},"in_reply_to":"1aa78d24_9208d5db","updated":"2016-07-07 05:52:27.000000000","message":"This is an extension being consumed by REST clients, like Nova. I don\u0027t fully understand your comment or you\u0027re not quite sure what this is for.","commit_id":"84ab8da14550f4297322c5144e7566b5827555c6"},{"author":{"_account_id":21273,"name":"Ilya Chukhnakov","email":"Ilya.chukhnakov@gmail.com","username":"ichukhnakov"},"change_message_id":"700596fb38889d326ef84eb71c2f8d031b53fc05","unresolved":false,"context_lines":[{"line_number":42,"context_line":"                     \u0027segmentation_type\u0027: x.segmentation_type,"},{"line_number":43,"context_line":"                     \u0027port_id\u0027: x.port_id}"},{"line_number":44,"context_line":"                    for x in port_db.trunk_port.sub_ports]"},{"line_number":45,"context_line":"        port_res[\u0027trunk_details\u0027][\u0027sub_ports\u0027] \u003d subports"},{"line_number":46,"context_line":"    elif port_db.sub_port:"},{"line_number":47,"context_line":"        port_res[\u0027trunk_details\u0027] \u003d {"},{"line_number":48,"context_line":"            \u0027segmentation_id\u0027: port_db.sub_port.segmentation_id,"}],"source_content_type":"text/x-python","patch_set":9,"id":"1aa78d24_0e364be7","line":45,"range":{"start_line":45,"start_character":8,"end_line":45,"end_character":57},"in_reply_to":"1aa78d24_ac763103","updated":"2016-07-07 21:09:16.000000000","message":"@Rawlin, let\u0027s not forget that we already have Trunk API [1] that could provide the sub-ports details in a pretty similar way. Why do we want to duplicate that in port\u0027s \u0027trunk_details\u0027 for all use cases? If at some point in the future Nova would need sub-port list it could use Trunk API [1] for that granted that we have \u0027trunk_id\u0027 in \u0027trunk_details\u0027.\n\nIf we go for sub-port list in \u0027trunk_details\u0027 we\u0027ll force neutron client, Horizon, etc. to download 0.5MB of data for each trunk port when the user queries the port information even if it is not going to be used (or do we expect it to be used in such cases?). Is it really what we want?\n\n[1] https://github.com/openstack/neutron/blob/9cda319/neutron/objects/trunk.py#L83-L94","commit_id":"84ab8da14550f4297322c5144e7566b5827555c6"},{"author":{"_account_id":21273,"name":"Ilya Chukhnakov","email":"Ilya.chukhnakov@gmail.com","username":"ichukhnakov"},"change_message_id":"bf319511b049fc581ce4847bc40509d61f71d1ea","unresolved":false,"context_lines":[{"line_number":42,"context_line":"                     \u0027segmentation_type\u0027: x.segmentation_type,"},{"line_number":43,"context_line":"                     \u0027port_id\u0027: x.port_id}"},{"line_number":44,"context_line":"                    for x in port_db.trunk_port.sub_ports]"},{"line_number":45,"context_line":"        port_res[\u0027trunk_details\u0027][\u0027sub_ports\u0027] \u003d subports"},{"line_number":46,"context_line":"    elif port_db.sub_port:"},{"line_number":47,"context_line":"        port_res[\u0027trunk_details\u0027] \u003d {"},{"line_number":48,"context_line":"            \u0027segmentation_id\u0027: port_db.sub_port.segmentation_id,"}],"source_content_type":"text/x-python","patch_set":9,"id":"1aa78d24_27b44a33","line":45,"range":{"start_line":45,"start_character":8,"end_line":45,"end_character":57},"in_reply_to":"1aa78d24_dc3d592c","updated":"2016-07-07 00:10:51.000000000","message":"I think I need to clarify what I was thinking. I thought that we would add \u0027trunk_id\u0027 to help trunk agent extension distinguish a regular port from the trunk. So it could just \u0027return\u0027 if there is no \u0027trunk_id\u0027 on port but if there is one then it would fetch the list of sub-ports, but that should only happen when the port is plugged (adding/removing sub-ports would be handled by subscribing to sub-port resource notifications).\n\nI\u0027m a bit worried about how increasing the size of the port object by few hundreds of kilobytes would affect overall performance/load on scale. Or am I missing something?","commit_id":"84ab8da14550f4297322c5144e7566b5827555c6"},{"author":{"_account_id":21273,"name":"Ilya Chukhnakov","email":"Ilya.chukhnakov@gmail.com","username":"ichukhnakov"},"change_message_id":"03e32ce397b261c0e7ca114a6cf960d0ff1e8fc6","unresolved":false,"context_lines":[{"line_number":42,"context_line":"                     \u0027segmentation_type\u0027: x.segmentation_type,"},{"line_number":43,"context_line":"                     \u0027port_id\u0027: x.port_id}"},{"line_number":44,"context_line":"                    for x in port_db.trunk_port.sub_ports]"},{"line_number":45,"context_line":"        port_res[\u0027trunk_details\u0027][\u0027sub_ports\u0027] \u003d subports"},{"line_number":46,"context_line":"    elif port_db.sub_port:"},{"line_number":47,"context_line":"        port_res[\u0027trunk_details\u0027] \u003d {"},{"line_number":48,"context_line":"            \u0027segmentation_id\u0027: port_db.sub_port.segmentation_id,"}],"source_content_type":"text/x-python","patch_set":9,"id":"1aa78d24_727a8989","line":45,"range":{"start_line":45,"start_character":8,"end_line":45,"end_character":57},"in_reply_to":"1aa78d24_e7524266","updated":"2016-07-07 03:30:41.000000000","message":"\u003e I think having a port with potentially thousands of data items might be more efficiently passed around than passing around thousands of ports\n\n@Rawlin, I\u0027m not suggesting to pass thousands of ports. And I\u0027m not suggesting that we remove \u0027trunk_details\u0027.\n\nI\u0027m suggesting that we remove the potentially huge \u0027subports\u0027 list from \u0027trunk_details\u0027 but keep \u0027trunk_id\u0027 and maybe add another attribute to clearly distinguish trunk from sub-port if we keep the sub-port \u0027elif\u0027 branch. Then we should also add an RPC call to fetch the corresponding Trunk [1] (including all the sub-ports) that the agent would use if it detects a port that has proper \u0027trunk_details\u0027.\n\n[1] https://github.com/openstack/neutron/blob/9cda319/neutron/objects/trunk.py#L83-L94","commit_id":"84ab8da14550f4297322c5144e7566b5827555c6"},{"author":{"_account_id":21273,"name":"Ilya Chukhnakov","email":"Ilya.chukhnakov@gmail.com","username":"ichukhnakov"},"change_message_id":"f3c7abd30397f90e4916eaf7e891ea2443ccfc38","unresolved":false,"context_lines":[{"line_number":42,"context_line":"                     \u0027segmentation_type\u0027: x.segmentation_type,"},{"line_number":43,"context_line":"                     \u0027port_id\u0027: x.port_id}"},{"line_number":44,"context_line":"                    for x in port_db.trunk_port.sub_ports]"},{"line_number":45,"context_line":"        port_res[\u0027trunk_details\u0027][\u0027sub_ports\u0027] \u003d subports"},{"line_number":46,"context_line":"    elif port_db.sub_port:"},{"line_number":47,"context_line":"        port_res[\u0027trunk_details\u0027] \u003d {"},{"line_number":48,"context_line":"            \u0027segmentation_id\u0027: port_db.sub_port.segmentation_id,"}],"source_content_type":"text/x-python","patch_set":9,"id":"1aa78d24_7a9ed307","line":45,"range":{"start_line":45,"start_character":8,"end_line":45,"end_character":57},"in_reply_to":"1aa78d24_f09e7105","updated":"2016-07-07 10:03:25.000000000","message":"\u003e or you\u0027re not quite sure what this is for\n\n@Armando, yes, absolutely, I\u0027m \u0027not quite sure\u0027 why do we want sub-port list as part of the port. What do we gain from it?\n\nAlso I was not aware that [1] got abandoned, hence the RPC-related comments.But now that it is just for the REST, I don\u0027t get it why do we want sub-port list in port at all.\n\n[1] https://review.openstack.org/#/c/337896/","commit_id":"84ab8da14550f4297322c5144e7566b5827555c6"},{"author":{"_account_id":5948,"name":"Oleg Bondarev","email":"obondarev@mirantis.com","username":"obondarev"},"change_message_id":"1af87ac5ebd50eb6bb5286cab5649e059102a72f","unresolved":false,"context_lines":[{"line_number":42,"context_line":"                     \u0027segmentation_type\u0027: x.segmentation_type,"},{"line_number":43,"context_line":"                     \u0027port_id\u0027: x.port_id}"},{"line_number":44,"context_line":"                    for x in port_db.trunk_port.sub_ports]"},{"line_number":45,"context_line":"        port_res[\u0027trunk_details\u0027][\u0027sub_ports\u0027] \u003d subports"},{"line_number":46,"context_line":"    elif port_db.sub_port:"},{"line_number":47,"context_line":"        port_res[\u0027trunk_details\u0027] \u003d {"},{"line_number":48,"context_line":"            \u0027segmentation_id\u0027: port_db.sub_port.segmentation_id,"}],"source_content_type":"text/x-python","patch_set":9,"id":"1aa78d24_2767c126","line":45,"range":{"start_line":45,"start_character":8,"end_line":45,"end_character":57},"in_reply_to":"1aa78d24_f1cf6027","updated":"2016-07-08 15:42:22.000000000","message":"I think it\u0027s better to update the commit message with rationale for the change so it\u0027s clear for what purpose we\u0027re adding details to REST response and what details are really needed there.","commit_id":"84ab8da14550f4297322c5144e7566b5827555c6"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"3e1d5a64a6b72c44d640417603c08a0d1489cf58","unresolved":false,"context_lines":[{"line_number":43,"context_line":"                     \u0027port_id\u0027: x.port_id}"},{"line_number":44,"context_line":"                    for x in port_db.trunk_port.sub_ports]"},{"line_number":45,"context_line":"        port_res[\u0027trunk_details\u0027][\u0027sub_ports\u0027] \u003d subports"},{"line_number":46,"context_line":"    elif port_db.sub_port:"},{"line_number":47,"context_line":"        port_res[\u0027trunk_details\u0027] \u003d {"},{"line_number":48,"context_line":"            \u0027segmentation_id\u0027: port_db.sub_port.segmentation_id,"},{"line_number":49,"context_line":"            \u0027segmentation_type\u0027: port_db.sub_port.segmentation_type,"}],"source_content_type":"text/x-python","patch_set":9,"id":"1aa78d24_fc3db5c4","line":46,"updated":"2016-07-06 23:26:33.000000000","message":"why are we adding this if we don\u0027t have a clear use case? I think we can discard it for now unless you\u0027re thinking of a use case I am missing?","commit_id":"84ab8da14550f4297322c5144e7566b5827555c6"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"e40ccc1de505491fe82c796801209242bef24a8e","unresolved":false,"context_lines":[{"line_number":43,"context_line":"                     \u0027port_id\u0027: x.port_id}"},{"line_number":44,"context_line":"                    for x in port_db.trunk_port.sub_ports]"},{"line_number":45,"context_line":"        port_res[\u0027trunk_details\u0027][\u0027sub_ports\u0027] \u003d subports"},{"line_number":46,"context_line":"    elif port_db.sub_port:"},{"line_number":47,"context_line":"        port_res[\u0027trunk_details\u0027] \u003d {"},{"line_number":48,"context_line":"            \u0027segmentation_id\u0027: port_db.sub_port.segmentation_id,"},{"line_number":49,"context_line":"            \u0027segmentation_type\u0027: port_db.sub_port.segmentation_type,"}],"source_content_type":"text/x-python","patch_set":9,"id":"1aa78d24_c21f3459","line":46,"in_reply_to":"1aa78d24_bc0b2d7c","updated":"2016-07-07 00:47:21.000000000","message":"if there\u0027s no clear use, I\u0027d rather not pollute the API unnecessarily.","commit_id":"84ab8da14550f4297322c5144e7566b5827555c6"},{"author":{"_account_id":4187,"name":"Ryan Tidwell","email":"rtidwell@suse.com","username":"ryan-tidwell"},"change_message_id":"86e560a982b2822ea2f2cb8665263c7743337bf6","unresolved":false,"context_lines":[{"line_number":43,"context_line":"                     \u0027port_id\u0027: x.port_id}"},{"line_number":44,"context_line":"                    for x in port_db.trunk_port.sub_ports]"},{"line_number":45,"context_line":"        port_res[\u0027trunk_details\u0027][\u0027sub_ports\u0027] \u003d subports"},{"line_number":46,"context_line":"    elif port_db.sub_port:"},{"line_number":47,"context_line":"        port_res[\u0027trunk_details\u0027] \u003d {"},{"line_number":48,"context_line":"            \u0027segmentation_id\u0027: port_db.sub_port.segmentation_id,"},{"line_number":49,"context_line":"            \u0027segmentation_type\u0027: port_db.sub_port.segmentation_type,"}],"source_content_type":"text/x-python","patch_set":9,"id":"1aa78d24_bc0b2d7c","line":46,"in_reply_to":"1aa78d24_fc3db5c4","updated":"2016-07-06 23:48:07.000000000","message":"What if a port is tied to a subport? What should we show in that case? I guess what I had in mind was giving some sort of indication that the port is tied to either a subport or a trunk. I was thinking that trunk details would indicate how the port is associated with a trunk or subport, somehow including different fields as your indication of a trunk/subport.","commit_id":"84ab8da14550f4297322c5144e7566b5827555c6"},{"author":{"_account_id":4187,"name":"Ryan Tidwell","email":"rtidwell@suse.com","username":"ryan-tidwell"},"change_message_id":"09c03fdb9b72cff3d7e89aed48f8c0c7225e8a73","unresolved":false,"context_lines":[{"line_number":47,"context_line":"        port_res[\u0027trunk_details\u0027] \u003d {"},{"line_number":48,"context_line":"            \u0027segmentation_id\u0027: port_db.sub_port.segmentation_id,"},{"line_number":49,"context_line":"            \u0027segmentation_type\u0027: port_db.sub_port.segmentation_type,"},{"line_number":50,"context_line":"            \u0027port_id\u0027: port_db.sub_port.port_id}"},{"line_number":51,"context_line":""},{"line_number":52,"context_line":"    return port_res"},{"line_number":53,"context_line":""}],"source_content_type":"text/x-python","patch_set":9,"id":"1aa78d24_d9cf2b54","line":50,"updated":"2016-07-06 23:16:33.000000000","message":"Should include trunk_id here. Otherwise there\u0027s not a very direct way to tie the port back to a trunk.","commit_id":"84ab8da14550f4297322c5144e7566b5827555c6"},{"author":{"_account_id":4187,"name":"Ryan Tidwell","email":"rtidwell@suse.com","username":"ryan-tidwell"},"change_message_id":"86e560a982b2822ea2f2cb8665263c7743337bf6","unresolved":false,"context_lines":[{"line_number":47,"context_line":"        port_res[\u0027trunk_details\u0027] \u003d {"},{"line_number":48,"context_line":"            \u0027segmentation_id\u0027: port_db.sub_port.segmentation_id,"},{"line_number":49,"context_line":"            \u0027segmentation_type\u0027: port_db.sub_port.segmentation_type,"},{"line_number":50,"context_line":"            \u0027port_id\u0027: port_db.sub_port.port_id}"},{"line_number":51,"context_line":""},{"line_number":52,"context_line":"    return port_res"},{"line_number":53,"context_line":""}],"source_content_type":"text/x-python","patch_set":9,"id":"1aa78d24_5ce329d9","line":50,"in_reply_to":"1aa78d24_7c50a50b","updated":"2016-07-06 23:48:07.000000000","message":"It was just a minor oversight. Including trunk_id is trivial.","commit_id":"84ab8da14550f4297322c5144e7566b5827555c6"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"3e1d5a64a6b72c44d640417603c08a0d1489cf58","unresolved":false,"context_lines":[{"line_number":47,"context_line":"        port_res[\u0027trunk_details\u0027] \u003d {"},{"line_number":48,"context_line":"            \u0027segmentation_id\u0027: port_db.sub_port.segmentation_id,"},{"line_number":49,"context_line":"            \u0027segmentation_type\u0027: port_db.sub_port.segmentation_type,"},{"line_number":50,"context_line":"            \u0027port_id\u0027: port_db.sub_port.port_id}"},{"line_number":51,"context_line":""},{"line_number":52,"context_line":"    return port_res"},{"line_number":53,"context_line":""}],"source_content_type":"text/x-python","patch_set":9,"id":"1aa78d24_7c50a50b","line":50,"in_reply_to":"1aa78d24_d9cf2b54","updated":"2016-07-06 23:26:33.000000000","message":"If you drop this branch altogether the answer becomes simpler :)","commit_id":"84ab8da14550f4297322c5144e7566b5827555c6"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"9cbe7f1c25ee7d90e8368ef513033f8ab8b8014b","unresolved":false,"context_lines":[{"line_number":49,"context_line":"            \u0027segmentation_type\u0027: port_db.sub_port.segmentation_type,"},{"line_number":50,"context_line":"            \u0027port_id\u0027: port_db.sub_port.port_id}"},{"line_number":51,"context_line":""},{"line_number":52,"context_line":"    return port_res"},{"line_number":53,"context_line":""},{"line_number":54,"context_line":""},{"line_number":55,"context_line":"class TrunkPlugin(service_base.ServicePluginBase,"}],"source_content_type":"text/x-python","patch_set":9,"id":"1aa78d24_ca86bd12","line":52,"range":{"start_line":52,"start_character":4,"end_line":52,"end_character":19},"updated":"2016-07-08 17:06:55.000000000","message":"nit:  Actually, this just occurred to me.  Why do you return this dict?","commit_id":"84ab8da14550f4297322c5144e7566b5827555c6"},{"author":{"_account_id":4187,"name":"Ryan Tidwell","email":"rtidwell@suse.com","username":"ryan-tidwell"},"change_message_id":"56bd537cc0ed9eb6fec8faaed927e6c71b774516","unresolved":false,"context_lines":[{"line_number":49,"context_line":"            \u0027segmentation_type\u0027: port_db.sub_port.segmentation_type,"},{"line_number":50,"context_line":"            \u0027port_id\u0027: port_db.sub_port.port_id}"},{"line_number":51,"context_line":""},{"line_number":52,"context_line":"    return port_res"},{"line_number":53,"context_line":""},{"line_number":54,"context_line":""},{"line_number":55,"context_line":"class TrunkPlugin(service_base.ServicePluginBase,"}],"source_content_type":"text/x-python","patch_set":9,"id":"1aa78d24_bbbaa16c","line":52,"range":{"start_line":52,"start_character":4,"end_line":52,"end_character":19},"in_reply_to":"1aa78d24_ca86bd12","updated":"2016-07-08 18:14:57.000000000","message":"I think other extension functions return a dict. As an example, see https://github.com/openstack/neutron/blob/dd4f1253c951d78a5b497680dfb31317ba469a58/neutron/db/netmtu_db.py#L26.","commit_id":"84ab8da14550f4297322c5144e7566b5827555c6"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"13e768070144f28dd9b6af78bcb04324e69628f7","unresolved":false,"context_lines":[{"line_number":34,"context_line":""},{"line_number":35,"context_line":"def _extend_port_trunk_details(core_plugin, port_res, port_db):"},{"line_number":36,"context_line":"    \"\"\"Add trunk details to a port.\"\"\""},{"line_number":37,"context_line":"    port_res[\u0027trunk_details\u0027] \u003d {}"},{"line_number":38,"context_line":""},{"line_number":39,"context_line":"    if port_db.trunk_port:"},{"line_number":40,"context_line":"        port_res[\u0027trunk_details\u0027][\u0027trunk_id\u0027] \u003d port_db.trunk_port.id"}],"source_content_type":"text/x-python","patch_set":10,"id":"1aa78d24_b00b8423","line":37,"updated":"2016-07-12 00:34:02.000000000","message":"If a port is not a parent in a trunk we should not touch the response at all. That\u0027s how we\u0027ve been always operating API-wise.","commit_id":"caecf50cae29625b49b3577c50edeb57d263ce1f"},{"author":{"_account_id":4187,"name":"Ryan Tidwell","email":"rtidwell@suse.com","username":"ryan-tidwell"},"change_message_id":"c31429a0d04b490f2445715209a105f7bf3bb9b7","unresolved":false,"context_lines":[{"line_number":34,"context_line":""},{"line_number":35,"context_line":"def _extend_port_trunk_details(core_plugin, port_res, port_db):"},{"line_number":36,"context_line":"    \"\"\"Add trunk details to a port.\"\"\""},{"line_number":37,"context_line":"    port_res[\u0027trunk_details\u0027] \u003d {}"},{"line_number":38,"context_line":""},{"line_number":39,"context_line":"    if port_db.trunk_port:"},{"line_number":40,"context_line":"        port_res[\u0027trunk_details\u0027][\u0027trunk_id\u0027] \u003d port_db.trunk_port.id"}],"source_content_type":"text/x-python","patch_set":10,"id":"1aa78d24_ec6b70b7","line":37,"in_reply_to":"1aa78d24_b00b8423","updated":"2016-07-12 05:57:02.000000000","message":"Done","commit_id":"caecf50cae29625b49b3577c50edeb57d263ce1f"},{"author":{"_account_id":6788,"name":"Rossella Sblendido","email":"rsblendido@suse.com","username":"rossella-o"},"change_message_id":"0c261d452e5414c92a603763afeb7ac5c5eb7e42","unresolved":false,"context_lines":[{"line_number":32,"context_line":"LOG \u003d logging.getLogger(__name__)"},{"line_number":33,"context_line":""},{"line_number":34,"context_line":""},{"line_number":35,"context_line":"def _extend_port_trunk_details(core_plugin, port_res, port_db):"},{"line_number":36,"context_line":"    \"\"\"Add trunk details to a port.\"\"\""},{"line_number":37,"context_line":"    if port_db.trunk_port:"},{"line_number":38,"context_line":"        subports \u003d [{\u0027segmentation_id\u0027: x.segmentation_id,"}],"source_content_type":"text/x-python","patch_set":15,"id":"dada55a8_53025e0c","line":35,"updated":"2016-07-19 11:33:53.000000000","message":"nit: if you have to respin I\u0027d add a TODO to remove this once the port ovo is completed.","commit_id":"3f570567ad3e00ab0682d9abb54e51a8425837c8"}],"neutron/tests/tempest/api/test_trunk.py":[{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"3e1d5a64a6b72c44d640417603c08a0d1489cf58","unresolved":false,"context_lines":[{"line_number":132,"context_line":"        observed_subports \u003d trunk[\u0027sub_ports\u0027]"},{"line_number":133,"context_line":"        self.assertEqual(1, len(observed_subports))"},{"line_number":134,"context_line":""},{"line_number":135,"context_line":"    @test.idempotent_id(\u0027f0bed24f-d36a-498b-b4e7-0d66e3fb7308\u0027)"},{"line_number":136,"context_line":"    def test_port_resource_trunk_details_no_subports(self):"},{"line_number":137,"context_line":"        trunk \u003d self._create_trunk_with_network_and_parent([])"},{"line_number":138,"context_line":"        port \u003d self.client.show_port(trunk[\u0027trunk\u0027][\u0027port_id\u0027])"}],"source_content_type":"text/x-python","patch_set":9,"id":"1aa78d24_bc568d03","line":135,"updated":"2016-07-06 23:26:33.000000000","message":"should these be tests that require the trunk-details extension?","commit_id":"84ab8da14550f4297322c5144e7566b5827555c6"},{"author":{"_account_id":4187,"name":"Ryan Tidwell","email":"rtidwell@suse.com","username":"ryan-tidwell"},"change_message_id":"86e560a982b2822ea2f2cb8665263c7743337bf6","unresolved":false,"context_lines":[{"line_number":132,"context_line":"        observed_subports \u003d trunk[\u0027sub_ports\u0027]"},{"line_number":133,"context_line":"        self.assertEqual(1, len(observed_subports))"},{"line_number":134,"context_line":""},{"line_number":135,"context_line":"    @test.idempotent_id(\u0027f0bed24f-d36a-498b-b4e7-0d66e3fb7308\u0027)"},{"line_number":136,"context_line":"    def test_port_resource_trunk_details_no_subports(self):"},{"line_number":137,"context_line":"        trunk \u003d self._create_trunk_with_network_and_parent([])"},{"line_number":138,"context_line":"        port \u003d self.client.show_port(trunk[\u0027trunk\u0027][\u0027port_id\u0027])"}],"source_content_type":"text/x-python","patch_set":9,"id":"1aa78d24_fca655ac","line":135,"in_reply_to":"1aa78d24_bc568d03","updated":"2016-07-06 23:48:07.000000000","message":"Yes, they should. Thanks for pointing that out. I\u0027ll move these around.","commit_id":"84ab8da14550f4297322c5144e7566b5827555c6"}],"neutron/tests/tempest/api/test_trunk_details.py":[{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"13e768070144f28dd9b6af78bcb04324e69628f7","unresolved":false,"context_lines":[{"line_number":20,"context_line":"class TestTrunkDetailsJSON(test_trunk.TrunkTestJSONBase):"},{"line_number":21,"context_line":""},{"line_number":22,"context_line":"    @classmethod"},{"line_number":23,"context_line":"    @test.requires_ext(extension\u003d\"trunk\", service\u003d\"network\")"},{"line_number":24,"context_line":"    def resource_setup(cls):"},{"line_number":25,"context_line":"        super(TestTrunkDetailsJSON, cls).resource_setup()"},{"line_number":26,"context_line":""}],"source_content_type":"text/x-python","patch_set":10,"id":"1aa78d24_4d7f2bab","line":23,"updated":"2016-07-12 00:34:02.000000000","message":"this should be trunk-details","commit_id":"caecf50cae29625b49b3577c50edeb57d263ce1f"},{"author":{"_account_id":4187,"name":"Ryan Tidwell","email":"rtidwell@suse.com","username":"ryan-tidwell"},"change_message_id":"c31429a0d04b490f2445715209a105f7bf3bb9b7","unresolved":false,"context_lines":[{"line_number":20,"context_line":"class TestTrunkDetailsJSON(test_trunk.TrunkTestJSONBase):"},{"line_number":21,"context_line":""},{"line_number":22,"context_line":"    @classmethod"},{"line_number":23,"context_line":"    @test.requires_ext(extension\u003d\"trunk\", service\u003d\"network\")"},{"line_number":24,"context_line":"    def resource_setup(cls):"},{"line_number":25,"context_line":"        super(TestTrunkDetailsJSON, cls).resource_setup()"},{"line_number":26,"context_line":""}],"source_content_type":"text/x-python","patch_set":10,"id":"1aa78d24_2c6a98b3","line":23,"in_reply_to":"1aa78d24_4d7f2bab","updated":"2016-07-12 05:57:02.000000000","message":"Done","commit_id":"caecf50cae29625b49b3577c50edeb57d263ce1f"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"13e768070144f28dd9b6af78bcb04324e69628f7","unresolved":false,"context_lines":[{"line_number":24,"context_line":"    def resource_setup(cls):"},{"line_number":25,"context_line":"        super(TestTrunkDetailsJSON, cls).resource_setup()"},{"line_number":26,"context_line":""},{"line_number":27,"context_line":"    def tearDown(self):"},{"line_number":28,"context_line":"        # NOTE(tidwellr) These tests create networks and ports, clean them up"},{"line_number":29,"context_line":"        # after each test to avoid hitting quota limits"},{"line_number":30,"context_line":"        self.resource_cleanup()"}],"source_content_type":"text/x-python","patch_set":10,"id":"1aa78d24_0d608300","line":27,"updated":"2016-07-12 00:34:02.000000000","message":"you should not use tearDown, what about the resource_cleanup class method?","commit_id":"caecf50cae29625b49b3577c50edeb57d263ce1f"},{"author":{"_account_id":4187,"name":"Ryan Tidwell","email":"rtidwell@suse.com","username":"ryan-tidwell"},"change_message_id":"c31429a0d04b490f2445715209a105f7bf3bb9b7","unresolved":false,"context_lines":[{"line_number":24,"context_line":"    def resource_setup(cls):"},{"line_number":25,"context_line":"        super(TestTrunkDetailsJSON, cls).resource_setup()"},{"line_number":26,"context_line":""},{"line_number":27,"context_line":"    def tearDown(self):"},{"line_number":28,"context_line":"        # NOTE(tidwellr) These tests create networks and ports, clean them up"},{"line_number":29,"context_line":"        # after each test to avoid hitting quota limits"},{"line_number":30,"context_line":"        self.resource_cleanup()"}],"source_content_type":"text/x-python","patch_set":10,"id":"1aa78d24_8c88ec72","line":27,"in_reply_to":"1aa78d24_0d608300","updated":"2016-07-12 05:57:02.000000000","message":"resource_cleanup() seems to run after all the tests in the class have run. I\u0027ve bumped into transient quota issues with networks while the tests run so I\u0027m looking to clean up after each test. I\u0027ll look to do something different.","commit_id":"caecf50cae29625b49b3577c50edeb57d263ce1f"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"13e768070144f28dd9b6af78bcb04324e69628f7","unresolved":false,"context_lines":[{"line_number":63,"context_line":"        port \u003d self.create_port(network)"},{"line_number":64,"context_line":"        port \u003d self.client.show_port(port[\u0027id\u0027])"},{"line_number":65,"context_line":"        expected_trunk_details \u003d {}"},{"line_number":66,"context_line":"        observed_trunk_details \u003d port[\u0027port\u0027].get(\u0027trunk_details\u0027)"},{"line_number":67,"context_line":"        self.assertIsNotNone(observed_trunk_details)"},{"line_number":68,"context_line":"        self.assertEqual(expected_trunk_details,"},{"line_number":69,"context_line":"                         observed_trunk_details)"}],"source_content_type":"text/x-python","patch_set":10,"id":"1aa78d24_6d1e6771","line":66,"updated":"2016-07-12 00:34:02.000000000","message":"if a port is not a parent in a trunk then, then \u0027trunk_details\u0027 should not be in the response at all. How is it showing up?","commit_id":"caecf50cae29625b49b3577c50edeb57d263ce1f"},{"author":{"_account_id":4187,"name":"Ryan Tidwell","email":"rtidwell@suse.com","username":"ryan-tidwell"},"change_message_id":"c31429a0d04b490f2445715209a105f7bf3bb9b7","unresolved":false,"context_lines":[{"line_number":63,"context_line":"        port \u003d self.create_port(network)"},{"line_number":64,"context_line":"        port \u003d self.client.show_port(port[\u0027id\u0027])"},{"line_number":65,"context_line":"        expected_trunk_details \u003d {}"},{"line_number":66,"context_line":"        observed_trunk_details \u003d port[\u0027port\u0027].get(\u0027trunk_details\u0027)"},{"line_number":67,"context_line":"        self.assertIsNotNone(observed_trunk_details)"},{"line_number":68,"context_line":"        self.assertEqual(expected_trunk_details,"},{"line_number":69,"context_line":"                         observed_trunk_details)"}],"source_content_type":"text/x-python","patch_set":10,"id":"1aa78d24_0c951c86","line":66,"in_reply_to":"1aa78d24_6d1e6771","updated":"2016-07-12 05:57:02.000000000","message":"It is showing up because I am appending it, even if the port is not a trunk. I\u0027ll change that.","commit_id":"caecf50cae29625b49b3577c50edeb57d263ce1f"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"bbfb8f228c28f83331b2b361061adc1e6433a083","unresolved":false,"context_lines":[{"line_number":17,"context_line":"from neutron.tests.tempest.api import test_trunk"},{"line_number":18,"context_line":""},{"line_number":19,"context_line":""},{"line_number":20,"context_line":"class TestTrunkDetailsJSON(test_trunk.TrunkTestJSONBase):"},{"line_number":21,"context_line":""},{"line_number":22,"context_line":"    @classmethod"},{"line_number":23,"context_line":"    @test.requires_ext(extension\u003d\"trunk-details\", service\u003d\"network\")"}],"source_content_type":"text/x-python","patch_set":11,"id":"1aa78d24_d207fd15","line":20,"updated":"2016-07-12 20:45:41.000000000","message":"how did you solve the cleanup issue?","commit_id":"b3e7ab76835447efd96cf9149e69015c72532a83"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"8c5998ac61ef531dee7907f82b8c02dba0b42cd2","unresolved":false,"context_lines":[{"line_number":17,"context_line":"from neutron.tests.tempest.api import test_trunk"},{"line_number":18,"context_line":""},{"line_number":19,"context_line":""},{"line_number":20,"context_line":"class TestTrunkDetailsJSON(test_trunk.TrunkTestJSONBase):"},{"line_number":21,"context_line":""},{"line_number":22,"context_line":"    @classmethod"},{"line_number":23,"context_line":"    @test.requires_ext(extension\u003d\"trunk-details\", service\u003d\"network\")"}],"source_content_type":"text/x-python","patch_set":11,"id":"1aa78d24_55f13794","line":20,"in_reply_to":"1aa78d24_52fb0d47","updated":"2016-07-12 21:24:24.000000000","message":"but then concurrent execution of tests may lead to random failures...this needs to be looked into before it bites.","commit_id":"b3e7ab76835447efd96cf9149e69015c72532a83"},{"author":{"_account_id":4187,"name":"Ryan Tidwell","email":"rtidwell@suse.com","username":"ryan-tidwell"},"change_message_id":"3602937c2d699b7c8104fa1f25ba12fc6af4da67","unresolved":false,"context_lines":[{"line_number":17,"context_line":"from neutron.tests.tempest.api import test_trunk"},{"line_number":18,"context_line":""},{"line_number":19,"context_line":""},{"line_number":20,"context_line":"class TestTrunkDetailsJSON(test_trunk.TrunkTestJSONBase):"},{"line_number":21,"context_line":""},{"line_number":22,"context_line":"    @classmethod"},{"line_number":23,"context_line":"    @test.requires_ext(extension\u003d\"trunk-details\", service\u003d\"network\")"}],"source_content_type":"text/x-python","patch_set":11,"id":"1aa78d24_46998f78","line":20,"in_reply_to":"1aa78d24_55f13794","updated":"2016-07-12 22:47:53.000000000","message":"I agree, the concurrency here is still a concern to me as well. Just because I haven\u0027t bumped into it yet doesn\u0027t mean we\u0027re in the clear.","commit_id":"b3e7ab76835447efd96cf9149e69015c72532a83"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"6558c741536de9c8f253183bac3fe71a8bfa35c7","unresolved":false,"context_lines":[{"line_number":17,"context_line":"from neutron.tests.tempest.api import test_trunk"},{"line_number":18,"context_line":""},{"line_number":19,"context_line":""},{"line_number":20,"context_line":"class TestTrunkDetailsJSON(test_trunk.TrunkTestJSONBase):"},{"line_number":21,"context_line":""},{"line_number":22,"context_line":"    @classmethod"},{"line_number":23,"context_line":"    @test.requires_ext(extension\u003d\"trunk-details\", service\u003d\"network\")"}],"source_content_type":"text/x-python","patch_set":11,"id":"1aa78d24_b56e9bfd","line":20,"in_reply_to":"1aa78d24_55f13794","updated":"2016-07-12 21:29:48.000000000","message":"Perhaps I am confusing tearDown vs tearDownClass, in which case we might want to put it back. Can you find out from a Tempest expert what\u0027s the deal? I see [1] and I am not sure the latest.\n\n[1] https://review.openstack.org/#/c/121554/","commit_id":"b3e7ab76835447efd96cf9149e69015c72532a83"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"03f4d275dd817f74e292e82858df2f7cd8dcb53f","unresolved":false,"context_lines":[{"line_number":17,"context_line":"from neutron.tests.tempest.api import test_trunk"},{"line_number":18,"context_line":""},{"line_number":19,"context_line":""},{"line_number":20,"context_line":"class TestTrunkDetailsJSON(test_trunk.TrunkTestJSONBase):"},{"line_number":21,"context_line":""},{"line_number":22,"context_line":"    @classmethod"},{"line_number":23,"context_line":"    @test.requires_ext(extension\u003d\"trunk-details\", service\u003d\"network\")"}],"source_content_type":"text/x-python","patch_set":11,"id":"1aa78d24_e1db454d","line":20,"in_reply_to":"1aa78d24_86941737","updated":"2016-07-12 23:13:46.000000000","message":"tearDown is frowned upon for different reasons. But that\u0027s in Neutron-land where we use add_cleanup() in favor of tearDown()","commit_id":"b3e7ab76835447efd96cf9149e69015c72532a83"},{"author":{"_account_id":4187,"name":"Ryan Tidwell","email":"rtidwell@suse.com","username":"ryan-tidwell"},"change_message_id":"3602937c2d699b7c8104fa1f25ba12fc6af4da67","unresolved":false,"context_lines":[{"line_number":17,"context_line":"from neutron.tests.tempest.api import test_trunk"},{"line_number":18,"context_line":""},{"line_number":19,"context_line":""},{"line_number":20,"context_line":"class TestTrunkDetailsJSON(test_trunk.TrunkTestJSONBase):"},{"line_number":21,"context_line":""},{"line_number":22,"context_line":"    @classmethod"},{"line_number":23,"context_line":"    @test.requires_ext(extension\u003d\"trunk-details\", service\u003d\"network\")"}],"source_content_type":"text/x-python","patch_set":11,"id":"1aa78d24_86941737","line":20,"in_reply_to":"1aa78d24_b56e9bfd","updated":"2016-07-12 22:47:53.000000000","message":"Ack. I\u0027ll go figure this out. It would surprise me that use of tearDown() is frowned upon.","commit_id":"b3e7ab76835447efd96cf9149e69015c72532a83"},{"author":{"_account_id":4187,"name":"Ryan Tidwell","email":"rtidwell@suse.com","username":"ryan-tidwell"},"change_message_id":"31444fcde3dee7f5771e42b6d61efc3d63b27d02","unresolved":false,"context_lines":[{"line_number":17,"context_line":"from neutron.tests.tempest.api import test_trunk"},{"line_number":18,"context_line":""},{"line_number":19,"context_line":""},{"line_number":20,"context_line":"class TestTrunkDetailsJSON(test_trunk.TrunkTestJSONBase):"},{"line_number":21,"context_line":""},{"line_number":22,"context_line":"    @classmethod"},{"line_number":23,"context_line":"    @test.requires_ext(extension\u003d\"trunk-details\", service\u003d\"network\")"}],"source_content_type":"text/x-python","patch_set":11,"id":"1aa78d24_52fb0d47","line":20,"in_reply_to":"1aa78d24_d207fd15","updated":"2016-07-12 21:15:56.000000000","message":"I actually ran into it under neutron/tests/tempest/api/test_trunk.py and solved it there by using tearDown() (https://github.com/openstack/neutron/blob/master/neutron/tests/tempest/api/test_trunk.py#L36). This set of tests doesn\u0027t actually create enough networks to go over quota, so I actually haven\u0027t seen it with this patch. Earlier patch sets used tearDown() to simply be defensive against issues I saw when writing https://github.com/openstack/neutron/blob/master/neutron/tests/tempest/api/test_trunk.py. Those tests actually do create enough networks to hit quota, even without other tests running concurrently. These tests don\u0027t create that many networks.","commit_id":"b3e7ab76835447efd96cf9149e69015c72532a83"},{"author":{"_account_id":4187,"name":"Ryan Tidwell","email":"rtidwell@suse.com","username":"ryan-tidwell"},"change_message_id":"5e4ed3e222a6eb27aa12da862802cd22ab6b4351","unresolved":false,"context_lines":[{"line_number":17,"context_line":"from neutron.tests.tempest.api import test_trunk"},{"line_number":18,"context_line":""},{"line_number":19,"context_line":""},{"line_number":20,"context_line":"class TestTrunkDetailsJSON(test_trunk.TrunkTestJSONBase):"},{"line_number":21,"context_line":""},{"line_number":22,"context_line":"    @classmethod"},{"line_number":23,"context_line":"    @test.requires_ext(extension\u003d\"trunk-details\", service\u003d\"network\")"}],"source_content_type":"text/x-python","patch_set":11,"id":"1aa78d24_2568b8f4","line":20,"in_reply_to":"1aa78d24_e1db454d","updated":"2016-07-13 00:05:11.000000000","message":"As far as I can tell it\u0027s tearDownClass() that should be avoided http://docs.openstack.org/developer/tempest/HACKING.html#test-fixtures-and-resources. Will continue digging.","commit_id":"b3e7ab76835447efd96cf9149e69015c72532a83"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"f9ebfb731c16d428f43d6ddb8023665f766f2ca5","unresolved":false,"context_lines":[{"line_number":22,"context_line":"    @classmethod"},{"line_number":23,"context_line":"    @test.requires_ext(extension\u003d\"trunk-details\", service\u003d\"network\")"},{"line_number":24,"context_line":"    def resource_setup(cls):"},{"line_number":25,"context_line":"        super(TestTrunkDetailsJSON, cls).resource_setup()"},{"line_number":26,"context_line":""},{"line_number":27,"context_line":"    @test.idempotent_id(\u0027f0bed24f-d36a-498b-b4e7-0d66e3fb7308\u0027)"},{"line_number":28,"context_line":"    def test_port_resource_trunk_details_no_subports(self):"}],"source_content_type":"text/x-python","patch_set":11,"id":"1aa78d24_356a7d1a","line":25,"updated":"2016-07-13 15:44:31.000000000","message":"if you are not doing anything here, there\u0027s no need to override it","commit_id":"b3e7ab76835447efd96cf9149e69015c72532a83"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"b4e687274f57bf2e091aead7c76539770825f1c9","unresolved":false,"context_lines":[{"line_number":17,"context_line":"from neutron.tests.tempest.api import test_trunk"},{"line_number":18,"context_line":""},{"line_number":19,"context_line":""},{"line_number":20,"context_line":"class TestTrunkDetailsJSON(test_trunk.TrunkTestJSONBase):"},{"line_number":21,"context_line":""},{"line_number":22,"context_line":"    @test.idempotent_id(\u0027f0bed24f-d36a-498b-b4e7-0d66e3fb7308\u0027)"},{"line_number":23,"context_line":"    def test_port_resource_trunk_details_no_subports(self):"}],"source_content_type":"text/x-python","patch_set":12,"id":"1aa78d24_6de26c31","line":20,"updated":"2016-07-13 20:52:48.000000000","message":"you should override the class member \u0027extension\u0027 to set it to \u0027trunk-details\u0027","commit_id":"ea6208006cd1bc0998da9f8f0cba2f0388f555ca"},{"author":{"_account_id":4187,"name":"Ryan Tidwell","email":"rtidwell@suse.com","username":"ryan-tidwell"},"change_message_id":"fdc0ba6d8b312b49e55bd8bf68ee6e71c15bf06f","unresolved":false,"context_lines":[{"line_number":17,"context_line":"from neutron.tests.tempest.api import test_trunk"},{"line_number":18,"context_line":""},{"line_number":19,"context_line":""},{"line_number":20,"context_line":"class TestTrunkDetailsJSON(test_trunk.TrunkTestJSONBase):"},{"line_number":21,"context_line":""},{"line_number":22,"context_line":"    @test.idempotent_id(\u0027f0bed24f-d36a-498b-b4e7-0d66e3fb7308\u0027)"},{"line_number":23,"context_line":"    def test_port_resource_trunk_details_no_subports(self):"}],"source_content_type":"text/x-python","patch_set":12,"id":"1aa78d24_4d1e900e","line":20,"in_reply_to":"1aa78d24_6de26c31","updated":"2016-07-13 20:55:17.000000000","message":"Doh! Missed that.","commit_id":"ea6208006cd1bc0998da9f8f0cba2f0388f555ca"},{"author":{"_account_id":6788,"name":"Rossella Sblendido","email":"rsblendido@suse.com","username":"rossella-o"},"change_message_id":"0c261d452e5414c92a603763afeb7ac5c5eb7e42","unresolved":false,"context_lines":[{"line_number":28,"context_line":"        expected_trunk_details \u003d {\u0027sub_ports\u0027: [],"},{"line_number":29,"context_line":"                                  \u0027trunk_id\u0027: trunk[\u0027trunk\u0027][\u0027id\u0027]}"},{"line_number":30,"context_line":"        observed_trunk_details \u003d port[\u0027port\u0027].get(\u0027trunk_details\u0027)"},{"line_number":31,"context_line":"        self.assertIsNotNone(observed_trunk_details)"},{"line_number":32,"context_line":"        self.assertEqual(expected_trunk_details,"},{"line_number":33,"context_line":"                         observed_trunk_details)"},{"line_number":34,"context_line":""}],"source_content_type":"text/x-python","patch_set":15,"id":"dada55a8_6e35f5d8","line":31,"updated":"2016-07-19 11:33:53.000000000","message":"nit: if you have to respin, this check is redundant, in line 32 we implicitly check that observed_trunk_details is not None","commit_id":"3f570567ad3e00ab0682d9abb54e51a8425837c8"}]}
