)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":16800,"name":"Rawlin Peters","email":"rawlin.peters@hpe.com","username":"rawlin"},"change_message_id":"5f86c5130d222f25697e96f056e3ffc72aa19564","unresolved":false,"context_lines":[{"line_number":13,"context_line":"which bridge the ports are on, so that the agent can process"},{"line_number":14,"context_line":"them further. A further improvements could be to change the"},{"line_number":15,"context_line":"implementation of the polling manager and apply a publisher/subscriber"},{"line_number":16,"context_line":"pattern where the user can express interest in a list of bridges."},{"line_number":17,"context_line":""},{"line_number":18,"context_line":"Change-Id: I498560798983177ce7b64e1a8f32f1a157558897"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":1,"id":"3aaa91ec_d55a79f1","line":16,"range":{"start_line":16,"start_character":8,"end_line":16,"end_character":64},"updated":"2016-06-29 18:54:34.000000000","message":"How will the agent know which bridges are trunk bridges in order to subscribe to events on those bridges? Would the agent need to be notified via RPC at the time of trunk creation in order to subscribe to those bridges before they\u0027re created?","commit_id":"06d448ff8f68d5cf3ee8adf2448397eea8c80957"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"d4aaba7444b045af35f4d856de0b810cf00ba196","unresolved":false,"context_lines":[{"line_number":13,"context_line":"which bridge the ports are on, so that the agent can process"},{"line_number":14,"context_line":"them further. A further improvements could be to change the"},{"line_number":15,"context_line":"implementation of the polling manager and apply a publisher/subscriber"},{"line_number":16,"context_line":"pattern where the user can express interest in a list of bridges."},{"line_number":17,"context_line":""},{"line_number":18,"context_line":"Change-Id: I498560798983177ce7b64e1a8f32f1a157558897"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":1,"id":"1aa78d24_afc9715b","line":16,"range":{"start_line":16,"start_character":8,"end_line":16,"end_character":64},"in_reply_to":"3aaa91ec_81f6da8c","updated":"2016-07-06 02:26:18.000000000","message":"We have two use cases: a) a monitor is interested in events associated to a particular bridge e.g. br-int. b) a monitor is interested in all events;\n\nA monitor wants to be particularly clever and perhaps monitor all events except a certain bridge(s).","commit_id":"06d448ff8f68d5cf3ee8adf2448397eea8c80957"},{"author":{"_account_id":6788,"name":"Rossella Sblendido","email":"rsblendido@suse.com","username":"rossella-o"},"change_message_id":"99a07d41732e982d46a8f2a8cc8e68ac30606bf4","unresolved":false,"context_lines":[{"line_number":13,"context_line":"which bridge the ports are on, so that the agent can process"},{"line_number":14,"context_line":"them further. A further improvements could be to change the"},{"line_number":15,"context_line":"implementation of the polling manager and apply a publisher/subscriber"},{"line_number":16,"context_line":"pattern where the user can express interest in a list of bridges."},{"line_number":17,"context_line":""},{"line_number":18,"context_line":"Change-Id: I498560798983177ce7b64e1a8f32f1a157558897"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":1,"id":"3aaa91ec_81f6da8c","line":16,"range":{"start_line":16,"start_character":8,"end_line":16,"end_character":64},"in_reply_to":"3aaa91ec_d55a79f1","updated":"2016-06-30 10:07:41.000000000","message":"\u003e How will the agent know which bridges are trunk bridges in order to subscribe to events on those bridges?\n\nFor managing trunk ports the agent will have to subscribe to events on all bridges. That avoids possible races and it\u0027s simpler.","commit_id":"06d448ff8f68d5cf3ee8adf2448397eea8c80957"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"c16cde8c7d781a783d43ca4a21e29136baa03cbb","unresolved":false,"context_lines":[{"line_number":7,"context_line":"WIP Handle trunk ports in the OVS agent"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"This patch introduce the TrunkAbstractDriver that is meant"},{"line_number":10,"context_line":"to be implemented by any agent that supports trunk ports."},{"line_number":11,"context_line":""},{"line_number":12,"context_line":"This patch implement the trunk driver for the OVS agent"},{"line_number":13,"context_line":"(partially)."}],"source_content_type":"text/x-gerrit-commit-message","patch_set":4,"id":"dada55a8_42dbc61b","line":10,"updated":"2016-07-23 05:18:27.000000000","message":"Please see my comments inline. I think we want to refine the agent-side class structure a little bit further.","commit_id":"7ed0415c52fd936013c6a8a2160f4739a81ba9c6"}],"neutron/agent/linux/ovsdb_monitor.py":[{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"c16cde8c7d781a783d43ca4a21e29136baa03cbb","unresolved":false,"context_lines":[{"line_number":87,"context_line":""},{"line_number":88,"context_line":"    #RECONSIDER(rossella_s): this method is here to basically be able to access"},{"line_number":89,"context_line":"    # the same events twice. This implementation is of course brittle, it"},{"line_number":90,"context_line":"    # assumes that get_last_round_events will be called only once."},{"line_number":91,"context_line":"    # If we want to go this way we need to implement a pub/sub pattern."},{"line_number":92,"context_line":"    # This is going to be a big change anyway. Other way could be to notify"},{"line_number":93,"context_line":"    # about the events in the process_port_info method of the agent."}],"source_content_type":"text/x-python","patch_set":4,"id":"dada55a8_622a4a80","line":90,"updated":"2016-07-23 05:18:27.000000000","message":"Calling get_last_round_events() is non-destructive. It can be called multiple times and if there are no interleaving calls to get_events() it will return the same events.\n\nAlternatively we can emit a copy of the events right at line 86, if that\u0027s what you mean.","commit_id":"7ed0415c52fd936013c6a8a2160f4739a81ba9c6"},{"author":{"_account_id":6788,"name":"Rossella Sblendido","email":"rsblendido@suse.com","username":"rossella-o"},"change_message_id":"b15d440cebbb715e1e7e1fadba2d6b4873b99316","unresolved":false,"context_lines":[{"line_number":87,"context_line":""},{"line_number":88,"context_line":"    #RECONSIDER(rossella_s): this method is here to basically be able to access"},{"line_number":89,"context_line":"    # the same events twice. This implementation is of course brittle, it"},{"line_number":90,"context_line":"    # assumes that get_last_round_events will be called only once."},{"line_number":91,"context_line":"    # If we want to go this way we need to implement a pub/sub pattern."},{"line_number":92,"context_line":"    # This is going to be a big change anyway. Other way could be to notify"},{"line_number":93,"context_line":"    # about the events in the process_port_info method of the agent."}],"source_content_type":"text/x-python","patch_set":4,"id":"dada55a8_bfea3472","line":90,"in_reply_to":"dada55a8_622a4a80","updated":"2016-07-26 15:54:06.000000000","message":"it won\u0027t return the same event because of line 96. I will show what I mean in next patch","commit_id":"7ed0415c52fd936013c6a8a2160f4739a81ba9c6"}],"neutron/callbacks/events.py":[{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"c16cde8c7d781a783d43ca4a21e29136baa03cbb","unresolved":false,"context_lines":[{"line_number":29,"context_line":"BEFORE_RESPONSE \u003d \u0027before_response\u0027"},{"line_number":30,"context_line":"AFTER_REQUEST \u003d \u0027after_request\u0027"},{"line_number":31,"context_line":""},{"line_number":32,"context_line":"# String literals representing events associated to process operations"},{"line_number":33,"context_line":"BEFORE_INIT \u003d \u0027before_init\u0027"},{"line_number":34,"context_line":"AFTER_INIT \u003d \u0027after_init\u0027"},{"line_number":35,"context_line":""}],"source_content_type":"text/x-python","patch_set":4,"id":"dada55a8_c21fb659","side":"PARENT","line":32,"updated":"2016-07-23 05:18:27.000000000","message":"unintentional cut","commit_id":"0f8e23f235ff50c6e2f77cff403c63263ab151d5"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"c16cde8c7d781a783d43ca4a21e29136baa03cbb","unresolved":false,"context_lines":[{"line_number":39,"context_line":"BEFORE \u003d \u0027before_\u0027"},{"line_number":40,"context_line":"PRECOMMIT \u003d \u0027precommit_\u0027"},{"line_number":41,"context_line":""},{"line_number":42,"context_line":"RESYNC \u003d \u0027resync\u0027"}],"source_content_type":"text/x-python","patch_set":4,"id":"dada55a8_023a6ecd","line":42,"updated":"2016-07-23 05:18:27.000000000","message":"btw these can be constants local to the agent.","commit_id":"7ed0415c52fd936013c6a8a2160f4739a81ba9c6"}],"neutron/callbacks/resources.py":[{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"c16cde8c7d781a783d43ca4a21e29136baa03cbb","unresolved":false,"context_lines":[{"line_number":30,"context_line":"SUBNET_GATEWAY \u003d \u0027subnet_gateway\u0027"},{"line_number":31,"context_line":"SUBNETPOOL_ADDRESS_SCOPE \u003d \u0027subnetpool_address_scope\u0027"},{"line_number":32,"context_line":"OVSDB \u003d \u0027ovsdb\u0027"},{"line_number":33,"context_line":"SUBPORT \u003d \u0027subport\u0027"}],"source_content_type":"text/x-python","patch_set":4,"id":"dada55a8_e2363ae6","line":33,"updated":"2016-07-23 05:18:27.000000000","message":"btw these can be constants local to the agent.","commit_id":"7ed0415c52fd936013c6a8a2160f4739a81ba9c6"}],"neutron/common/utils.py":[{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"b4c1806d6cd0a5ec5f86603abb7721ecd52078c5","unresolved":false,"context_lines":[{"line_number":618,"context_line":"            eventlet.sleep(sleep)"},{"line_number":619,"context_line":""},{"line_number":620,"context_line":""},{"line_number":621,"context_line":"def gen_trunk_br_name(trunk_port_id):"},{"line_number":622,"context_line":"    return (\u0027tbr-\u0027 + trunk_port_id)[:n_const.DEVICE_NAME_MAX_LEN - 1]"},{"line_number":623,"context_line":""},{"line_number":624,"context_line":""}],"source_content_type":"text/x-python","patch_set":5,"id":"bacf61ea_7ea4b556","line":621,"updated":"2016-07-28 06:41:48.000000000","message":"shall we move this under neutron/services/trunk/utils? This is needed server side too [1]\n\n[1] https://review.openstack.org/#/c/343816/7/neutron/services/trunk/drivers/openvswitch/driver.py@35","commit_id":"3d189a30dddfc973d5c17256b8eadb5e023f57a7"},{"author":{"_account_id":6788,"name":"Rossella Sblendido","email":"rsblendido@suse.com","username":"rossella-o"},"change_message_id":"4bcb77aece66470194c9c0e7f2705d8190975da4","unresolved":false,"context_lines":[{"line_number":618,"context_line":"            eventlet.sleep(sleep)"},{"line_number":619,"context_line":""},{"line_number":620,"context_line":""},{"line_number":621,"context_line":"def gen_trunk_br_name(trunk_port_id):"},{"line_number":622,"context_line":"    return (\u0027tbr-\u0027 + trunk_port_id)[:n_const.DEVICE_NAME_MAX_LEN - 1]"},{"line_number":623,"context_line":""},{"line_number":624,"context_line":""}],"source_content_type":"text/x-python","patch_set":5,"id":"bacf61ea_9cbf5ca9","line":621,"in_reply_to":"bacf61ea_7ea4b556","updated":"2016-08-01 13:33:50.000000000","message":"Done","commit_id":"3d189a30dddfc973d5c17256b8eadb5e023f57a7"}],"neutron/plugins/ml2/drivers/openvswitch/agent/exceptions.py":[{"author":{"_account_id":8655,"name":"Jakub Libosvar","email":"libosvar@redhat.com","username":"jlibosva"},"change_message_id":"cfeff869c2a22d35549e06e830c53fc634e8c621","unresolved":false,"context_lines":[{"line_number":11,"context_line":"#    under the License."},{"line_number":12,"context_line":""},{"line_number":13,"context_line":"from neutron._i18n import _"},{"line_number":14,"context_line":"from neutron_lib import exceptions as n_exc"},{"line_number":15,"context_line":""},{"line_number":16,"context_line":""},{"line_number":17,"context_line":"class TrunkBridgeNotFound(n_exc.NeutronException):"}],"source_content_type":"text/x-python","patch_set":10,"id":"9ad45d7e_6ccb4aa6","line":14,"range":{"start_line":14,"start_character":5,"end_line":14,"end_character":16},"updated":"2016-08-09 13:46:06.000000000","message":"This is 3rd party lib, should be before imports from neutron","commit_id":"d856c99bd854bf73b2540639fcd1e258276d3fb5"},{"author":{"_account_id":6788,"name":"Rossella Sblendido","email":"rsblendido@suse.com","username":"rossella-o"},"change_message_id":"bdec56ebfc66ec88f6375820188b208df096d78c","unresolved":false,"context_lines":[{"line_number":11,"context_line":"#    under the License."},{"line_number":12,"context_line":""},{"line_number":13,"context_line":"from neutron._i18n import _"},{"line_number":14,"context_line":"from neutron_lib import exceptions as n_exc"},{"line_number":15,"context_line":""},{"line_number":16,"context_line":""},{"line_number":17,"context_line":"class TrunkBridgeNotFound(n_exc.NeutronException):"}],"source_content_type":"text/x-python","patch_set":10,"id":"9ad45d7e_580bd27d","line":14,"range":{"start_line":14,"start_character":5,"end_line":14,"end_character":16},"in_reply_to":"9ad45d7e_6ccb4aa6","updated":"2016-08-12 16:20:20.000000000","message":"Done","commit_id":"d856c99bd854bf73b2540639fcd1e258276d3fb5"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"6a89c25e5853c1f019e26194f2341301d3a2c780","unresolved":false,"context_lines":[{"line_number":1,"context_line":"#    Licensed under the Apache License, Version 2.0 (the \"License\"); you may"},{"line_number":2,"context_line":"#    not use this file except in compliance with the License. You may obtain"},{"line_number":3,"context_line":"#    a copy of the License at"},{"line_number":4,"context_line":"#"}],"source_content_type":"text/x-python","patch_set":13,"id":"3ac371cc_2b00f6a9","line":1,"updated":"2016-08-16 16:12:25.000000000","message":"wouldn\u0027t this more appropriately located in:\n\nneutron/services/trunk/drivers/openvswitch/agent/exceptions?","commit_id":"b4b90ac4ae8d259f503515456f91202ef25c60bb"},{"author":{"_account_id":8655,"name":"Jakub Libosvar","email":"libosvar@redhat.com","username":"jlibosva"},"change_message_id":"c6b9494981dc46186b48a2b37b847c0b2065cde6","unresolved":false,"context_lines":[{"line_number":1,"context_line":"#    Licensed under the Apache License, Version 2.0 (the \"License\"); you may"},{"line_number":2,"context_line":"#    not use this file except in compliance with the License. You may obtain"},{"line_number":3,"context_line":"#    a copy of the License at"},{"line_number":4,"context_line":"#"}],"source_content_type":"text/x-python","patch_set":13,"id":"3ac371cc_50ee8fb4","line":1,"in_reply_to":"3ac371cc_2b00f6a9","updated":"2016-08-17 15:21:30.000000000","message":"Done","commit_id":"b4b90ac4ae8d259f503515456f91202ef25c60bb"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"6a89c25e5853c1f019e26194f2341301d3a2c780","unresolved":false,"context_lines":[{"line_number":15,"context_line":"from neutron._i18n import _"},{"line_number":16,"context_line":""},{"line_number":17,"context_line":""},{"line_number":18,"context_line":"class TrunkBridgeNotFound(n_exc.NeutronException):"},{"line_number":19,"context_line":"    message \u003d _(\"Trunk bridge %(trunk_id)s could not be found.\")"}],"source_content_type":"text/x-python","patch_set":13,"id":"3ac371cc_0be9bae6","line":18,"updated":"2016-08-16 16:12:25.000000000","message":"inherit from NotFound?","commit_id":"b4b90ac4ae8d259f503515456f91202ef25c60bb"},{"author":{"_account_id":8655,"name":"Jakub Libosvar","email":"libosvar@redhat.com","username":"jlibosva"},"change_message_id":"c6b9494981dc46186b48a2b37b847c0b2065cde6","unresolved":false,"context_lines":[{"line_number":15,"context_line":"from neutron._i18n import _"},{"line_number":16,"context_line":""},{"line_number":17,"context_line":""},{"line_number":18,"context_line":"class TrunkBridgeNotFound(n_exc.NeutronException):"},{"line_number":19,"context_line":"    message \u003d _(\"Trunk bridge %(trunk_id)s could not be found.\")"}],"source_content_type":"text/x-python","patch_set":13,"id":"3ac371cc_b02d4300","line":18,"in_reply_to":"3ac371cc_0be9bae6","updated":"2016-08-17 15:21:30.000000000","message":"Isn\u0027t NotFound just for mapping NotFound exceptions into HTTP codes to be returned to neutron API caller? Anyway, done.","commit_id":"b4b90ac4ae8d259f503515456f91202ef25c60bb"}],"neutron/plugins/ml2/drivers/openvswitch/agent/ovs_neutron_agent.py":[{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"d4aaba7444b045af35f4d856de0b810cf00ba196","unresolved":false,"context_lines":[{"line_number":421,"context_line":"        self.updated_ports.discard(port_id)"},{"line_number":422,"context_line":"        LOG.debug(\"port_delete message processed for port %s\", port_id)"},{"line_number":423,"context_line":""},{"line_number":424,"context_line":"    def subport_added(self, context, **kwargs):"},{"line_number":425,"context_line":"        # TODO(rossella_s) implements methods that will apply the changes"},{"line_number":426,"context_line":"        # triggered by an API call"},{"line_number":427,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"1aa78d24_0fda4517","line":424,"updated":"2016-07-06 02:26:18.000000000","message":"To help with isolating the trunk code my suggestion is to try and wrap the subport/trunk handling code as a separate component that is initialized by the OVS agent. We can figure out this later, but if this is meant to be invoked via RPC, it\u0027s best to come up with a solution where the RPC related methods are neatly together.","commit_id":"06d448ff8f68d5cf3ee8adf2448397eea8c80957"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"d4aaba7444b045af35f4d856de0b810cf00ba196","unresolved":false,"context_lines":[{"line_number":423,"context_line":""},{"line_number":424,"context_line":"    def subport_added(self, context, **kwargs):"},{"line_number":425,"context_line":"        # TODO(rossella_s) implements methods that will apply the changes"},{"line_number":426,"context_line":"        # triggered by an API call"},{"line_number":427,"context_line":""},{"line_number":428,"context_line":"    def network_update(self, context, **kwargs):"},{"line_number":429,"context_line":"        network_id \u003d kwargs[\u0027network\u0027][\u0027id\u0027]"}],"source_content_type":"text/x-python","patch_set":1,"id":"1aa78d24_35f5d056","line":426,"updated":"2016-07-06 02:26:18.000000000","message":"I think this comment confirms my understanding.","commit_id":"06d448ff8f68d5cf3ee8adf2448397eea8c80957"},{"author":{"_account_id":6788,"name":"Rossella Sblendido","email":"rsblendido@suse.com","username":"rossella-o"},"change_message_id":"5eaaf412634a9e3487e3a56fcf4d761f346748c5","unresolved":false,"context_lines":[{"line_number":423,"context_line":""},{"line_number":424,"context_line":"    def subport_added(self, context, **kwargs):"},{"line_number":425,"context_line":"        # TODO(rossella_s) implements methods that will apply the changes"},{"line_number":426,"context_line":"        # triggered by an API call"},{"line_number":427,"context_line":""},{"line_number":428,"context_line":"    def network_update(self, context, **kwargs):"},{"line_number":429,"context_line":"        network_id \u003d kwargs[\u0027network\u0027][\u0027id\u0027]"}],"source_content_type":"text/x-python","patch_set":1,"id":"1aa78d24_852a7a8e","line":426,"in_reply_to":"1aa78d24_35f5d056","updated":"2016-07-06 14:46:37.000000000","message":"Indeed I will remove this and create another patch","commit_id":"06d448ff8f68d5cf3ee8adf2448397eea8c80957"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"d4aaba7444b045af35f4d856de0b810cf00ba196","unresolved":false,"context_lines":[{"line_number":1252,"context_line":"        port_info[\u0027current\u0027] |\u003d port_info[\u0027added\u0027]"},{"line_number":1253,"context_line":"        port_info[\u0027current\u0027] -\u003d port_info[\u0027removed\u0027]"},{"line_number":1254,"context_line":""},{"line_number":1255,"context_line":"    def process_ports_events(self, events, registered_ports, ancillary_ports,"},{"line_number":1256,"context_line":"                             old_ports_not_ready, failed_devices,"},{"line_number":1257,"context_line":"                             failed_ancillary_devices, updated_ports\u003dNone):"},{"line_number":1258,"context_line":"        port_info \u003d {}"}],"source_content_type":"text/x-python","patch_set":1,"id":"1aa78d24_75ebd878","line":1255,"updated":"2016-07-06 02:26:18.000000000","message":"is there any chance we can carve out a new method that takes events and returns other_bridges_ports? I don\u0027t see why the rest of this code would be needed otherwise.","commit_id":"06d448ff8f68d5cf3ee8adf2448397eea8c80957"},{"author":{"_account_id":6788,"name":"Rossella Sblendido","email":"rsblendido@suse.com","username":"rossella-o"},"change_message_id":"5eaaf412634a9e3487e3a56fcf4d761f346748c5","unresolved":false,"context_lines":[{"line_number":1252,"context_line":"        port_info[\u0027current\u0027] |\u003d port_info[\u0027added\u0027]"},{"line_number":1253,"context_line":"        port_info[\u0027current\u0027] -\u003d port_info[\u0027removed\u0027]"},{"line_number":1254,"context_line":""},{"line_number":1255,"context_line":"    def process_ports_events(self, events, registered_ports, ancillary_ports,"},{"line_number":1256,"context_line":"                             old_ports_not_ready, failed_devices,"},{"line_number":1257,"context_line":"                             failed_ancillary_devices, updated_ports\u003dNone):"},{"line_number":1258,"context_line":"        port_info \u003d {}"}],"source_content_type":"text/x-python","patch_set":1,"id":"1aa78d24_077fbc15","line":1255,"in_reply_to":"1aa78d24_75ebd878","updated":"2016-07-06 14:46:37.000000000","message":"let\u0027s try","commit_id":"06d448ff8f68d5cf3ee8adf2448397eea8c80957"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"d4aaba7444b045af35f4d856de0b810cf00ba196","unresolved":false,"context_lines":[{"line_number":1286,"context_line":"                                   if e[\u0027name\u0027] !\u003d p]"},{"line_number":1287,"context_line":""},{"line_number":1288,"context_line":"        #TODO(rossella_s): scanning the ancillary bridge won\u0027t be needed"},{"line_number":1289,"context_line":"        # anymore when https://review.openstack.org/#/c/203381 since the bridge"},{"line_number":1290,"context_line":"        # id stored in external_ids will be used to identify the bridge the"},{"line_number":1291,"context_line":"        # port belongs to"},{"line_number":1292,"context_line":"        cur_ancillary_ports \u003d set()"}],"source_content_type":"text/x-python","patch_set":1,"id":"1aa78d24_4f2d6dfd","line":1289,"updated":"2016-07-06 02:26:18.000000000","message":"whilst looking at this I noticed this patch is abandoned, so what\u0027s up with that?","commit_id":"06d448ff8f68d5cf3ee8adf2448397eea8c80957"},{"author":{"_account_id":6788,"name":"Rossella Sblendido","email":"rsblendido@suse.com","username":"rossella-o"},"change_message_id":"5eaaf412634a9e3487e3a56fcf4d761f346748c5","unresolved":false,"context_lines":[{"line_number":1286,"context_line":"                                   if e[\u0027name\u0027] !\u003d p]"},{"line_number":1287,"context_line":""},{"line_number":1288,"context_line":"        #TODO(rossella_s): scanning the ancillary bridge won\u0027t be needed"},{"line_number":1289,"context_line":"        # anymore when https://review.openstack.org/#/c/203381 since the bridge"},{"line_number":1290,"context_line":"        # id stored in external_ids will be used to identify the bridge the"},{"line_number":1291,"context_line":"        # port belongs to"},{"line_number":1292,"context_line":"        cur_ancillary_ports \u003d set()"}],"source_content_type":"text/x-python","patch_set":1,"id":"1aa78d24_2772b849","line":1289,"in_reply_to":"1aa78d24_4f2d6dfd","updated":"2016-07-06 14:46:37.000000000","message":"we should revive it...I will ping Terry","commit_id":"06d448ff8f68d5cf3ee8adf2448397eea8c80957"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"d4aaba7444b045af35f4d856de0b810cf00ba196","unresolved":false,"context_lines":[{"line_number":1296,"context_line":""},{"line_number":1297,"context_line":"        # TODO(rossella_s) this is not optimal, another query to get all"},{"line_number":1298,"context_line":"        # the ports"},{"line_number":1299,"context_line":"        cur_br_int_ports \u003d self.int_br.get_vif_port_set() | port_info[\u0027current\u0027]"},{"line_number":1300,"context_line":""},{"line_number":1301,"context_line":"        def _process_port(port, ports, ancillary_ports, other_bridges_ports):"},{"line_number":1302,"context_line":"            # check \u0027iface-id\u0027 is set otherwise is not a port"}],"source_content_type":"text/x-python","patch_set":1,"id":"1aa78d24_359cb00e","line":1299,"updated":"2016-07-06 02:26:18.000000000","message":"I might be missing something here, but I am unclear why we need to exclude ports connected to br-int in this loop.","commit_id":"06d448ff8f68d5cf3ee8adf2448397eea8c80957"},{"author":{"_account_id":6788,"name":"Rossella Sblendido","email":"rsblendido@suse.com","username":"rossella-o"},"change_message_id":"5eaaf412634a9e3487e3a56fcf4d761f346748c5","unresolved":false,"context_lines":[{"line_number":1296,"context_line":""},{"line_number":1297,"context_line":"        # TODO(rossella_s) this is not optimal, another query to get all"},{"line_number":1298,"context_line":"        # the ports"},{"line_number":1299,"context_line":"        cur_br_int_ports \u003d self.int_br.get_vif_port_set() | port_info[\u0027current\u0027]"},{"line_number":1300,"context_line":""},{"line_number":1301,"context_line":"        def _process_port(port, ports, ancillary_ports, other_bridges_ports):"},{"line_number":1302,"context_line":"            # check \u0027iface-id\u0027 is set otherwise is not a port"}],"source_content_type":"text/x-python","patch_set":1,"id":"1aa78d24_e239bed8","line":1299,"in_reply_to":"1aa78d24_359cb00e","updated":"2016-07-06 14:46:37.000000000","message":"because we want to get only the ports on br-int to do the usual processing.","commit_id":"06d448ff8f68d5cf3ee8adf2448397eea8c80957"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"d1d68b4e0f43792f5f8bc17b4fb1fadc2ed85796","unresolved":false,"context_lines":[{"line_number":1296,"context_line":""},{"line_number":1297,"context_line":"        # TODO(rossella_s) this is not optimal, another query to get all"},{"line_number":1298,"context_line":"        # the ports"},{"line_number":1299,"context_line":"        cur_br_int_ports \u003d self.int_br.get_vif_port_set() | port_info[\u0027current\u0027]"},{"line_number":1300,"context_line":""},{"line_number":1301,"context_line":"        def _process_port(port, ports, ancillary_ports, other_bridges_ports):"},{"line_number":1302,"context_line":"            # check \u0027iface-id\u0027 is set otherwise is not a port"}],"source_content_type":"text/x-python","patch_set":1,"id":"1aa78d24_1ced21b7","line":1299,"in_reply_to":"1aa78d24_e239bed8","updated":"2016-07-06 23:50:15.000000000","message":"oh...so here you are considering the sub-ports? For some reason I was thinking of trunk parent ports only in the context of this patch. Ok, I think this is clear.","commit_id":"06d448ff8f68d5cf3ee8adf2448397eea8c80957"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"d4aaba7444b045af35f4d856de0b810cf00ba196","unresolved":false,"context_lines":[{"line_number":1313,"context_line":"                    # check if port belongs to ancillary bridge"},{"line_number":1314,"context_line":"                    if iface_id in cur_ancillary_ports:"},{"line_number":1315,"context_line":"                        ancillary_ports.add(iface_id)"},{"line_number":1316,"context_line":"                    elif iface_id in cur_br_int_ports:"},{"line_number":1317,"context_line":"                        ports.add(iface_id)"},{"line_number":1318,"context_line":"                    else:"},{"line_number":1319,"context_line":"                        other_bridges_ports.add(iface_id)"}],"source_content_type":"text/x-python","patch_set":1,"id":"1aa78d24_6a7017dd","line":1316,"updated":"2016-07-06 02:26:18.000000000","message":"Why are we skipping ports here? Not sure I fully grasp this. Don\u0027t we need to handle trunk ports just the same we handle regular ports when it comes to the \u0027usual\u0027 stuff?","commit_id":"06d448ff8f68d5cf3ee8adf2448397eea8c80957"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"d1d68b4e0f43792f5f8bc17b4fb1fadc2ed85796","unresolved":false,"context_lines":[{"line_number":1313,"context_line":"                    # check if port belongs to ancillary bridge"},{"line_number":1314,"context_line":"                    if iface_id in cur_ancillary_ports:"},{"line_number":1315,"context_line":"                        ancillary_ports.add(iface_id)"},{"line_number":1316,"context_line":"                    elif iface_id in cur_br_int_ports:"},{"line_number":1317,"context_line":"                        ports.add(iface_id)"},{"line_number":1318,"context_line":"                    else:"},{"line_number":1319,"context_line":"                        other_bridges_ports.add(iface_id)"}],"source_content_type":"text/x-python","patch_set":1,"id":"1aa78d24_7cca651c","line":1316,"in_reply_to":"1aa78d24_62382ef0","updated":"2016-07-06 23:50:15.000000000","message":"right, but wouldn\u0027t the condition above exclude these ports automatically?","commit_id":"06d448ff8f68d5cf3ee8adf2448397eea8c80957"},{"author":{"_account_id":6788,"name":"Rossella Sblendido","email":"rsblendido@suse.com","username":"rossella-o"},"change_message_id":"5eaaf412634a9e3487e3a56fcf4d761f346748c5","unresolved":false,"context_lines":[{"line_number":1313,"context_line":"                    # check if port belongs to ancillary bridge"},{"line_number":1314,"context_line":"                    if iface_id in cur_ancillary_ports:"},{"line_number":1315,"context_line":"                        ancillary_ports.add(iface_id)"},{"line_number":1316,"context_line":"                    elif iface_id in cur_br_int_ports:"},{"line_number":1317,"context_line":"                        ports.add(iface_id)"},{"line_number":1318,"context_line":"                    else:"},{"line_number":1319,"context_line":"                        other_bridges_ports.add(iface_id)"}],"source_content_type":"text/x-python","patch_set":1,"id":"1aa78d24_62382ef0","line":1316,"in_reply_to":"1aa78d24_6a7017dd","updated":"2016-07-06 14:46:37.000000000","message":"looking at [1] take tp-patch-trunk and sp-patch-trunk. They have to be created by the agent and don\u0027t need further processing since at the time of creation they will already have all the logic to tag/untag, so we don\u0027t need to process them further like \"usual\" ports. While tp_patch_int and sp_patch_int will be processed as usual ports. I still have to wrap my head around the firewalling rules completely. For a start I think it\u0027s acceptable to assume that port security needs to be disabled on trunk ports and let all the traffic flow.\n\n[1] https://review.openstack.org/#/c/318317/8/doc/source/devref/openvswitch_agent.rst","commit_id":"06d448ff8f68d5cf3ee8adf2448397eea8c80957"},{"author":{"_account_id":16800,"name":"Rawlin Peters","email":"rawlin.peters@hpe.com","username":"rawlin"},"change_message_id":"5f86c5130d222f25697e96f056e3ffc72aa19564","unresolved":false,"context_lines":[{"line_number":1705,"context_line":""},{"line_number":1706,"context_line":"    def process_trunk_ports(self, port_info):"},{"line_number":1707,"context_line":"        if \u0027added\u0027 in port_info and port_info[\u0027added\u0027]:"},{"line_number":1708,"context_line":"            # TODO(rossella_s) define an RPC call to get the trunk details"},{"line_number":1709,"context_line":"            # and write the code to process the ports, see https://review.openstack.org/#/c/330792"},{"line_number":1710,"context_line":"            # to get an idea of what\u0027s needed"},{"line_number":1711,"context_line":"            pass"}],"source_content_type":"text/x-python","patch_set":1,"id":"3aaa91ec_958e312c","line":1708,"range":{"start_line":1708,"start_character":50,"end_line":1708,"end_character":74},"updated":"2016-06-29 18:54:34.000000000","message":"I think we should modify the get_device_details RPC to return the port\u0027s \u0027trunk_details\u0027 field. The field will already contain the necessary data: https://review.openstack.org/#/c/334700/4/neutron/services/trunk/plugin.py.\n\nThen the port_info will already have this data from get_device_details.","commit_id":"06d448ff8f68d5cf3ee8adf2448397eea8c80957"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"d4aaba7444b045af35f4d856de0b810cf00ba196","unresolved":false,"context_lines":[{"line_number":1705,"context_line":""},{"line_number":1706,"context_line":"    def process_trunk_ports(self, port_info):"},{"line_number":1707,"context_line":"        if \u0027added\u0027 in port_info and port_info[\u0027added\u0027]:"},{"line_number":1708,"context_line":"            # TODO(rossella_s) define an RPC call to get the trunk details"},{"line_number":1709,"context_line":"            # and write the code to process the ports, see https://review.openstack.org/#/c/330792"},{"line_number":1710,"context_line":"            # to get an idea of what\u0027s needed"},{"line_number":1711,"context_line":"            pass"}],"source_content_type":"text/x-python","patch_set":1,"id":"1aa78d24_ea2fe785","line":1708,"range":{"start_line":1708,"start_character":50,"end_line":1708,"end_character":74},"in_reply_to":"1aa78d24_d83180ee","updated":"2016-07-06 02:26:18.000000000","message":"This is the case where a VM is booted with a port associated to a trunk and thus the port shows up on the agent side for the first time. Just like any other regular port.","commit_id":"06d448ff8f68d5cf3ee8adf2448397eea8c80957"},{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"f0798d03dfa6d1f20bfc30d32cf091d1029df082","unresolved":false,"context_lines":[{"line_number":1705,"context_line":""},{"line_number":1706,"context_line":"    def process_trunk_ports(self, port_info):"},{"line_number":1707,"context_line":"        if \u0027added\u0027 in port_info and port_info[\u0027added\u0027]:"},{"line_number":1708,"context_line":"            # TODO(rossella_s) define an RPC call to get the trunk details"},{"line_number":1709,"context_line":"            # and write the code to process the ports, see https://review.openstack.org/#/c/330792"},{"line_number":1710,"context_line":"            # to get an idea of what\u0027s needed"},{"line_number":1711,"context_line":"            pass"}],"source_content_type":"text/x-python","patch_set":1,"id":"3aaa91ec_a01629a4","line":1708,"range":{"start_line":1708,"start_character":50,"end_line":1708,"end_character":74},"in_reply_to":"3aaa91ec_41d352d5","updated":"2016-07-01 12:20:45.000000000","message":"Aren\u0027t we supposed to use rpc callbacks to pull/push updates to trunks?","commit_id":"06d448ff8f68d5cf3ee8adf2448397eea8c80957"},{"author":{"_account_id":6788,"name":"Rossella Sblendido","email":"rsblendido@suse.com","username":"rossella-o"},"change_message_id":"99a07d41732e982d46a8f2a8cc8e68ac30606bf4","unresolved":false,"context_lines":[{"line_number":1705,"context_line":""},{"line_number":1706,"context_line":"    def process_trunk_ports(self, port_info):"},{"line_number":1707,"context_line":"        if \u0027added\u0027 in port_info and port_info[\u0027added\u0027]:"},{"line_number":1708,"context_line":"            # TODO(rossella_s) define an RPC call to get the trunk details"},{"line_number":1709,"context_line":"            # and write the code to process the ports, see https://review.openstack.org/#/c/330792"},{"line_number":1710,"context_line":"            # to get an idea of what\u0027s needed"},{"line_number":1711,"context_line":"            pass"}],"source_content_type":"text/x-python","patch_set":1,"id":"3aaa91ec_41d352d5","line":1708,"range":{"start_line":1708,"start_character":50,"end_line":1708,"end_character":74},"in_reply_to":"3aaa91ec_958e312c","updated":"2016-06-30 10:07:41.000000000","message":"Armando repeated many time that he wants to keep this new code separated from the old one. That\u0027s one reason to have a new RPC call. Another one is that get_device_details is in the ml2 plugin, other backends that don\u0027t use the ml2 plugin might want to support trunk ports.","commit_id":"06d448ff8f68d5cf3ee8adf2448397eea8c80957"},{"author":{"_account_id":6788,"name":"Rossella Sblendido","email":"rsblendido@suse.com","username":"rossella-o"},"change_message_id":"51e31c3d19b5bd033e49d759cac8f890c8dadbff","unresolved":false,"context_lines":[{"line_number":1705,"context_line":""},{"line_number":1706,"context_line":"    def process_trunk_ports(self, port_info):"},{"line_number":1707,"context_line":"        if \u0027added\u0027 in port_info and port_info[\u0027added\u0027]:"},{"line_number":1708,"context_line":"            # TODO(rossella_s) define an RPC call to get the trunk details"},{"line_number":1709,"context_line":"            # and write the code to process the ports, see https://review.openstack.org/#/c/330792"},{"line_number":1710,"context_line":"            # to get an idea of what\u0027s needed"},{"line_number":1711,"context_line":"            pass"}],"source_content_type":"text/x-python","patch_set":1,"id":"1aa78d24_d83180ee","line":1708,"range":{"start_line":1708,"start_character":50,"end_line":1708,"end_character":74},"in_reply_to":"3aaa91ec_a01629a4","updated":"2016-07-04 09:47:15.000000000","message":"for updates yes...but in this case it\u0027s the agent requesting the details for the trunk","commit_id":"06d448ff8f68d5cf3ee8adf2448397eea8c80957"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"d4aaba7444b045af35f4d856de0b810cf00ba196","unresolved":false,"context_lines":[{"line_number":1883,"context_line":""},{"line_number":1884,"context_line":"        else:"},{"line_number":1885,"context_line":"            consecutive_resyncs \u003d 0"},{"line_number":1886,"context_line":"            events \u003d polling_manager.get_events()"},{"line_number":1887,"context_line":"            (port_info, ancillary_port_info, ports_not_ready_yet,"},{"line_number":1888,"context_line":"             other_bridges_ports) \u003d ("},{"line_number":1889,"context_line":"                self.process_ports_events(events, ports, ancillary_ports,"}],"source_content_type":"text/x-python","patch_set":1,"id":"1aa78d24_f55d0816","line":1886,"updated":"2016-07-06 02:26:18.000000000","message":"I wonder if there\u0027s a chance to get hold of events higher up in the stack (e.g. directly in the rpc_loop). That raises the question: wouldn\u0027t we want to get access to other_bridges_ports during a sync too? I suppose this is TBC?","commit_id":"06d448ff8f68d5cf3ee8adf2448397eea8c80957"},{"author":{"_account_id":6788,"name":"Rossella Sblendido","email":"rsblendido@suse.com","username":"rossella-o"},"change_message_id":"5eaaf412634a9e3487e3a56fcf4d761f346748c5","unresolved":false,"context_lines":[{"line_number":1883,"context_line":""},{"line_number":1884,"context_line":"        else:"},{"line_number":1885,"context_line":"            consecutive_resyncs \u003d 0"},{"line_number":1886,"context_line":"            events \u003d polling_manager.get_events()"},{"line_number":1887,"context_line":"            (port_info, ancillary_port_info, ports_not_ready_yet,"},{"line_number":1888,"context_line":"             other_bridges_ports) \u003d ("},{"line_number":1889,"context_line":"                self.process_ports_events(events, ports, ancillary_ports,"}],"source_content_type":"text/x-python","patch_set":1,"id":"1aa78d24_25b2a606","line":1886,"in_reply_to":"1aa78d24_f55d0816","updated":"2016-07-06 14:46:37.000000000","message":"Yes this is TBC definately","commit_id":"06d448ff8f68d5cf3ee8adf2448397eea8c80957"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"d4aaba7444b045af35f4d856de0b810cf00ba196","unresolved":false,"context_lines":[{"line_number":1885,"context_line":"            consecutive_resyncs \u003d 0"},{"line_number":1886,"context_line":"            events \u003d polling_manager.get_events()"},{"line_number":1887,"context_line":"            (port_info, ancillary_port_info, ports_not_ready_yet,"},{"line_number":1888,"context_line":"             other_bridges_ports) \u003d ("},{"line_number":1889,"context_line":"                self.process_ports_events(events, ports, ancillary_ports,"},{"line_number":1890,"context_line":"                                          ports_not_ready_yet,"},{"line_number":1891,"context_line":"                                          failed_devices,"}],"source_content_type":"text/x-python","patch_set":1,"id":"1aa78d24_8a974339","line":1888,"updated":"2016-07-06 02:26:18.000000000","message":"Is there any chance we can call/define a method like process_ports_events that can be called directly from line 2041? We should avoid changing this method if we can.","commit_id":"06d448ff8f68d5cf3ee8adf2448397eea8c80957"},{"author":{"_account_id":6788,"name":"Rossella Sblendido","email":"rsblendido@suse.com","username":"rossella-o"},"change_message_id":"5eaaf412634a9e3487e3a56fcf4d761f346748c5","unresolved":false,"context_lines":[{"line_number":1885,"context_line":"            consecutive_resyncs \u003d 0"},{"line_number":1886,"context_line":"            events \u003d polling_manager.get_events()"},{"line_number":1887,"context_line":"            (port_info, ancillary_port_info, ports_not_ready_yet,"},{"line_number":1888,"context_line":"             other_bridges_ports) \u003d ("},{"line_number":1889,"context_line":"                self.process_ports_events(events, ports, ancillary_ports,"},{"line_number":1890,"context_line":"                                          ports_not_ready_yet,"},{"line_number":1891,"context_line":"                                          failed_devices,"}],"source_content_type":"text/x-python","patch_set":1,"id":"1aa78d24_c5a762bb","line":1888,"in_reply_to":"1aa78d24_8a974339","updated":"2016-07-06 14:46:37.000000000","message":"OK","commit_id":"06d448ff8f68d5cf3ee8adf2448397eea8c80957"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"d4aaba7444b045af35f4d856de0b810cf00ba196","unresolved":false,"context_lines":[{"line_number":2038,"context_line":"                    self.updated_ports \u003d set()"},{"line_number":2039,"context_line":"                    (port_info, ancillary_port_info, consecutive_resyncs,"},{"line_number":2040,"context_line":"                     ports_not_ready_yet, other_bridges_ports_info) \u003d ("},{"line_number":2041,"context_line":"                        self.process_port_info("},{"line_number":2042,"context_line":"                            start, polling_manager, sync, ovs_restarted,"},{"line_number":2043,"context_line":"                            ports, ancillary_ports, updated_ports_copy,"},{"line_number":2044,"context_line":"                            consecutive_resyncs, ports_not_ready_yet,"}],"source_content_type":"text/x-python","patch_set":1,"id":"1aa78d24_4a9d5bbb","line":2041,"updated":"2016-07-06 02:26:18.000000000","message":"I personally would have come up with a method that can extract just other_bridges_ports_info out from the polling manager, which in order to prevent reliability/maintainability regression is totally justified IMO. It\u0027s perhaps a little duplication, but the aim here is to try and keep this code untouched for as much as we can...we all know how brittle it is ;)\n\nIn other words, if we had access to the \u0027raw\u0027 events via the polling_manager.get_events(), we can then parse it to fetch only the information the agent cares about and give it to process_trunk_ports().\n\nIt seems that passing through process_port_info-\u003eprocess_ports_events may be avoided somehow.\n\nIn other words, what if we modified the polling manager to keep a copy of the events and then we can go through the events to determine which ones belong to trunk parent ports (which are the only ports the agent cares about here - sub-ports will be handled through RPC notifications from the server).\n\nThoughts?","commit_id":"06d448ff8f68d5cf3ee8adf2448397eea8c80957"},{"author":{"_account_id":6788,"name":"Rossella Sblendido","email":"rsblendido@suse.com","username":"rossella-o"},"change_message_id":"5eaaf412634a9e3487e3a56fcf4d761f346748c5","unresolved":false,"context_lines":[{"line_number":2038,"context_line":"                    self.updated_ports \u003d set()"},{"line_number":2039,"context_line":"                    (port_info, ancillary_port_info, consecutive_resyncs,"},{"line_number":2040,"context_line":"                     ports_not_ready_yet, other_bridges_ports_info) \u003d ("},{"line_number":2041,"context_line":"                        self.process_port_info("},{"line_number":2042,"context_line":"                            start, polling_manager, sync, ovs_restarted,"},{"line_number":2043,"context_line":"                            ports, ancillary_ports, updated_ports_copy,"},{"line_number":2044,"context_line":"                            consecutive_resyncs, ports_not_ready_yet,"}],"source_content_type":"text/x-python","patch_set":1,"id":"1aa78d24_45253207","line":2041,"in_reply_to":"1aa78d24_4a9d5bbb","updated":"2016-07-06 14:46:37.000000000","message":"yes, that\u0027s a great suggestion! tbh at the beginning I was trying to filter the events in OVSDB monitor as we discussed in Berlin.When I looked at the code, it\u0027s not so trivial. If we use a publish/subscriber pattern we should have a way to track which events are sent to who. It might happen that nobody is interested in a particular bridge so we need a way to clean up the events after some time. It\u0027s not trivial..and I don\u0027t see much gain since we use the monitor only here.","commit_id":"06d448ff8f68d5cf3ee8adf2448397eea8c80957"},{"author":{"_account_id":16800,"name":"Rawlin Peters","email":"rawlin.peters@hpe.com","username":"rawlin"},"change_message_id":"47d18d1896fe04151a44261b2f46f0d7a7eaa92a","unresolved":false,"context_lines":[{"line_number":1915,"context_line":""},{"line_number":1916,"context_line":"    def treat_trunk_port_added(self, port):"},{"line_number":1917,"context_line":"        device_details \u003d ("},{"line_number":1918,"context_line":"            self.plugin_rpc.get_devices_details("},{"line_number":1919,"context_line":"                self.context,"},{"line_number":1920,"context_line":"                port,"},{"line_number":1921,"context_line":"                self.agent_id,"}],"source_content_type":"text/x-python","patch_set":2,"id":"1aa78d24_7758d28a","line":1918,"updated":"2016-07-06 17:42:54.000000000","message":"From [1] it looks like we shouldn\u0027t be relying on the get_device_details RPC call.\n\n[1] https://review.openstack.org/#/c/337896/2/neutron/plugins/ml2/rpc.py@128","commit_id":"5e469a21f6bd4efcc634e6dbe6cc8554ba613d7f"},{"author":{"_account_id":21273,"name":"Ilya Chukhnakov","email":"Ilya.chukhnakov@gmail.com","username":"ichukhnakov"},"change_message_id":"bdd3bc66eb7d4ff98067827689083795b4913afa","unresolved":false,"context_lines":[{"line_number":1915,"context_line":""},{"line_number":1916,"context_line":"    def treat_trunk_port_added(self, port):"},{"line_number":1917,"context_line":"        device_details \u003d ("},{"line_number":1918,"context_line":"            self.plugin_rpc.get_devices_details("},{"line_number":1919,"context_line":"                self.context,"},{"line_number":1920,"context_line":"                port,"},{"line_number":1921,"context_line":"                self.agent_id,"}],"source_content_type":"text/x-python","patch_set":2,"id":"1aa78d24_3f460a4f","line":1918,"in_reply_to":"1aa78d24_2718ca74","updated":"2016-07-07 03:01:57.000000000","message":"\u003e sophisticated piece of s...oftware\n\u003e We should try and avoid blending the trunk integration with the existing logic\n\nI do fully agree with the idea to separate trunk support from the existing agent logic. Though I don\u0027t think duplicating agent\u0027s methods for trunk support is the right way to do it - IMHO it adds more bloat and special-casing to already complicated s...oftware :(\n\nWhat I like about the agent extensions is how I can open the extension class and find all the (agent-related) code for the specific feature in one place.\n\nThat is certainly a topic for another discussion and not a simple one, but I think that the features like Trunk, QoS, SecGroups, DVR, etc. should really be extensions/plugins (but not mixins...) and the agent code should be kept minimalistic and only (mostly) provide junction points for those extensions (ofc. that would require lots of changes including the extension API).","commit_id":"5e469a21f6bd4efcc634e6dbe6cc8554ba613d7f"},{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"15ba4077561ca877cfc44a98b86efe4f450140fe","unresolved":false,"context_lines":[{"line_number":1915,"context_line":""},{"line_number":1916,"context_line":"    def treat_trunk_port_added(self, port):"},{"line_number":1917,"context_line":"        device_details \u003d ("},{"line_number":1918,"context_line":"            self.plugin_rpc.get_devices_details("},{"line_number":1919,"context_line":"                self.context,"},{"line_number":1920,"context_line":"                port,"},{"line_number":1921,"context_line":"                self.agent_id,"}],"source_content_type":"text/x-python","patch_set":2,"id":"1aa78d24_c01430ea","line":1918,"in_reply_to":"1aa78d24_3f460a4f","updated":"2016-07-07 13:16:21.000000000","message":"Amen. We actually implemented l2 agent extensions and currently work on flow manager exactly to accommodate for new features as well as to open the road for existing features to move into proper composable modules in the future.","commit_id":"5e469a21f6bd4efcc634e6dbe6cc8554ba613d7f"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"861f21a7ff2dcc126d1f46b08bbb2fce4ab118b2","unresolved":false,"context_lines":[{"line_number":1915,"context_line":""},{"line_number":1916,"context_line":"    def treat_trunk_port_added(self, port):"},{"line_number":1917,"context_line":"        device_details \u003d ("},{"line_number":1918,"context_line":"            self.plugin_rpc.get_devices_details("},{"line_number":1919,"context_line":"                self.context,"},{"line_number":1920,"context_line":"                port,"},{"line_number":1921,"context_line":"                self.agent_id,"}],"source_content_type":"text/x-python","patch_set":2,"id":"1aa78d24_2718ca74","line":1918,"in_reply_to":"1aa78d24_7758d28a","updated":"2016-07-07 00:50:14.000000000","message":"Ok to me the premise is that the OVS agent is a sophisticated piece of s...oftware. We should try and avoid blending the trunk integration with the existing logic for two reasons: a) risk of regression for the existing functionality: even if we feel we get it right the first time, a change for regression is always behind the corner; b) maintainability: assume we get it right and we don\u0027t regress, we may have introduced trunk related bugs that need fixing over time. The fixes will inevitably pollute the existing code, which will lead to the gigantic piece of complicated s...oftware we\u0027re dealing with right now.\n\nMy desire is that we can pretty much isolate all trunk related logic on its own and have the agent have two \u0027threads\u0027 of execution, one of which is dedicated to the management of trunks. If there\u0027s code reuse, it needs to come in the form of extracting utility functions but we should avoid hijacking the existing workflow, otherwise we risk to create pain down the road. Now this obviously comes with an upfront engineering cost, but we did identify this as a cost, and we all signed up on it. Based on my experience I feel that this cost is well worth it in the long run.","commit_id":"5e469a21f6bd4efcc634e6dbe6cc8554ba613d7f"},{"author":{"_account_id":16800,"name":"Rawlin Peters","email":"rawlin.peters@hpe.com","username":"rawlin"},"change_message_id":"1323560157e26a6073d60e8a2d3eed9f5d0c8001","unresolved":false,"context_lines":[{"line_number":1915,"context_line":""},{"line_number":1916,"context_line":"    def treat_trunk_port_added(self, port):"},{"line_number":1917,"context_line":"        device_details \u003d ("},{"line_number":1918,"context_line":"            self.plugin_rpc.get_devices_details("},{"line_number":1919,"context_line":"                self.context,"},{"line_number":1920,"context_line":"                port,"},{"line_number":1921,"context_line":"                self.agent_id,"}],"source_content_type":"text/x-python","patch_set":2,"id":"1aa78d24_d56059a7","line":1918,"in_reply_to":"1aa78d24_c01430ea","updated":"2016-07-07 18:26:45.000000000","message":"I\u0027m in favor of using the L2 agent extension framework as well, but this particular extension requires modifying the framework a bit to trigger extension hooks for ports that aren\u0027t added to br-int. That seems ok to me but will need some more consensus.\n\n@Armando can you be more clear on what exactly we don\u0027t want to reuse from the existing logic? To me it seems like we have to reuse the logic that configures new vif ports on br-int when they\u0027re detected.\n\nI.e. Loop 1:\nThe agent detects a new port on a trunk bridge and creates the necessary patch ports on \u0027tbr-...\u0027 and \u0027br-int\u0027, making sure to set the needed external_ids on the \u0027br-int\u0027 ports.\n\nLoop 2:\nThe agent detects the new ports added to \u0027br-int\u0027 from Loop 1 (for the trunk/subports) and finishes processing them normally like every other vif port.\n\nAre you thinking we need to avoid the action in Loop 2?","commit_id":"5e469a21f6bd4efcc634e6dbe6cc8554ba613d7f"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"c0ec27dcb3f2f047acee7cb71316b598b0d3ae7a","unresolved":false,"context_lines":[{"line_number":1915,"context_line":""},{"line_number":1916,"context_line":"    def treat_trunk_port_added(self, port):"},{"line_number":1917,"context_line":"        device_details \u003d ("},{"line_number":1918,"context_line":"            self.plugin_rpc.get_devices_details("},{"line_number":1919,"context_line":"                self.context,"},{"line_number":1920,"context_line":"                port,"},{"line_number":1921,"context_line":"                self.agent_id,"}],"source_content_type":"text/x-python","patch_set":2,"id":"1aa78d24_e512fa08","line":1918,"in_reply_to":"1aa78d24_cb86f5da","updated":"2016-07-07 23:35:26.000000000","message":"The extension framework is build on the premise that the existing port handling logic is adequate and it needs no modification to address a multitude of use cases. I feel that we should strive for more decoupling/encapsulation to minimize the ripple effects that will inevitably arise should that premise be flawed. Reuse can happen in a number of ways and integrating in the existing loop is only one of them. Rossella and I brainstormed on this patch a little more and she is going to explore another potential avenue that we would like to present for discussion.","commit_id":"5e469a21f6bd4efcc634e6dbe6cc8554ba613d7f"},{"author":{"_account_id":4187,"name":"Ryan Tidwell","email":"rtidwell@suse.com","username":"ryan-tidwell"},"change_message_id":"4ee16d7dcb09502e39fd5d418681458c3916c355","unresolved":false,"context_lines":[{"line_number":1915,"context_line":""},{"line_number":1916,"context_line":"    def treat_trunk_port_added(self, port):"},{"line_number":1917,"context_line":"        device_details \u003d ("},{"line_number":1918,"context_line":"            self.plugin_rpc.get_devices_details("},{"line_number":1919,"context_line":"                self.context,"},{"line_number":1920,"context_line":"                port,"},{"line_number":1921,"context_line":"                self.agent_id,"}],"source_content_type":"text/x-python","patch_set":2,"id":"1aa78d24_cb86f5da","line":1918,"in_reply_to":"1aa78d24_d56059a7","updated":"2016-07-07 20:59:24.000000000","message":"I had envisioned us encapsulating much of this logic in an agent extension as well. I\u0027m in and out of the agent work, but I though we were trying to avoid running 2 polling loops. Is that not the case? If we can make it work I\u0027m partial to a solution that has the agent extension running its own polling loop that looks for trunk bridges. This is due to my understanding that the OVS agent is fragile (particularly the polling loop). I don\u0027t want to have to touch much of this code if it can be avoided. I\u0027m in favor of de-coupling, even at the cost of some duplication. Perfection can be the enemy of progress, and in this case I think some duplication is the cost of doing business. I think that is our best shot at maintaining our sanity for the moment :)","commit_id":"5e469a21f6bd4efcc634e6dbe6cc8554ba613d7f"},{"author":{"_account_id":16800,"name":"Rawlin Peters","email":"rawlin.peters@hpe.com","username":"rawlin"},"change_message_id":"47d18d1896fe04151a44261b2f46f0d7a7eaa92a","unresolved":false,"context_lines":[{"line_number":1933,"context_line":"        #TODO(rossella_s) process deleted devices"},{"line_number":1934,"context_line":"        pass"},{"line_number":1935,"context_line":""},{"line_number":1936,"context_line":"    def process_trunk_ports(self, events, ports_on_br_int):"},{"line_number":1937,"context_line":"        for port in events[\u0027added\u0027]:"},{"line_number":1938,"context_line":"            if \u0027attached-mac\u0027 in port.get(\u0027external_ids\u0027, []):"},{"line_number":1939,"context_line":"                #TODO(rossella_s) portid_from_external_ids should be static, it"}],"source_content_type":"text/x-python","patch_set":2,"id":"1aa78d24_d7a54647","line":1936,"updated":"2016-07-06 17:42:54.000000000","message":"Should this method filter out ports that were added to bridges that don\u0027t match the generated trunk bridge name pattern? Or, can we reasonably assume that ports with \u0027attached-mac\u0027 et al. that aren\u0027t on br-int are trunk ports? What if that assumption changes in the future?","commit_id":"5e469a21f6bd4efcc634e6dbe6cc8554ba613d7f"},{"author":{"_account_id":16800,"name":"Rawlin Peters","email":"rawlin.peters@hpe.com","username":"rawlin"},"change_message_id":"47d18d1896fe04151a44261b2f46f0d7a7eaa92a","unresolved":false,"context_lines":[{"line_number":1934,"context_line":"        pass"},{"line_number":1935,"context_line":""},{"line_number":1936,"context_line":"    def process_trunk_ports(self, events, ports_on_br_int):"},{"line_number":1937,"context_line":"        for port in events[\u0027added\u0027]:"},{"line_number":1938,"context_line":"            if \u0027attached-mac\u0027 in port.get(\u0027external_ids\u0027, []):"},{"line_number":1939,"context_line":"                #TODO(rossella_s) portid_from_external_ids should be static, it"},{"line_number":1940,"context_line":"                # doesn\u0027t depend on any particul bridge!"}],"source_content_type":"text/x-python","patch_set":2,"id":"1aa78d24_3a4f4f6c","line":1937,"updated":"2016-07-06 17:42:54.000000000","message":"events can be None from L2051, so this should be something like:\n\n \nfor port in events[\u0027added\u0027] if events else []:","commit_id":"5e469a21f6bd4efcc634e6dbe6cc8554ba613d7f"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"c16cde8c7d781a783d43ca4a21e29136baa03cbb","unresolved":false,"context_lines":[{"line_number":2063,"context_line":"                                   \u0027elapsed\u0027: time.time() - start})"},{"line_number":2064,"context_line":"                        ancillary_ports \u003d ancillary_port_info[\u0027current\u0027]"},{"line_number":2065,"context_line":""},{"line_number":2066,"context_line":"                    if hasattr(polling_manager, \u0027get_events\u0027):"},{"line_number":2067,"context_line":"                        ports_to_ignore \u003d (port_info[\u0027current\u0027] |"},{"line_number":2068,"context_line":"                                           ancillary_port_info[\u0027current\u0027])"},{"line_number":2069,"context_line":"                        #TODO(rossella_s): need to define a new event?"}],"source_content_type":"text/x-python","patch_set":4,"id":"dada55a8_e23d9abc","line":2066,"updated":"2016-07-23 05:18:27.000000000","message":"have you considered moving this notification in process_port_info before returning? It seems you have access to everything you\u0027re emitting here.","commit_id":"7ed0415c52fd936013c6a8a2160f4739a81ba9c6"},{"author":{"_account_id":6788,"name":"Rossella Sblendido","email":"rsblendido@suse.com","username":"rossella-o"},"change_message_id":"b15d440cebbb715e1e7e1fadba2d6b4873b99316","unresolved":false,"context_lines":[{"line_number":2063,"context_line":"                                   \u0027elapsed\u0027: time.time() - start})"},{"line_number":2064,"context_line":"                        ancillary_ports \u003d ancillary_port_info[\u0027current\u0027]"},{"line_number":2065,"context_line":""},{"line_number":2066,"context_line":"                    if hasattr(polling_manager, \u0027get_events\u0027):"},{"line_number":2067,"context_line":"                        ports_to_ignore \u003d (port_info[\u0027current\u0027] |"},{"line_number":2068,"context_line":"                                           ancillary_port_info[\u0027current\u0027])"},{"line_number":2069,"context_line":"                        #TODO(rossella_s): need to define a new event?"}],"source_content_type":"text/x-python","patch_set":4,"id":"dada55a8_7ad60a50","line":2066,"in_reply_to":"dada55a8_e23d9abc","updated":"2016-07-26 15:54:06.000000000","message":"yes, that\u0027s what I meant in https://review.openstack.org/#/c/335536/4/neutron/agent/linux/ovsdb_monitor.py@90 , look at next patch please.","commit_id":"7ed0415c52fd936013c6a8a2160f4739a81ba9c6"}],"neutron/services/trunk/drivers/base.py":[{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"67e21dccea1f6519b3b9d1d6fa853698ee76eba6","unresolved":false,"context_lines":[{"line_number":18,"context_line":"from neutron.callbacks import resources"},{"line_number":19,"context_line":""},{"line_number":20,"context_line":""},{"line_number":21,"context_line":"@six.add_metaclass(abc.ABCMeta)"},{"line_number":22,"context_line":"class TrunkAbstractDriver(object):"},{"line_number":23,"context_line":"    \"\"\"Abstract Trunk driver.\"\"\""},{"line_number":24,"context_line":""}],"source_content_type":"text/x-python","patch_set":4,"id":"dada55a8_f3fe1637","line":21,"updated":"2016-07-22 22:47:52.000000000","message":"move this module under a level neutron/services/trunk/drivers/agent/ it\u0027s probably clearer","commit_id":"7ed0415c52fd936013c6a8a2160f4739a81ba9c6"},{"author":{"_account_id":6788,"name":"Rossella Sblendido","email":"rsblendido@suse.com","username":"rossella-o"},"change_message_id":"b15d440cebbb715e1e7e1fadba2d6b4873b99316","unresolved":false,"context_lines":[{"line_number":18,"context_line":"from neutron.callbacks import resources"},{"line_number":19,"context_line":""},{"line_number":20,"context_line":""},{"line_number":21,"context_line":"@six.add_metaclass(abc.ABCMeta)"},{"line_number":22,"context_line":"class TrunkAbstractDriver(object):"},{"line_number":23,"context_line":"    \"\"\"Abstract Trunk driver.\"\"\""},{"line_number":24,"context_line":""}],"source_content_type":"text/x-python","patch_set":4,"id":"dada55a8_d5b1c902","line":21,"in_reply_to":"dada55a8_3b9e85b8","updated":"2016-07-26 15:54:06.000000000","message":"Done","commit_id":"7ed0415c52fd936013c6a8a2160f4739a81ba9c6"},{"author":{"_account_id":4187,"name":"Ryan Tidwell","email":"rtidwell@suse.com","username":"ryan-tidwell"},"change_message_id":"ee917dbbc3f0849c0f302a5195fbdc2f6bdf643c","unresolved":false,"context_lines":[{"line_number":18,"context_line":"from neutron.callbacks import resources"},{"line_number":19,"context_line":""},{"line_number":20,"context_line":""},{"line_number":21,"context_line":"@six.add_metaclass(abc.ABCMeta)"},{"line_number":22,"context_line":"class TrunkAbstractDriver(object):"},{"line_number":23,"context_line":"    \"\"\"Abstract Trunk driver.\"\"\""},{"line_number":24,"context_line":""}],"source_content_type":"text/x-python","patch_set":4,"id":"dada55a8_3b9e85b8","line":21,"in_reply_to":"dada55a8_f3fe1637","updated":"2016-07-25 19:13:14.000000000","message":"+1","commit_id":"7ed0415c52fd936013c6a8a2160f4739a81ba9c6"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"c16cde8c7d781a783d43ca4a21e29136baa03cbb","unresolved":false,"context_lines":[{"line_number":28,"context_line":"        #TODO(rossella_s) this is temporary update when"},{"line_number":29,"context_line":"        # https://review.openstack.org/#/c/341212 merges"},{"line_number":30,"context_line":""},{"line_number":31,"context_line":"        registry.subscribe(self.add_trunk_port, resources.TRUNK,"},{"line_number":32,"context_line":"                           events.AFTER_CREATE)"},{"line_number":33,"context_line":"        registry.subscribe(self.remove_trunk_port, resources.TRUNK,"},{"line_number":34,"context_line":"                           events.AFTER_DELETE)"}],"source_content_type":"text/x-python","patch_set":4,"id":"dada55a8_e2647ae6","line":31,"updated":"2016-07-23 05:18:27.000000000","message":"is this meant to be an agent side component? Because if it is, these events as introduced by change 341212 won\u0027t be available in the process space for the agent in that these are emitted in the server side process space.\n\nI think there\u0027s a bit of a mixup here. I think this should become the skeleton for the RPC interface on the agent-side, in other words the methods that serve the cast calls made by [1]. At least two methods are required for telling the agent about subports being added/removed. This is the use case where the trunk is already bound, and up and running and a user is dynamically adding/removing networks to the trunk via subports. The agent should take the ports and do the necessary binding/wiring and report back to the server that the operation has completed. The operation can be fully asynchronous (ie. rather than doing an rpc.call we do two rpc.casts), therefore we would need to add a method in [2] to signal the completion of the operation. Actual argument list TBD.\n\nOn the other hand, the actual wiring can itself be modularized into its own component as it needs to be reused in another use case where the trunk shows on the host for the first time (VM boot). At that point the agent goes and fetch trunk information from the server via RPC API [2] (or via RPC pull mechanism) so that it can do the wiring. Once the operation is complete, a signal to the server is also required.\n\nSo in summary, my suggestion is to split this module in half: one that is used to interface with the local vSwitch to perform data wiring operations, the other that handles the workflows as initiated by the Neutron Server and OVSDB Server respectively.\n\n[1] https://review.openstack.org/#/c/341846/2/neutron/services/trunk/drivers/openvswitch.py\n[2] https://review.openstack.org/#/c/339283/13/neutron/services/trunk/rpc_callbacks.py","commit_id":"7ed0415c52fd936013c6a8a2160f4739a81ba9c6"},{"author":{"_account_id":6788,"name":"Rossella Sblendido","email":"rsblendido@suse.com","username":"rossella-o"},"change_message_id":"b15d440cebbb715e1e7e1fadba2d6b4873b99316","unresolved":false,"context_lines":[{"line_number":28,"context_line":"        #TODO(rossella_s) this is temporary update when"},{"line_number":29,"context_line":"        # https://review.openstack.org/#/c/341212 merges"},{"line_number":30,"context_line":""},{"line_number":31,"context_line":"        registry.subscribe(self.add_trunk_port, resources.TRUNK,"},{"line_number":32,"context_line":"                           events.AFTER_CREATE)"},{"line_number":33,"context_line":"        registry.subscribe(self.remove_trunk_port, resources.TRUNK,"},{"line_number":34,"context_line":"                           events.AFTER_DELETE)"}],"source_content_type":"text/x-python","patch_set":4,"id":"dada55a8_15fa4175","line":31,"in_reply_to":"dada55a8_be1b831b","updated":"2016-07-26 15:54:06.000000000","message":"Done","commit_id":"7ed0415c52fd936013c6a8a2160f4739a81ba9c6"},{"author":{"_account_id":4187,"name":"Ryan Tidwell","email":"rtidwell@suse.com","username":"ryan-tidwell"},"change_message_id":"ee917dbbc3f0849c0f302a5195fbdc2f6bdf643c","unresolved":false,"context_lines":[{"line_number":28,"context_line":"        #TODO(rossella_s) this is temporary update when"},{"line_number":29,"context_line":"        # https://review.openstack.org/#/c/341212 merges"},{"line_number":30,"context_line":""},{"line_number":31,"context_line":"        registry.subscribe(self.add_trunk_port, resources.TRUNK,"},{"line_number":32,"context_line":"                           events.AFTER_CREATE)"},{"line_number":33,"context_line":"        registry.subscribe(self.remove_trunk_port, resources.TRUNK,"},{"line_number":34,"context_line":"                           events.AFTER_DELETE)"}],"source_content_type":"text/x-python","patch_set":4,"id":"dada55a8_be1b831b","line":31,"in_reply_to":"dada55a8_e2647ae6","updated":"2016-07-25 19:13:14.000000000","message":"+1 to splitting the OVSDB event handling from the RPC event handling. From an RPC perspective, AFTER_CREATE for trunks really isn\u0027t relevant. However, the rest of these subscriptions seem relevant to the RPC event handling.","commit_id":"7ed0415c52fd936013c6a8a2160f4739a81ba9c6"}],"neutron/services/trunk/drivers/openvswitch.py":[{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"c16cde8c7d781a783d43ca4a21e29136baa03cbb","unresolved":false,"context_lines":[{"line_number":27,"context_line":"LOG \u003d logging.getLogger(__name__)"},{"line_number":28,"context_line":""},{"line_number":29,"context_line":""},{"line_number":30,"context_line":"class OVSTrunkDriver(base.TrunkAbstractDriver):"},{"line_number":31,"context_line":""},{"line_number":32,"context_line":"    def __init__(self):"},{"line_number":33,"context_line":"        super(OVSTrunkDriver, self).__init__()"}],"source_content_type":"text/x-python","patch_set":4,"id":"dada55a8_c2a4d609","line":30,"updated":"2016-07-23 05:18:27.000000000","message":"This is definitely an agent side component and I think it would be best places under a module called \u0027agent\u0027 under drivers? See comment [1]?\n\n[1] https://review.openstack.org/#/c/341846/2/neutron/services/trunk/drivers/openvswitch.py@1","commit_id":"7ed0415c52fd936013c6a8a2160f4739a81ba9c6"},{"author":{"_account_id":4187,"name":"Ryan Tidwell","email":"rtidwell@suse.com","username":"ryan-tidwell"},"change_message_id":"ee917dbbc3f0849c0f302a5195fbdc2f6bdf643c","unresolved":false,"context_lines":[{"line_number":27,"context_line":"LOG \u003d logging.getLogger(__name__)"},{"line_number":28,"context_line":""},{"line_number":29,"context_line":""},{"line_number":30,"context_line":"class OVSTrunkDriver(base.TrunkAbstractDriver):"},{"line_number":31,"context_line":""},{"line_number":32,"context_line":"    def __init__(self):"},{"line_number":33,"context_line":"        super(OVSTrunkDriver, self).__init__()"}],"source_content_type":"text/x-python","patch_set":4,"id":"dada55a8_7b263ebb","line":30,"in_reply_to":"dada55a8_c2a4d609","updated":"2016-07-25 19:13:14.000000000","message":"+1, organizing the agent-side components under this path is a little confusing.","commit_id":"7ed0415c52fd936013c6a8a2160f4739a81ba9c6"},{"author":{"_account_id":6788,"name":"Rossella Sblendido","email":"rsblendido@suse.com","username":"rossella-o"},"change_message_id":"b15d440cebbb715e1e7e1fadba2d6b4873b99316","unresolved":false,"context_lines":[{"line_number":27,"context_line":"LOG \u003d logging.getLogger(__name__)"},{"line_number":28,"context_line":""},{"line_number":29,"context_line":""},{"line_number":30,"context_line":"class OVSTrunkDriver(base.TrunkAbstractDriver):"},{"line_number":31,"context_line":""},{"line_number":32,"context_line":"    def __init__(self):"},{"line_number":33,"context_line":"        super(OVSTrunkDriver, self).__init__()"}],"source_content_type":"text/x-python","patch_set":4,"id":"dada55a8_fb96894a","line":30,"in_reply_to":"dada55a8_c2a4d609","updated":"2016-07-26 15:54:06.000000000","message":"Done","commit_id":"7ed0415c52fd936013c6a8a2160f4739a81ba9c6"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"c16cde8c7d781a783d43ca4a21e29136baa03cbb","unresolved":false,"context_lines":[{"line_number":72,"context_line":"        #TODO(rossella_s): don\u0027t want to depend on"},{"line_number":73,"context_line":"        # https://review.openstack.org/#/c/339283 ,fix this when the patch"},{"line_number":74,"context_line":"        # merges"},{"line_number":75,"context_line":"        trunk \u003d self.trunk_rpc.get_trunk_by_port_id(iface_id)"},{"line_number":76,"context_line":""},{"line_number":77,"context_line":"        if trunk is None:"},{"line_number":78,"context_line":"            LOG.into(\"Port %s, has not trunk associated.\", iface_id)"}],"source_content_type":"text/x-python","patch_set":4,"id":"dada55a8_a2860211","line":75,"updated":"2016-07-23 05:18:27.000000000","message":"I would take these out and leave it to the caller of this module. I\u0027d like to separate the pure OVS logic from the orchestration one. In other words this module should only know how to interface itself with OVS, any communication that is required to/from the server should be encapsulated somewhere else. This way this module becomes reusable for both use cases, when subports are added/removed to a trunk, and when a trunk shows up for the first time on the host.","commit_id":"7ed0415c52fd936013c6a8a2160f4739a81ba9c6"},{"author":{"_account_id":6788,"name":"Rossella Sblendido","email":"rsblendido@suse.com","username":"rossella-o"},"change_message_id":"b15d440cebbb715e1e7e1fadba2d6b4873b99316","unresolved":false,"context_lines":[{"line_number":72,"context_line":"        #TODO(rossella_s): don\u0027t want to depend on"},{"line_number":73,"context_line":"        # https://review.openstack.org/#/c/339283 ,fix this when the patch"},{"line_number":74,"context_line":"        # merges"},{"line_number":75,"context_line":"        trunk \u003d self.trunk_rpc.get_trunk_by_port_id(iface_id)"},{"line_number":76,"context_line":""},{"line_number":77,"context_line":"        if trunk is None:"},{"line_number":78,"context_line":"            LOG.into(\"Port %s, has not trunk associated.\", iface_id)"}],"source_content_type":"text/x-python","patch_set":4,"id":"dada55a8_bba8918d","line":75,"in_reply_to":"dada55a8_a2860211","updated":"2016-07-26 15:54:06.000000000","message":"Done","commit_id":"7ed0415c52fd936013c6a8a2160f4739a81ba9c6"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"c16cde8c7d781a783d43ca4a21e29136baa03cbb","unresolved":false,"context_lines":[{"line_number":77,"context_line":"        if trunk is None:"},{"line_number":78,"context_line":"            LOG.into(\"Port %s, has not trunk associated.\", iface_id)"},{"line_number":79,"context_line":"            return"},{"line_number":80,"context_line":"        trunk_br_name \u003d self._gen_trunk_br_name(trunk[\u0027id\u0027])"},{"line_number":81,"context_line":""},{"line_number":82,"context_line":"        trunk_br \u003d ovs_lib.OVSBridge(trunk_br_name)"},{"line_number":83,"context_line":"        tp_patch_int, tp_patch_trunk \u003d self._gen_trunk_patch_names("}],"source_content_type":"text/x-python","patch_set":4,"id":"dada55a8_e278fa2d","line":80,"updated":"2016-07-23 05:18:27.000000000","message":"this should be extracted into a util function to be reused here and in [1] \n\n[1] https://review.openstack.org/#/c/343816/","commit_id":"7ed0415c52fd936013c6a8a2160f4739a81ba9c6"},{"author":{"_account_id":6788,"name":"Rossella Sblendido","email":"rsblendido@suse.com","username":"rossella-o"},"change_message_id":"b15d440cebbb715e1e7e1fadba2d6b4873b99316","unresolved":false,"context_lines":[{"line_number":77,"context_line":"        if trunk is None:"},{"line_number":78,"context_line":"            LOG.into(\"Port %s, has not trunk associated.\", iface_id)"},{"line_number":79,"context_line":"            return"},{"line_number":80,"context_line":"        trunk_br_name \u003d self._gen_trunk_br_name(trunk[\u0027id\u0027])"},{"line_number":81,"context_line":""},{"line_number":82,"context_line":"        trunk_br \u003d ovs_lib.OVSBridge(trunk_br_name)"},{"line_number":83,"context_line":"        tp_patch_int, tp_patch_trunk \u003d self._gen_trunk_patch_names("}],"source_content_type":"text/x-python","patch_set":4,"id":"dada55a8_1bc39d58","line":80,"in_reply_to":"dada55a8_e278fa2d","updated":"2016-07-26 15:54:06.000000000","message":"Done","commit_id":"7ed0415c52fd936013c6a8a2160f4739a81ba9c6"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"c16cde8c7d781a783d43ca4a21e29136baa03cbb","unresolved":false,"context_lines":[{"line_number":93,"context_line":"                             (\u0027options\u0027, {\u0027peer\u0027: tp_patch_int})]"},{"line_number":94,"context_line":"        trunk_br.add_port(tp_patch_trunk, *patch_trunk_attrs)"},{"line_number":95,"context_line":""},{"line_number":96,"context_line":"        for subport in trunk.sub_ports:"},{"line_number":97,"context_line":"            self.create_subport(subport)"},{"line_number":98,"context_line":""},{"line_number":99,"context_line":"        #TODO(rossella_s) do we need to define a call to set trunk up and"}],"source_content_type":"text/x-python","patch_set":4,"id":"dada55a8_42ad8687","line":96,"updated":"2016-07-23 05:18:27.000000000","message":"this should be done by the caller, ie. a component that is building the trunk based on whether the event is Neutron Server or OVSDB Server initiated. By splitting this logic out this component becomes more reusable.","commit_id":"7ed0415c52fd936013c6a8a2160f4739a81ba9c6"},{"author":{"_account_id":6788,"name":"Rossella Sblendido","email":"rsblendido@suse.com","username":"rossella-o"},"change_message_id":"b15d440cebbb715e1e7e1fadba2d6b4873b99316","unresolved":false,"context_lines":[{"line_number":93,"context_line":"                             (\u0027options\u0027, {\u0027peer\u0027: tp_patch_int})]"},{"line_number":94,"context_line":"        trunk_br.add_port(tp_patch_trunk, *patch_trunk_attrs)"},{"line_number":95,"context_line":""},{"line_number":96,"context_line":"        for subport in trunk.sub_ports:"},{"line_number":97,"context_line":"            self.create_subport(subport)"},{"line_number":98,"context_line":""},{"line_number":99,"context_line":"        #TODO(rossella_s) do we need to define a call to set trunk up and"}],"source_content_type":"text/x-python","patch_set":4,"id":"dada55a8_1b9a7d6e","line":96,"in_reply_to":"dada55a8_42ad8687","updated":"2016-07-26 15:54:06.000000000","message":"Done","commit_id":"7ed0415c52fd936013c6a8a2160f4739a81ba9c6"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"c16cde8c7d781a783d43ca4a21e29136baa03cbb","unresolved":false,"context_lines":[{"line_number":100,"context_line":"        # down in the trunk rpc? in that case the parent port status"},{"line_number":101,"context_line":"        # should be handled there, otherwise we need to use the ml2 plugin"},{"line_number":102,"context_line":"        # rpc here"},{"line_number":103,"context_line":"        self.trunk_rpc.set_trunk_up(trunk[\u0027id\u0027])"},{"line_number":104,"context_line":"        LOG.info(_LI(\"Added trunk : %s\"), trunk[\u0027id\u0027])"},{"line_number":105,"context_line":""},{"line_number":106,"context_line":"    def create_subport(self, sub_port):"}],"source_content_type":"text/x-python","patch_set":4,"id":"dada55a8_62e1aad0","line":103,"updated":"2016-07-23 05:18:27.000000000","message":"This is best extracted and handled elsewhere, another thing we need to implement is binding the subports to the host so that host-to-host tunnels are set up. At this point we just handled the local wiring, ie. we created the local trunk, but tunnels to/from hosts where VMs located on the networks being trunked are yet to be setup. Hence it\u0027s best to separate the logic to avoid this method to blow up into a 1000+ lines of code.","commit_id":"7ed0415c52fd936013c6a8a2160f4739a81ba9c6"},{"author":{"_account_id":6788,"name":"Rossella Sblendido","email":"rsblendido@suse.com","username":"rossella-o"},"change_message_id":"b15d440cebbb715e1e7e1fadba2d6b4873b99316","unresolved":false,"context_lines":[{"line_number":100,"context_line":"        # down in the trunk rpc? in that case the parent port status"},{"line_number":101,"context_line":"        # should be handled there, otherwise we need to use the ml2 plugin"},{"line_number":102,"context_line":"        # rpc here"},{"line_number":103,"context_line":"        self.trunk_rpc.set_trunk_up(trunk[\u0027id\u0027])"},{"line_number":104,"context_line":"        LOG.info(_LI(\"Added trunk : %s\"), trunk[\u0027id\u0027])"},{"line_number":105,"context_line":""},{"line_number":106,"context_line":"    def create_subport(self, sub_port):"}],"source_content_type":"text/x-python","patch_set":4,"id":"dada55a8_7b89f925","line":103,"in_reply_to":"dada55a8_62e1aad0","updated":"2016-07-26 15:54:06.000000000","message":"Done","commit_id":"7ed0415c52fd936013c6a8a2160f4739a81ba9c6"},{"author":{"_account_id":4187,"name":"Ryan Tidwell","email":"rtidwell@suse.com","username":"ryan-tidwell"},"change_message_id":"ee917dbbc3f0849c0f302a5195fbdc2f6bdf643c","unresolved":false,"context_lines":[{"line_number":100,"context_line":"        # down in the trunk rpc? in that case the parent port status"},{"line_number":101,"context_line":"        # should be handled there, otherwise we need to use the ml2 plugin"},{"line_number":102,"context_line":"        # rpc here"},{"line_number":103,"context_line":"        self.trunk_rpc.set_trunk_up(trunk[\u0027id\u0027])"},{"line_number":104,"context_line":"        LOG.info(_LI(\"Added trunk : %s\"), trunk[\u0027id\u0027])"},{"line_number":105,"context_line":""},{"line_number":106,"context_line":"    def create_subport(self, sub_port):"}],"source_content_type":"text/x-python","patch_set":4,"id":"dada55a8_5b77fa9e","line":103,"in_reply_to":"dada55a8_62e1aad0","updated":"2016-07-25 19:13:14.000000000","message":"Perhaps emit registry events instead?","commit_id":"7ed0415c52fd936013c6a8a2160f4739a81ba9c6"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"c16cde8c7d781a783d43ca4a21e29136baa03cbb","unresolved":false,"context_lines":[{"line_number":157,"context_line":"        trunk_br_name \u003d self._gen_trunk_br_name(trunk_port[\u0027id\u0027])"},{"line_number":158,"context_line":"        trunk_br \u003d ovs_lib.OVSBridge(trunk_br_name)"},{"line_number":159,"context_line":"        trunk_br.destroy()"},{"line_number":160,"context_line":"        self.trunk_rpc.set_trunk_down(trunk_port[\u0027id\u0027])"},{"line_number":161,"context_line":""},{"line_number":162,"context_line":"    def add_sub_port(self, resource, event, trigger, sub_port):"},{"line_number":163,"context_line":"        #TODO(rossella_s): next patch will take care of this"}],"source_content_type":"text/x-python","patch_set":4,"id":"dada55a8_c2afb67b","line":160,"updated":"2016-07-23 05:18:27.000000000","message":"as hinted earlier we should decouple the RPC logic from the local OVS logic these way the component becomes more reusable.","commit_id":"7ed0415c52fd936013c6a8a2160f4739a81ba9c6"},{"author":{"_account_id":6788,"name":"Rossella Sblendido","email":"rsblendido@suse.com","username":"rossella-o"},"change_message_id":"b15d440cebbb715e1e7e1fadba2d6b4873b99316","unresolved":false,"context_lines":[{"line_number":157,"context_line":"        trunk_br_name \u003d self._gen_trunk_br_name(trunk_port[\u0027id\u0027])"},{"line_number":158,"context_line":"        trunk_br \u003d ovs_lib.OVSBridge(trunk_br_name)"},{"line_number":159,"context_line":"        trunk_br.destroy()"},{"line_number":160,"context_line":"        self.trunk_rpc.set_trunk_down(trunk_port[\u0027id\u0027])"},{"line_number":161,"context_line":""},{"line_number":162,"context_line":"    def add_sub_port(self, resource, event, trigger, sub_port):"},{"line_number":163,"context_line":"        #TODO(rossella_s): next patch will take care of this"}],"source_content_type":"text/x-python","patch_set":4,"id":"dada55a8_db7aa523","line":160,"in_reply_to":"dada55a8_1b30e2e7","updated":"2016-07-26 15:54:06.000000000","message":"Done","commit_id":"7ed0415c52fd936013c6a8a2160f4739a81ba9c6"},{"author":{"_account_id":4187,"name":"Ryan Tidwell","email":"rtidwell@suse.com","username":"ryan-tidwell"},"change_message_id":"ee917dbbc3f0849c0f302a5195fbdc2f6bdf643c","unresolved":false,"context_lines":[{"line_number":157,"context_line":"        trunk_br_name \u003d self._gen_trunk_br_name(trunk_port[\u0027id\u0027])"},{"line_number":158,"context_line":"        trunk_br \u003d ovs_lib.OVSBridge(trunk_br_name)"},{"line_number":159,"context_line":"        trunk_br.destroy()"},{"line_number":160,"context_line":"        self.trunk_rpc.set_trunk_down(trunk_port[\u0027id\u0027])"},{"line_number":161,"context_line":""},{"line_number":162,"context_line":"    def add_sub_port(self, resource, event, trigger, sub_port):"},{"line_number":163,"context_line":"        #TODO(rossella_s): next patch will take care of this"}],"source_content_type":"text/x-python","patch_set":4,"id":"dada55a8_1b30e2e7","line":160,"in_reply_to":"dada55a8_c2afb67b","updated":"2016-07-25 19:13:14.000000000","message":"So, emit a registry event here instead of invoking the RPC directly?","commit_id":"7ed0415c52fd936013c6a8a2160f4739a81ba9c6"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"c16cde8c7d781a783d43ca4a21e29136baa03cbb","unresolved":false,"context_lines":[{"line_number":159,"context_line":"        trunk_br.destroy()"},{"line_number":160,"context_line":"        self.trunk_rpc.set_trunk_down(trunk_port[\u0027id\u0027])"},{"line_number":161,"context_line":""},{"line_number":162,"context_line":"    def add_sub_port(self, resource, event, trigger, sub_port):"},{"line_number":163,"context_line":"        #TODO(rossella_s): next patch will take care of this"},{"line_number":164,"context_line":"        # here we need to add a check to be sure that the VM was spawned, that"},{"line_number":165,"context_line":"        # is check that the trunk bridge exists. If not we discard this"}],"source_content_type":"text/x-python","patch_set":4,"id":"dada55a8_62ba4ac2","line":162,"updated":"2016-07-23 05:18:27.000000000","message":"If this method ends up calling create_subport, I believe it does not belong here, in that all we want this module to be is to deal with OVS alone.","commit_id":"7ed0415c52fd936013c6a8a2160f4739a81ba9c6"},{"author":{"_account_id":6788,"name":"Rossella Sblendido","email":"rsblendido@suse.com","username":"rossella-o"},"change_message_id":"b15d440cebbb715e1e7e1fadba2d6b4873b99316","unresolved":false,"context_lines":[{"line_number":159,"context_line":"        trunk_br.destroy()"},{"line_number":160,"context_line":"        self.trunk_rpc.set_trunk_down(trunk_port[\u0027id\u0027])"},{"line_number":161,"context_line":""},{"line_number":162,"context_line":"    def add_sub_port(self, resource, event, trigger, sub_port):"},{"line_number":163,"context_line":"        #TODO(rossella_s): next patch will take care of this"},{"line_number":164,"context_line":"        # here we need to add a check to be sure that the VM was spawned, that"},{"line_number":165,"context_line":"        # is check that the trunk bridge exists. If not we discard this"}],"source_content_type":"text/x-python","patch_set":4,"id":"dada55a8_3b74a134","line":162,"in_reply_to":"dada55a8_62ba4ac2","updated":"2016-07-26 15:54:06.000000000","message":"Done","commit_id":"7ed0415c52fd936013c6a8a2160f4739a81ba9c6"},{"author":{"_account_id":4187,"name":"Ryan Tidwell","email":"rtidwell@suse.com","username":"ryan-tidwell"},"change_message_id":"ee917dbbc3f0849c0f302a5195fbdc2f6bdf643c","unresolved":false,"context_lines":[{"line_number":159,"context_line":"        trunk_br.destroy()"},{"line_number":160,"context_line":"        self.trunk_rpc.set_trunk_down(trunk_port[\u0027id\u0027])"},{"line_number":161,"context_line":""},{"line_number":162,"context_line":"    def add_sub_port(self, resource, event, trigger, sub_port):"},{"line_number":163,"context_line":"        #TODO(rossella_s): next patch will take care of this"},{"line_number":164,"context_line":"        # here we need to add a check to be sure that the VM was spawned, that"},{"line_number":165,"context_line":"        # is check that the trunk bridge exists. If not we discard this"}],"source_content_type":"text/x-python","patch_set":4,"id":"dada55a8_bb127660","line":162,"in_reply_to":"dada55a8_62ba4ac2","updated":"2016-07-25 19:13:14.000000000","message":"I think we\u0027re on the same page. I was envisioning create_subport being invoked on a registry notification. This method would be moved out of this module and put in the agent-side RPC module (agent extension, or whatever form it takes).","commit_id":"7ed0415c52fd936013c6a8a2160f4739a81ba9c6"}],"neutron/services/trunk/drivers/openvswitch/agent/trunk_manager.py":[{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"b4c1806d6cd0a5ec5f86603abb7721ecd52078c5","unresolved":false,"context_lines":[{"line_number":18,"context_line":"from neutron.common import utils"},{"line_number":19,"context_line":""},{"line_number":20,"context_line":"# TODO(rossella_s): move these to constants"},{"line_number":21,"context_line":"TRUNK_DEV \u003d \u0027tp\u0027"},{"line_number":22,"context_line":"SUBPORT_DEV \u003d \u0027sp\u0027"},{"line_number":23,"context_line":""},{"line_number":24,"context_line":"LOG \u003d logging.getLogger(__name__)"}],"source_content_type":"text/x-python","patch_set":5,"id":"bacf61ea_bead8d33","line":21,"updated":"2016-07-28 06:41:48.000000000","message":"under neutron/services/trunk/constants?","commit_id":"3d189a30dddfc973d5c17256b8eadb5e023f57a7"},{"author":{"_account_id":6788,"name":"Rossella Sblendido","email":"rsblendido@suse.com","username":"rossella-o"},"change_message_id":"4bcb77aece66470194c9c0e7f2705d8190975da4","unresolved":false,"context_lines":[{"line_number":18,"context_line":"from neutron.common import utils"},{"line_number":19,"context_line":""},{"line_number":20,"context_line":"# TODO(rossella_s): move these to constants"},{"line_number":21,"context_line":"TRUNK_DEV \u003d \u0027tp\u0027"},{"line_number":22,"context_line":"SUBPORT_DEV \u003d \u0027sp\u0027"},{"line_number":23,"context_line":""},{"line_number":24,"context_line":"LOG \u003d logging.getLogger(__name__)"}],"source_content_type":"text/x-python","patch_set":5,"id":"bacf61ea_72cc4f6a","line":21,"in_reply_to":"bacf61ea_bead8d33","updated":"2016-08-01 13:33:50.000000000","message":"actually after splitting the code I think they are used only here, I will remove the TODO and move them to constants only when needed","commit_id":"3d189a30dddfc973d5c17256b8eadb5e023f57a7"},{"author":{"_account_id":11604,"name":"sean mooney","email":"smooney@redhat.com","username":"sean-k-mooney"},"change_message_id":"785f639aa76a96fd50edb007a3fbce003937b219","unresolved":false,"context_lines":[{"line_number":28,"context_line":""},{"line_number":29,"context_line":"    def __init__(self):"},{"line_number":30,"context_line":"        super(TrunkManager, self).__init__()"},{"line_number":31,"context_line":"        # TODO(rossella_s) find a smart way of getting br-int, or use the conf"},{"line_number":32,"context_line":"        # file"},{"line_number":33,"context_line":"        self.br_int \u003d None"},{"line_number":34,"context_line":""},{"line_number":35,"context_line":"    def create_trunk(self, trunk, lvid):"}],"source_content_type":"text/x-python","patch_set":5,"id":"dada55a8_c000c9ad","line":32,"range":{"start_line":31,"start_character":7,"end_line":32,"end_character":14},"updated":"2016-07-27 00:12:51.000000000","message":"reading from the conf file is probably fine but could you just\npass an instance of the conf from the neutron agent class when this calss is instantiated.","commit_id":"3d189a30dddfc973d5c17256b8eadb5e023f57a7"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"b4c1806d6cd0a5ec5f86603abb7721ecd52078c5","unresolved":false,"context_lines":[{"line_number":32,"context_line":"        # file"},{"line_number":33,"context_line":"        self.br_int \u003d None"},{"line_number":34,"context_line":""},{"line_number":35,"context_line":"    def create_trunk(self, trunk, lvid):"},{"line_number":36,"context_line":"        trunk_br_name \u003d self._gen_trunk_br_name(trunk[\u0027id\u0027])"},{"line_number":37,"context_line":""},{"line_number":38,"context_line":"        trunk_br \u003d ovs_lib.OVSBridge(trunk_br_name)"}],"source_content_type":"text/x-python","patch_set":5,"id":"bacf61ea_9e6d2907","line":35,"updated":"2016-07-28 06:41:48.000000000","message":"docstrings? That said, how do you think lvid is going to be supplied? I wonder if this method should be just setting up the parent port.","commit_id":"3d189a30dddfc973d5c17256b8eadb5e023f57a7"},{"author":{"_account_id":6788,"name":"Rossella Sblendido","email":"rsblendido@suse.com","username":"rossella-o"},"change_message_id":"4bcb77aece66470194c9c0e7f2705d8190975da4","unresolved":false,"context_lines":[{"line_number":32,"context_line":"        # file"},{"line_number":33,"context_line":"        self.br_int \u003d None"},{"line_number":34,"context_line":""},{"line_number":35,"context_line":"    def create_trunk(self, trunk, lvid):"},{"line_number":36,"context_line":"        trunk_br_name \u003d self._gen_trunk_br_name(trunk[\u0027id\u0027])"},{"line_number":37,"context_line":""},{"line_number":38,"context_line":"        trunk_br \u003d ovs_lib.OVSBridge(trunk_br_name)"}],"source_content_type":"text/x-python","patch_set":5,"id":"bacf61ea_d20a5b89","line":35,"in_reply_to":"bacf61ea_9e6d2907","updated":"2016-08-01 13:33:50.000000000","message":"the lvid is going to be supplied by the caller of this method. Agreed regarding dealing only with the parent port","commit_id":"3d189a30dddfc973d5c17256b8eadb5e023f57a7"},{"author":{"_account_id":11604,"name":"sean mooney","email":"smooney@redhat.com","username":"sean-k-mooney"},"change_message_id":"785f639aa76a96fd50edb007a3fbce003937b219","unresolved":false,"context_lines":[{"line_number":41,"context_line":"        # NOTE(rossella_s): the ovs agent won\u0027t process the port if it has"},{"line_number":42,"context_line":"        # no external_ids so these ports won\u0027t be considere in the agent"},{"line_number":43,"context_line":"        # main loop"},{"line_number":44,"context_line":"        patch_int_attrs \u003d [(\u0027type\u0027, \u0027patch\u0027),"},{"line_number":45,"context_line":"                           (\u0027options\u0027, {\u0027peer\u0027: tp_patch_trunk})]"},{"line_number":46,"context_line":"        self.br_int.add_port(tp_patch_int, *patch_int_attrs)"},{"line_number":47,"context_line":""},{"line_number":48,"context_line":"        # set the local vlan id of the network on the br-int patch port"},{"line_number":49,"context_line":"        self.br_int.set_db_attribute(\"Port\", tp_patch_int, \"tag\", lvid)"}],"source_content_type":"text/x-python","patch_set":5,"id":"dada55a8_607abd25","line":46,"range":{"start_line":44,"start_character":7,"end_line":46,"end_character":60},"updated":"2016-07-27 00:12:51.000000000","message":"you could just use self.br_int.add_patch_port instead\nhttps://github.com/openstack/neutron/blob/master/neutron/agent/common/ovs_lib.py#L368-L371","commit_id":"3d189a30dddfc973d5c17256b8eadb5e023f57a7"},{"author":{"_account_id":6788,"name":"Rossella Sblendido","email":"rsblendido@suse.com","username":"rossella-o"},"change_message_id":"4bcb77aece66470194c9c0e7f2705d8190975da4","unresolved":false,"context_lines":[{"line_number":41,"context_line":"        # NOTE(rossella_s): the ovs agent won\u0027t process the port if it has"},{"line_number":42,"context_line":"        # no external_ids so these ports won\u0027t be considere in the agent"},{"line_number":43,"context_line":"        # main loop"},{"line_number":44,"context_line":"        patch_int_attrs \u003d [(\u0027type\u0027, \u0027patch\u0027),"},{"line_number":45,"context_line":"                           (\u0027options\u0027, {\u0027peer\u0027: tp_patch_trunk})]"},{"line_number":46,"context_line":"        self.br_int.add_port(tp_patch_int, *patch_int_attrs)"},{"line_number":47,"context_line":""},{"line_number":48,"context_line":"        # set the local vlan id of the network on the br-int patch port"},{"line_number":49,"context_line":"        self.br_int.set_db_attribute(\"Port\", tp_patch_int, \"tag\", lvid)"}],"source_content_type":"text/x-python","patch_set":5,"id":"bacf61ea_15fcd66e","line":46,"range":{"start_line":44,"start_character":7,"end_line":46,"end_character":60},"in_reply_to":"dada55a8_607abd25","updated":"2016-08-01 13:33:50.000000000","message":"Done","commit_id":"3d189a30dddfc973d5c17256b8eadb5e023f57a7"},{"author":{"_account_id":7787,"name":"Kevin Benton","email":"kevin@benton.pub","username":"blak111"},"change_message_id":"7c36bf8ab5fcbbd749be96b4afac66b61da5cb1e","unresolved":false,"context_lines":[{"line_number":46,"context_line":"        self.br_int.add_port(tp_patch_int, *patch_int_attrs)"},{"line_number":47,"context_line":""},{"line_number":48,"context_line":"        # set the local vlan id of the network on the br-int patch port"},{"line_number":49,"context_line":"        self.br_int.set_db_attribute(\"Port\", tp_patch_int, \"tag\", lvid)"},{"line_number":50,"context_line":""},{"line_number":51,"context_line":"        patch_trunk_attrs \u003d [(\u0027type\u0027, \u0027patch\u0027),"},{"line_number":52,"context_line":"                             (\u0027options\u0027, {\u0027peer\u0027: tp_patch_int})]"}],"source_content_type":"text/x-python","patch_set":5,"id":"bacf61ea_05180cd2","line":49,"updated":"2016-08-01 22:38:01.000000000","message":"aloha! This shouldn\u0027t be necessary. It\u0027s just like when a VM port is plugged in and it doesn\u0027t have a vlan tag set. The agent loop will find it an treat it as a new port, at which point it will do it\u0027s standard get_device_details, get the network, allocate a local vlan tag, and set the local vlan itself. So the trunk manager doesn\u0027t have to concern itself with those details. It\u0027s a manager, it delegates. :)","commit_id":"3d189a30dddfc973d5c17256b8eadb5e023f57a7"},{"author":{"_account_id":6788,"name":"Rossella Sblendido","email":"rsblendido@suse.com","username":"rossella-o"},"change_message_id":"7c2935c4a99fa7b0a63257a8155efe9ad83c2155","unresolved":false,"context_lines":[{"line_number":46,"context_line":"        self.br_int.add_port(tp_patch_int, *patch_int_attrs)"},{"line_number":47,"context_line":""},{"line_number":48,"context_line":"        # set the local vlan id of the network on the br-int patch port"},{"line_number":49,"context_line":"        self.br_int.set_db_attribute(\"Port\", tp_patch_int, \"tag\", lvid)"},{"line_number":50,"context_line":""},{"line_number":51,"context_line":"        patch_trunk_attrs \u003d [(\u0027type\u0027, \u0027patch\u0027),"},{"line_number":52,"context_line":"                             (\u0027options\u0027, {\u0027peer\u0027: tp_patch_int})]"}],"source_content_type":"text/x-python","patch_set":5,"id":"bacf61ea_ddf17d6c","line":49,"in_reply_to":"bacf61ea_05180cd2","updated":"2016-08-02 16:04:33.000000000","message":"hey Kevin, the agent loop ignores these interfaces, see lines 41. That was done on purpose, to keep the trunk processing separated and avoid regressions.","commit_id":"3d189a30dddfc973d5c17256b8eadb5e023f57a7"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"bb6cabfa2538255c0ef020317860c88b8503358b","unresolved":false,"context_lines":[{"line_number":46,"context_line":"        self.br_int.add_port(tp_patch_int, *patch_int_attrs)"},{"line_number":47,"context_line":""},{"line_number":48,"context_line":"        # set the local vlan id of the network on the br-int patch port"},{"line_number":49,"context_line":"        self.br_int.set_db_attribute(\"Port\", tp_patch_int, \"tag\", lvid)"},{"line_number":50,"context_line":""},{"line_number":51,"context_line":"        patch_trunk_attrs \u003d [(\u0027type\u0027, \u0027patch\u0027),"},{"line_number":52,"context_line":"                             (\u0027options\u0027, {\u0027peer\u0027: tp_patch_int})]"}],"source_content_type":"text/x-python","patch_set":5,"id":"bacf61ea_79ce8fb5","line":49,"in_reply_to":"bacf61ea_ddf17d6c","updated":"2016-08-03 02:26:22.000000000","message":"So, I think here we have two strategies laid out ahead of us based on two premises:\n\nA) A subport is just like a regular port, and as such it will never need to be treated differently, EVER. Under this premise, delegation would be justified. With this strategy the trunk component could create the patch port into br-int with external-ids(iface-id, iface-status, and attached-macs), and have the OVS agent pick it up and do its thing. If in the future, we end up finding ourselves in a position where subports do need to be treated specially, then we would be in a bit of a jam because there\u0027s no strong contractual agreement between trunk manager and the ovs agent and we might potentially add more technical debt to the mix, unless we step back and redesign. That\u0027s a position I\u0027d rather not be in, but Kevin seems adamant that this is never going to happen.\n\nB) A subport might or might not be a regular port, and we\u0027d want to give ourselves the opportunity to put the trunk manager in the position of dictating how the subport wiring is done. We currently don\u0027t have a strong API in the OVS agent to do that, and in order to achieve this goal we would need to pay some technical debt now, in the hope that it can be beneficial in the future, should the use case arise. Paying technical debt now can slow us down because we effectively need to think harder about the interfaces required between the trunk component and the other OVS components and how they need to collaborate in order to provide a complete L2 wiring setup, including DVR flows, security groups, spoofing rules, etc. If the use case does not arise (premise A), we may have made the trunk component overblown for nothing. This is the position I have been leaning towards and the direction Rossella\u0027s patch is going. It assumes that by means of a stronger contractual agreement across the various components, there\u0027s a smaller change of unexpected regressions should one logic or the other require to evolve.\n\nBoth A and B are sensible approaches in my view, and both have pros and cons. The choice of one over the other is made on how risk averse one wants to be. Option A seems easier to attain in the short term, while Option B requires more work in the long run, and it forces us to explicitly document the things we know won\u0027t work with trunks and OVS right out of the box (e.g. security groups?)\n\nPerhaps we can go down path B for a tad farther just to see how deep the hole is and decide to fall back on path A, if we do end up meeting the white rabbit.\n\nThoughts?","commit_id":"3d189a30dddfc973d5c17256b8eadb5e023f57a7"},{"author":{"_account_id":11604,"name":"sean mooney","email":"smooney@redhat.com","username":"sean-k-mooney"},"change_message_id":"785f639aa76a96fd50edb007a3fbce003937b219","unresolved":false,"context_lines":[{"line_number":48,"context_line":"        # set the local vlan id of the network on the br-int patch port"},{"line_number":49,"context_line":"        self.br_int.set_db_attribute(\"Port\", tp_patch_int, \"tag\", lvid)"},{"line_number":50,"context_line":""},{"line_number":51,"context_line":"        patch_trunk_attrs \u003d [(\u0027type\u0027, \u0027patch\u0027),"},{"line_number":52,"context_line":"                             (\u0027options\u0027, {\u0027peer\u0027: tp_patch_int})]"},{"line_number":53,"context_line":"        trunk_br.add_port(tp_patch_trunk, *patch_trunk_attrs)"},{"line_number":54,"context_line":""},{"line_number":55,"context_line":"        trunk_br_name \u003d utils.gen_trunk_br_name(trunk[\u0027id\u0027])"},{"line_number":56,"context_line":"        trunk_br \u003d ovs_lib.OVSBridge(trunk_br_name)"}],"source_content_type":"text/x-python","patch_set":5,"id":"dada55a8_a0be75ab","line":53,"range":{"start_line":51,"start_character":8,"end_line":53,"end_character":61},"updated":"2016-07-27 00:12:51.000000000","message":"same as above\ntrunk_br.add_patch_port(...)","commit_id":"3d189a30dddfc973d5c17256b8eadb5e023f57a7"},{"author":{"_account_id":6788,"name":"Rossella Sblendido","email":"rsblendido@suse.com","username":"rossella-o"},"change_message_id":"4bcb77aece66470194c9c0e7f2705d8190975da4","unresolved":false,"context_lines":[{"line_number":48,"context_line":"        # set the local vlan id of the network on the br-int patch port"},{"line_number":49,"context_line":"        self.br_int.set_db_attribute(\"Port\", tp_patch_int, \"tag\", lvid)"},{"line_number":50,"context_line":""},{"line_number":51,"context_line":"        patch_trunk_attrs \u003d [(\u0027type\u0027, \u0027patch\u0027),"},{"line_number":52,"context_line":"                             (\u0027options\u0027, {\u0027peer\u0027: tp_patch_int})]"},{"line_number":53,"context_line":"        trunk_br.add_port(tp_patch_trunk, *patch_trunk_attrs)"},{"line_number":54,"context_line":""},{"line_number":55,"context_line":"        trunk_br_name \u003d utils.gen_trunk_br_name(trunk[\u0027id\u0027])"},{"line_number":56,"context_line":"        trunk_br \u003d ovs_lib.OVSBridge(trunk_br_name)"}],"source_content_type":"text/x-python","patch_set":5,"id":"bacf61ea_35ed9ab7","line":53,"range":{"start_line":51,"start_character":8,"end_line":53,"end_character":61},"in_reply_to":"dada55a8_a0be75ab","updated":"2016-08-01 13:33:50.000000000","message":"Done","commit_id":"3d189a30dddfc973d5c17256b8eadb5e023f57a7"},{"author":{"_account_id":11604,"name":"sean mooney","email":"smooney@redhat.com","username":"sean-k-mooney"},"change_message_id":"785f639aa76a96fd50edb007a3fbce003937b219","unresolved":false,"context_lines":[{"line_number":52,"context_line":"                             (\u0027options\u0027, {\u0027peer\u0027: tp_patch_int})]"},{"line_number":53,"context_line":"        trunk_br.add_port(tp_patch_trunk, *patch_trunk_attrs)"},{"line_number":54,"context_line":""},{"line_number":55,"context_line":"        trunk_br_name \u003d utils.gen_trunk_br_name(trunk[\u0027id\u0027])"},{"line_number":56,"context_line":"        trunk_br \u003d ovs_lib.OVSBridge(trunk_br_name)"},{"line_number":57,"context_line":""},{"line_number":58,"context_line":"        for subport in trunk.sub_ports:"},{"line_number":59,"context_line":"            self._create_subport(subport, trunk_br)"}],"source_content_type":"text/x-python","patch_set":5,"id":"dada55a8_4032195f","line":56,"range":{"start_line":55,"start_character":8,"end_line":56,"end_character":51},"updated":"2016-07-27 00:12:51.000000000","message":"this is not needed as it is calulated on line 36-38","commit_id":"3d189a30dddfc973d5c17256b8eadb5e023f57a7"},{"author":{"_account_id":6788,"name":"Rossella Sblendido","email":"rsblendido@suse.com","username":"rossella-o"},"change_message_id":"4bcb77aece66470194c9c0e7f2705d8190975da4","unresolved":false,"context_lines":[{"line_number":52,"context_line":"                             (\u0027options\u0027, {\u0027peer\u0027: tp_patch_int})]"},{"line_number":53,"context_line":"        trunk_br.add_port(tp_patch_trunk, *patch_trunk_attrs)"},{"line_number":54,"context_line":""},{"line_number":55,"context_line":"        trunk_br_name \u003d utils.gen_trunk_br_name(trunk[\u0027id\u0027])"},{"line_number":56,"context_line":"        trunk_br \u003d ovs_lib.OVSBridge(trunk_br_name)"},{"line_number":57,"context_line":""},{"line_number":58,"context_line":"        for subport in trunk.sub_ports:"},{"line_number":59,"context_line":"            self._create_subport(subport, trunk_br)"}],"source_content_type":"text/x-python","patch_set":5,"id":"bacf61ea_00765e6f","line":56,"range":{"start_line":55,"start_character":8,"end_line":56,"end_character":51},"in_reply_to":"dada55a8_4032195f","updated":"2016-08-01 13:33:50.000000000","message":"Done","commit_id":"3d189a30dddfc973d5c17256b8eadb5e023f57a7"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"b4c1806d6cd0a5ec5f86603abb7721ecd52078c5","unresolved":false,"context_lines":[{"line_number":55,"context_line":"        trunk_br_name \u003d utils.gen_trunk_br_name(trunk[\u0027id\u0027])"},{"line_number":56,"context_line":"        trunk_br \u003d ovs_lib.OVSBridge(trunk_br_name)"},{"line_number":57,"context_line":""},{"line_number":58,"context_line":"        for subport in trunk.sub_ports:"},{"line_number":59,"context_line":"            self._create_subport(subport, trunk_br)"},{"line_number":60,"context_line":""},{"line_number":61,"context_line":"    def _create_subport(self, sub_port, trunk_br, lvid):"}],"source_content_type":"text/x-python","patch_set":5,"id":"bacf61ea_b93e47b6","line":58,"updated":"2016-07-28 06:41:48.000000000","message":"I wonder if error handling could be handled more effectively by the caller if we left the caller to use the add_subport/remove_sub_port primitives. In other words leave this loop to the caller. Thoughts?","commit_id":"3d189a30dddfc973d5c17256b8eadb5e023f57a7"},{"author":{"_account_id":6788,"name":"Rossella Sblendido","email":"rsblendido@suse.com","username":"rossella-o"},"change_message_id":"4bcb77aece66470194c9c0e7f2705d8190975da4","unresolved":false,"context_lines":[{"line_number":55,"context_line":"        trunk_br_name \u003d utils.gen_trunk_br_name(trunk[\u0027id\u0027])"},{"line_number":56,"context_line":"        trunk_br \u003d ovs_lib.OVSBridge(trunk_br_name)"},{"line_number":57,"context_line":""},{"line_number":58,"context_line":"        for subport in trunk.sub_ports:"},{"line_number":59,"context_line":"            self._create_subport(subport, trunk_br)"},{"line_number":60,"context_line":""},{"line_number":61,"context_line":"    def _create_subport(self, sub_port, trunk_br, lvid):"}],"source_content_type":"text/x-python","patch_set":5,"id":"bacf61ea_7531d259","line":58,"in_reply_to":"bacf61ea_b93e47b6","updated":"2016-08-01 13:33:50.000000000","message":"Done","commit_id":"3d189a30dddfc973d5c17256b8eadb5e023f57a7"},{"author":{"_account_id":11604,"name":"sean mooney","email":"smooney@redhat.com","username":"sean-k-mooney"},"change_message_id":"785f639aa76a96fd50edb007a3fbce003937b219","unresolved":false,"context_lines":[{"line_number":64,"context_line":"            sub_port[\u0027port_id\u0027])"},{"line_number":65,"context_line":""},{"line_number":66,"context_line":"        # add patch port to br-int"},{"line_number":67,"context_line":"        int_patch_attrs \u003d [(\u0027type\u0027, \u0027patch\u0027),"},{"line_number":68,"context_line":"                           (\u0027options\u0027, {\u0027peer\u0027: tbr_patch_port})]"},{"line_number":69,"context_line":"        self.br_int.add_port(int_patch_port, *int_patch_attrs)"},{"line_number":70,"context_line":"        self.br_int.set_db_attribute(\"Port\", int_patch_port, \"tag\", lvid)"},{"line_number":71,"context_line":""},{"line_number":72,"context_line":"        # add patch port to trunk bridge"}],"source_content_type":"text/x-python","patch_set":5,"id":"dada55a8_007ae1f0","line":69,"range":{"start_line":67,"start_character":7,"end_line":69,"end_character":62},"updated":"2016-07-27 00:12:51.000000000","message":"same as above you can use add_patch_port which as you have done on line 73","commit_id":"3d189a30dddfc973d5c17256b8eadb5e023f57a7"},{"author":{"_account_id":6788,"name":"Rossella Sblendido","email":"rsblendido@suse.com","username":"rossella-o"},"change_message_id":"4bcb77aece66470194c9c0e7f2705d8190975da4","unresolved":false,"context_lines":[{"line_number":64,"context_line":"            sub_port[\u0027port_id\u0027])"},{"line_number":65,"context_line":""},{"line_number":66,"context_line":"        # add patch port to br-int"},{"line_number":67,"context_line":"        int_patch_attrs \u003d [(\u0027type\u0027, \u0027patch\u0027),"},{"line_number":68,"context_line":"                           (\u0027options\u0027, {\u0027peer\u0027: tbr_patch_port})]"},{"line_number":69,"context_line":"        self.br_int.add_port(int_patch_port, *int_patch_attrs)"},{"line_number":70,"context_line":"        self.br_int.set_db_attribute(\"Port\", int_patch_port, \"tag\", lvid)"},{"line_number":71,"context_line":""},{"line_number":72,"context_line":"        # add patch port to trunk bridge"}],"source_content_type":"text/x-python","patch_set":5,"id":"bacf61ea_152a16db","line":69,"range":{"start_line":67,"start_character":7,"end_line":69,"end_character":62},"in_reply_to":"dada55a8_007ae1f0","updated":"2016-08-01 13:33:50.000000000","message":"Done","commit_id":"3d189a30dddfc973d5c17256b8eadb5e023f57a7"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"b4c1806d6cd0a5ec5f86603abb7721ecd52078c5","unresolved":false,"context_lines":[{"line_number":78,"context_line":"        LOG.info(_LI(\"Added subport: %s\") % sub_port)"},{"line_number":79,"context_line":""},{"line_number":80,"context_line":"    @staticmethod"},{"line_number":81,"context_line":"    def _gen_trunk_patch_names(port_id):"},{"line_number":82,"context_line":"        return ("},{"line_number":83,"context_line":"            (TRUNK_DEV + \u0027-int-\u0027 + port_id)["},{"line_number":84,"context_line":"                :constants.DEVICE_NAME_MAX_LEN - 1],"}],"source_content_type":"text/x-python","patch_set":5,"id":"bacf61ea_f95f1f0c","line":81,"updated":"2016-07-28 06:41:48.000000000","message":"I\u0027d move these into the util module so that they are all closer together.","commit_id":"3d189a30dddfc973d5c17256b8eadb5e023f57a7"},{"author":{"_account_id":6788,"name":"Rossella Sblendido","email":"rsblendido@suse.com","username":"rossella-o"},"change_message_id":"4bcb77aece66470194c9c0e7f2705d8190975da4","unresolved":false,"context_lines":[{"line_number":78,"context_line":"        LOG.info(_LI(\"Added subport: %s\") % sub_port)"},{"line_number":79,"context_line":""},{"line_number":80,"context_line":"    @staticmethod"},{"line_number":81,"context_line":"    def _gen_trunk_patch_names(port_id):"},{"line_number":82,"context_line":"        return ("},{"line_number":83,"context_line":"            (TRUNK_DEV + \u0027-int-\u0027 + port_id)["},{"line_number":84,"context_line":"                :constants.DEVICE_NAME_MAX_LEN - 1],"}],"source_content_type":"text/x-python","patch_set":5,"id":"bacf61ea_d5599e8f","line":81,"in_reply_to":"bacf61ea_f95f1f0c","updated":"2016-08-01 13:33:50.000000000","message":"but these methods are meant to be used only by this class","commit_id":"3d189a30dddfc973d5c17256b8eadb5e023f57a7"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"6cb0397ea61885338013352dbaa344d61a71138a","unresolved":false,"context_lines":[{"line_number":17,"context_line":"from neutron.agent.common import ovs_lib"},{"line_number":18,"context_line":"from neutron.services.trunk import utils"},{"line_number":19,"context_line":""},{"line_number":20,"context_line":"TRUNK_DEV \u003d \u0027tp\u0027"},{"line_number":21,"context_line":"SUBPORT_DEV \u003d \u0027sp\u0027"},{"line_number":22,"context_line":""},{"line_number":23,"context_line":"LOG \u003d logging.getLogger(__name__)"}],"source_content_type":"text/x-python","patch_set":6,"id":"bacf61ea_6f409336","line":20,"updated":"2016-08-02 18:34:12.000000000","message":"is it worth adding a comment to explain what these are for? If we added a lookup map PORT_TYPE -\u003e PORT_PREFIX (see comment below). I think this is slightly more readable.","commit_id":"6749f8b6596d83411dababcaffd1871340ac5963"},{"author":{"_account_id":6788,"name":"Rossella Sblendido","email":"rsblendido@suse.com","username":"rossella-o"},"change_message_id":"1cdf8ac83b4041bbe378bb937bfb09f27c0b3fdb","unresolved":false,"context_lines":[{"line_number":17,"context_line":"from neutron.agent.common import ovs_lib"},{"line_number":18,"context_line":"from neutron.services.trunk import utils"},{"line_number":19,"context_line":""},{"line_number":20,"context_line":"TRUNK_DEV \u003d \u0027tp\u0027"},{"line_number":21,"context_line":"SUBPORT_DEV \u003d \u0027sp\u0027"},{"line_number":22,"context_line":""},{"line_number":23,"context_line":"LOG \u003d logging.getLogger(__name__)"}],"source_content_type":"text/x-python","patch_set":6,"id":"bacf61ea_11fd7c3b","line":20,"in_reply_to":"bacf61ea_6f409336","updated":"2016-08-03 18:25:27.000000000","message":"if you feel strongly for the lookup map I will add it but I think it\u0027s a bit too much for 2 values","commit_id":"6749f8b6596d83411dababcaffd1871340ac5963"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"6cb0397ea61885338013352dbaa344d61a71138a","unresolved":false,"context_lines":[{"line_number":26,"context_line":"class TrunkManager(object):"},{"line_number":27,"context_line":""},{"line_number":28,"context_line":"    def __init__(self, br_int):"},{"line_number":29,"context_line":"        super(TrunkManager, self).__init__()"},{"line_number":30,"context_line":"        self.br_int \u003d br_int"},{"line_number":31,"context_line":""},{"line_number":32,"context_line":"    def create_trunk(self, trunk, lvid):"}],"source_content_type":"text/x-python","patch_set":6,"id":"bacf61ea_cf509f0d","line":29,"updated":"2016-08-02 18:34:12.000000000","message":"there\u0027s no base object, what\u0027s this for?","commit_id":"6749f8b6596d83411dababcaffd1871340ac5963"},{"author":{"_account_id":6788,"name":"Rossella Sblendido","email":"rsblendido@suse.com","username":"rossella-o"},"change_message_id":"1cdf8ac83b4041bbe378bb937bfb09f27c0b3fdb","unresolved":false,"context_lines":[{"line_number":26,"context_line":"class TrunkManager(object):"},{"line_number":27,"context_line":""},{"line_number":28,"context_line":"    def __init__(self, br_int):"},{"line_number":29,"context_line":"        super(TrunkManager, self).__init__()"},{"line_number":30,"context_line":"        self.br_int \u003d br_int"},{"line_number":31,"context_line":""},{"line_number":32,"context_line":"    def create_trunk(self, trunk, lvid):"}],"source_content_type":"text/x-python","patch_set":6,"id":"bacf61ea_56e08a96","line":29,"in_reply_to":"bacf61ea_cf509f0d","updated":"2016-08-03 18:25:27.000000000","message":"Done","commit_id":"6749f8b6596d83411dababcaffd1871340ac5963"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"6cb0397ea61885338013352dbaa344d61a71138a","unresolved":false,"context_lines":[{"line_number":32,"context_line":"    def create_trunk(self, trunk, lvid):"},{"line_number":33,"context_line":"        \"\"\"Create the trunk port"},{"line_number":34,"context_line":""},{"line_number":35,"context_line":"        @param trunk: trunk to be created"},{"line_number":36,"context_line":"        @param lvid: local VLAN IDs used by the OVS agent for the network the"},{"line_number":37,"context_line":"            trunk is on"},{"line_number":38,"context_line":""}],"source_content_type":"text/x-python","patch_set":6,"id":"bacf61ea_afb8cb2b","line":35,"updated":"2016-08-02 18:34:12.000000000","message":"is this meant to contain all of the trunk details (e.g. parent port + subport details)? If all you need is the trunk ID and the parent port ID, wouldn\u0027t be more readable to pass those instead?","commit_id":"6749f8b6596d83411dababcaffd1871340ac5963"},{"author":{"_account_id":6788,"name":"Rossella Sblendido","email":"rsblendido@suse.com","username":"rossella-o"},"change_message_id":"1cdf8ac83b4041bbe378bb937bfb09f27c0b3fdb","unresolved":false,"context_lines":[{"line_number":32,"context_line":"    def create_trunk(self, trunk, lvid):"},{"line_number":33,"context_line":"        \"\"\"Create the trunk port"},{"line_number":34,"context_line":""},{"line_number":35,"context_line":"        @param trunk: trunk to be created"},{"line_number":36,"context_line":"        @param lvid: local VLAN IDs used by the OVS agent for the network the"},{"line_number":37,"context_line":"            trunk is on"},{"line_number":38,"context_line":""}],"source_content_type":"text/x-python","patch_set":6,"id":"bacf61ea_f6e7fea9","line":35,"in_reply_to":"bacf61ea_afb8cb2b","updated":"2016-08-03 18:25:27.000000000","message":"Done","commit_id":"6749f8b6596d83411dababcaffd1871340ac5963"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"6cb0397ea61885338013352dbaa344d61a71138a","unresolved":false,"context_lines":[{"line_number":37,"context_line":"            trunk is on"},{"line_number":38,"context_line":""},{"line_number":39,"context_line":"        \"\"\""},{"line_number":40,"context_line":"        trunk_br_name \u003d utils.gen_trunk_br_name(trunk[\u0027id\u0027])"},{"line_number":41,"context_line":""},{"line_number":42,"context_line":"        trunk_br \u003d ovs_lib.OVSBridge(trunk_br_name)"},{"line_number":43,"context_line":"        tp_patch_int, tp_patch_trunk \u003d self._gen_trunk_patch_names("}],"source_content_type":"text/x-python","patch_set":6,"id":"bacf61ea_a153bf6b","line":40,"updated":"2016-08-02 18:34:12.000000000","message":"are you sure this is the trunk ID and not the parent port id? The signature for gen_trunk_br_name() takes the parent port ID","commit_id":"6749f8b6596d83411dababcaffd1871340ac5963"},{"author":{"_account_id":6788,"name":"Rossella Sblendido","email":"rsblendido@suse.com","username":"rossella-o"},"change_message_id":"1cdf8ac83b4041bbe378bb937bfb09f27c0b3fdb","unresolved":false,"context_lines":[{"line_number":37,"context_line":"            trunk is on"},{"line_number":38,"context_line":""},{"line_number":39,"context_line":"        \"\"\""},{"line_number":40,"context_line":"        trunk_br_name \u003d utils.gen_trunk_br_name(trunk[\u0027id\u0027])"},{"line_number":41,"context_line":""},{"line_number":42,"context_line":"        trunk_br \u003d ovs_lib.OVSBridge(trunk_br_name)"},{"line_number":43,"context_line":"        tp_patch_int, tp_patch_trunk \u003d self._gen_trunk_patch_names("}],"source_content_type":"text/x-python","patch_set":6,"id":"bacf61ea_11d8dc7e","line":40,"in_reply_to":"bacf61ea_a153bf6b","updated":"2016-08-03 18:25:27.000000000","message":"I think it\u0027s easier to use the trunk_id, I will change the signature","commit_id":"6749f8b6596d83411dababcaffd1871340ac5963"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"6cb0397ea61885338013352dbaa344d61a71138a","unresolved":false,"context_lines":[{"line_number":39,"context_line":"        \"\"\""},{"line_number":40,"context_line":"        trunk_br_name \u003d utils.gen_trunk_br_name(trunk[\u0027id\u0027])"},{"line_number":41,"context_line":""},{"line_number":42,"context_line":"        trunk_br \u003d ovs_lib.OVSBridge(trunk_br_name)"},{"line_number":43,"context_line":"        tp_patch_int, tp_patch_trunk \u003d self._gen_trunk_patch_names("},{"line_number":44,"context_line":"            trunk[\u0027port_id\u0027])"},{"line_number":45,"context_line":"        # NOTE(rossella_s): the ovs agent won\u0027t process the port if it has"}],"source_content_type":"text/x-python","patch_set":6,"id":"bacf61ea_a41f4d08","line":42,"updated":"2016-08-02 18:34:12.000000000","message":"should we check that the bridge exists first?","commit_id":"6749f8b6596d83411dababcaffd1871340ac5963"},{"author":{"_account_id":6788,"name":"Rossella Sblendido","email":"rsblendido@suse.com","username":"rossella-o"},"change_message_id":"1cdf8ac83b4041bbe378bb937bfb09f27c0b3fdb","unresolved":false,"context_lines":[{"line_number":39,"context_line":"        \"\"\""},{"line_number":40,"context_line":"        trunk_br_name \u003d utils.gen_trunk_br_name(trunk[\u0027id\u0027])"},{"line_number":41,"context_line":""},{"line_number":42,"context_line":"        trunk_br \u003d ovs_lib.OVSBridge(trunk_br_name)"},{"line_number":43,"context_line":"        tp_patch_int, tp_patch_trunk \u003d self._gen_trunk_patch_names("},{"line_number":44,"context_line":"            trunk[\u0027port_id\u0027])"},{"line_number":45,"context_line":"        # NOTE(rossella_s): the ovs agent won\u0027t process the port if it has"}],"source_content_type":"text/x-python","patch_set":6,"id":"bacf61ea_31952040","line":42,"in_reply_to":"bacf61ea_a41f4d08","updated":"2016-08-03 18:25:27.000000000","message":"Done","commit_id":"6749f8b6596d83411dababcaffd1871340ac5963"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"6cb0397ea61885338013352dbaa344d61a71138a","unresolved":false,"context_lines":[{"line_number":43,"context_line":"        tp_patch_int, tp_patch_trunk \u003d self._gen_trunk_patch_names("},{"line_number":44,"context_line":"            trunk[\u0027port_id\u0027])"},{"line_number":45,"context_line":"        # NOTE(rossella_s): the ovs agent won\u0027t process the port if it has"},{"line_number":46,"context_line":"        # no external_ids so these ports won\u0027t be considere in the agent"},{"line_number":47,"context_line":"        # main loop"},{"line_number":48,"context_line":"        self.br_int.add_patch_port(tp_patch_int, tp_patch_trunk)"},{"line_number":49,"context_line":""}],"source_content_type":"text/x-python","patch_set":6,"id":"bacf61ea_cfca5f1a","line":46,"updated":"2016-08-02 18:34:12.000000000","message":"considered","commit_id":"6749f8b6596d83411dababcaffd1871340ac5963"},{"author":{"_account_id":6788,"name":"Rossella Sblendido","email":"rsblendido@suse.com","username":"rossella-o"},"change_message_id":"1cdf8ac83b4041bbe378bb937bfb09f27c0b3fdb","unresolved":false,"context_lines":[{"line_number":43,"context_line":"        tp_patch_int, tp_patch_trunk \u003d self._gen_trunk_patch_names("},{"line_number":44,"context_line":"            trunk[\u0027port_id\u0027])"},{"line_number":45,"context_line":"        # NOTE(rossella_s): the ovs agent won\u0027t process the port if it has"},{"line_number":46,"context_line":"        # no external_ids so these ports won\u0027t be considere in the agent"},{"line_number":47,"context_line":"        # main loop"},{"line_number":48,"context_line":"        self.br_int.add_patch_port(tp_patch_int, tp_patch_trunk)"},{"line_number":49,"context_line":""}],"source_content_type":"text/x-python","patch_set":6,"id":"bacf61ea_568ecad0","line":46,"in_reply_to":"bacf61ea_cfca5f1a","updated":"2016-08-03 18:25:27.000000000","message":"Done","commit_id":"6749f8b6596d83411dababcaffd1871340ac5963"},{"author":{"_account_id":4187,"name":"Ryan Tidwell","email":"rtidwell@suse.com","username":"ryan-tidwell"},"change_message_id":"bf969bb722911740b9b5631181b79553fb302757","unresolved":false,"context_lines":[{"line_number":47,"context_line":"        # main loop"},{"line_number":48,"context_line":"        self.br_int.add_patch_port(tp_patch_int, tp_patch_trunk)"},{"line_number":49,"context_line":""},{"line_number":50,"context_line":"        self.br_int.set_db_attribute(\"Port\", tp_patch_int, \"tag\", lvid)"},{"line_number":51,"context_line":""},{"line_number":52,"context_line":"        trunk_br.add_patch_port(tp_patch_trunk, tp_patch_int)"},{"line_number":53,"context_line":""}],"source_content_type":"text/x-python","patch_set":6,"id":"bacf61ea_771ce513","line":50,"range":{"start_line":50,"start_character":8,"end_line":50,"end_character":71},"updated":"2016-08-02 18:48:08.000000000","message":"Should we also be setting the vlan mode on these ports as well?","commit_id":"6749f8b6596d83411dababcaffd1871340ac5963"},{"author":{"_account_id":6788,"name":"Rossella Sblendido","email":"rsblendido@suse.com","username":"rossella-o"},"change_message_id":"1cdf8ac83b4041bbe378bb937bfb09f27c0b3fdb","unresolved":false,"context_lines":[{"line_number":47,"context_line":"        # main loop"},{"line_number":48,"context_line":"        self.br_int.add_patch_port(tp_patch_int, tp_patch_trunk)"},{"line_number":49,"context_line":""},{"line_number":50,"context_line":"        self.br_int.set_db_attribute(\"Port\", tp_patch_int, \"tag\", lvid)"},{"line_number":51,"context_line":""},{"line_number":52,"context_line":"        trunk_br.add_patch_port(tp_patch_trunk, tp_patch_int)"},{"line_number":53,"context_line":""}],"source_content_type":"text/x-python","patch_set":6,"id":"bacf61ea_51a53445","line":50,"range":{"start_line":50,"start_character":8,"end_line":50,"end_character":71},"in_reply_to":"bacf61ea_771ce513","updated":"2016-08-03 18:25:27.000000000","message":"trunk mode is the default","commit_id":"6749f8b6596d83411dababcaffd1871340ac5963"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"6cb0397ea61885338013352dbaa344d61a71138a","unresolved":false,"context_lines":[{"line_number":51,"context_line":""},{"line_number":52,"context_line":"        trunk_br.add_patch_port(tp_patch_trunk, tp_patch_int)"},{"line_number":53,"context_line":""},{"line_number":54,"context_line":"    def _create_subport(self, sub_port, trunk_br, lvid):"},{"line_number":55,"context_line":"        \"\"\"Create the trunk port"},{"line_number":56,"context_line":""},{"line_number":57,"context_line":"        @param sub_port: sub_port to be created"}],"source_content_type":"text/x-python","patch_set":6,"id":"bacf61ea_a4674de9","line":54,"updated":"2016-08-02 18:34:12.000000000","message":"I wonder whether we shall pass sub_port_id and the segmentation details separately for more readability.","commit_id":"6749f8b6596d83411dababcaffd1871340ac5963"},{"author":{"_account_id":6788,"name":"Rossella Sblendido","email":"rsblendido@suse.com","username":"rossella-o"},"change_message_id":"1cdf8ac83b4041bbe378bb937bfb09f27c0b3fdb","unresolved":false,"context_lines":[{"line_number":51,"context_line":""},{"line_number":52,"context_line":"        trunk_br.add_patch_port(tp_patch_trunk, tp_patch_int)"},{"line_number":53,"context_line":""},{"line_number":54,"context_line":"    def _create_subport(self, sub_port, trunk_br, lvid):"},{"line_number":55,"context_line":"        \"\"\"Create the trunk port"},{"line_number":56,"context_line":""},{"line_number":57,"context_line":"        @param sub_port: sub_port to be created"}],"source_content_type":"text/x-python","patch_set":6,"id":"bacf61ea_91f04c68","line":54,"in_reply_to":"bacf61ea_a4674de9","updated":"2016-08-03 18:25:27.000000000","message":"I removed this method","commit_id":"6749f8b6596d83411dababcaffd1871340ac5963"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"6cb0397ea61885338013352dbaa344d61a71138a","unresolved":false,"context_lines":[{"line_number":61,"context_line":""},{"line_number":62,"context_line":"        \"\"\""},{"line_number":63,"context_line":""},{"line_number":64,"context_line":"        int_patch_port, tbr_patch_port \u003d self._gen_subport_patch_names("},{"line_number":65,"context_line":"            sub_port[\u0027port_id\u0027])"},{"line_number":66,"context_line":""},{"line_number":67,"context_line":"        # add patch port to br-int"}],"source_content_type":"text/x-python","patch_set":6,"id":"bacf61ea_249a3dc6","line":64,"updated":"2016-08-02 18:34:12.000000000","message":"see comment about _gen_subport_patch_names and refactor (if you agree :))","commit_id":"6749f8b6596d83411dababcaffd1871340ac5963"},{"author":{"_account_id":6788,"name":"Rossella Sblendido","email":"rsblendido@suse.com","username":"rossella-o"},"change_message_id":"1cdf8ac83b4041bbe378bb937bfb09f27c0b3fdb","unresolved":false,"context_lines":[{"line_number":61,"context_line":""},{"line_number":62,"context_line":"        \"\"\""},{"line_number":63,"context_line":""},{"line_number":64,"context_line":"        int_patch_port, tbr_patch_port \u003d self._gen_subport_patch_names("},{"line_number":65,"context_line":"            sub_port[\u0027port_id\u0027])"},{"line_number":66,"context_line":""},{"line_number":67,"context_line":"        # add patch port to br-int"}],"source_content_type":"text/x-python","patch_set":6,"id":"bacf61ea_31db60ef","line":64,"in_reply_to":"bacf61ea_249a3dc6","updated":"2016-08-03 18:25:27.000000000","message":"Done","commit_id":"6749f8b6596d83411dababcaffd1871340ac5963"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"6cb0397ea61885338013352dbaa344d61a71138a","unresolved":false,"context_lines":[{"line_number":66,"context_line":""},{"line_number":67,"context_line":"        # add patch port to br-int"},{"line_number":68,"context_line":"        self.br_int.add_patch_port(int_patch_port, tbr_patch_port)"},{"line_number":69,"context_line":"        self.br_int.set_db_attribute(\"Port\", int_patch_port, \"tag\", lvid)"},{"line_number":70,"context_line":""},{"line_number":71,"context_line":"        # add patch port to trunk bridge"},{"line_number":72,"context_line":"        trunk_br.add_patch_port(tbr_patch_port, int_patch_port)"}],"source_content_type":"text/x-python","patch_set":6,"id":"bacf61ea_6459d58e","line":69,"updated":"2016-08-02 18:34:12.000000000","message":"I wonder if this line and line 50 should be extracted and left to the caller. We could add a method that takes the following arguments: port type, port_id as well as the column and value to be set on the integration bridge. Then we can defer whether or not this extra setup step is necessary for the trunk setup. That should help us isolate changes in the coordination logic between the OVS agent and the Trunk manager, and who needs to do what.","commit_id":"6749f8b6596d83411dababcaffd1871340ac5963"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"6fe77c0c96968079d77bb505fc6f4e20bdebc6f6","unresolved":false,"context_lines":[{"line_number":66,"context_line":""},{"line_number":67,"context_line":"        # add patch port to br-int"},{"line_number":68,"context_line":"        self.br_int.add_patch_port(int_patch_port, tbr_patch_port)"},{"line_number":69,"context_line":"        self.br_int.set_db_attribute(\"Port\", int_patch_port, \"tag\", lvid)"},{"line_number":70,"context_line":""},{"line_number":71,"context_line":"        # add patch port to trunk bridge"},{"line_number":72,"context_line":"        trunk_br.add_patch_port(tbr_patch_port, int_patch_port)"}],"source_content_type":"text/x-python","patch_set":6,"id":"bacf61ea_b7c01d2c","line":69,"in_reply_to":"bacf61ea_6459d58e","updated":"2016-08-02 18:55:30.000000000","message":"Thinking again about this, another benefit of extracting this db_attribute_set is to have the option of making the subport picked up by the agent (it\u0027s an option we might not want to take, but having the option is good nonetheless) by marking the port with the magic cookie external_ids/iface-id.\n\nThe trunk logic would stay unchanged whether or the option is used.","commit_id":"6749f8b6596d83411dababcaffd1871340ac5963"},{"author":{"_account_id":6788,"name":"Rossella Sblendido","email":"rsblendido@suse.com","username":"rossella-o"},"change_message_id":"1cdf8ac83b4041bbe378bb937bfb09f27c0b3fdb","unresolved":false,"context_lines":[{"line_number":66,"context_line":""},{"line_number":67,"context_line":"        # add patch port to br-int"},{"line_number":68,"context_line":"        self.br_int.add_patch_port(int_patch_port, tbr_patch_port)"},{"line_number":69,"context_line":"        self.br_int.set_db_attribute(\"Port\", int_patch_port, \"tag\", lvid)"},{"line_number":70,"context_line":""},{"line_number":71,"context_line":"        # add patch port to trunk bridge"},{"line_number":72,"context_line":"        trunk_br.add_patch_port(tbr_patch_port, int_patch_port)"}],"source_content_type":"text/x-python","patch_set":6,"id":"bacf61ea_d1f5a4ed","line":69,"in_reply_to":"bacf61ea_7e3f95d6","updated":"2016-08-03 18:25:27.000000000","message":"so for now I will leave it as it is","commit_id":"6749f8b6596d83411dababcaffd1871340ac5963"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"91c8a9faf3e317b9f72640cee000d83662c18e29","unresolved":false,"context_lines":[{"line_number":66,"context_line":""},{"line_number":67,"context_line":"        # add patch port to br-int"},{"line_number":68,"context_line":"        self.br_int.add_patch_port(int_patch_port, tbr_patch_port)"},{"line_number":69,"context_line":"        self.br_int.set_db_attribute(\"Port\", int_patch_port, \"tag\", lvid)"},{"line_number":70,"context_line":""},{"line_number":71,"context_line":"        # add patch port to trunk bridge"},{"line_number":72,"context_line":"        trunk_br.add_patch_port(tbr_patch_port, int_patch_port)"}],"source_content_type":"text/x-python","patch_set":6,"id":"bacf61ea_7e3f95d6","line":69,"in_reply_to":"bacf61ea_b7c01d2c","updated":"2016-08-03 01:52:51.000000000","message":"This is predicated on the fact that OVS would be able to notice the state change and react to it in its main loop, otherwise, we might need to tweak the method signature to pass more subport data and have port creation with metadata happen atomically.","commit_id":"6749f8b6596d83411dababcaffd1871340ac5963"},{"author":{"_account_id":4187,"name":"Ryan Tidwell","email":"rtidwell@suse.com","username":"ryan-tidwell"},"change_message_id":"bf969bb722911740b9b5631181b79553fb302757","unresolved":false,"context_lines":[{"line_number":72,"context_line":"        trunk_br.add_patch_port(tbr_patch_port, int_patch_port)"},{"line_number":73,"context_line":""},{"line_number":74,"context_line":"        # set tag\u003d\u003csegmentation_id\u003e on trunk bridge patch port"},{"line_number":75,"context_line":"        trunk_br.set_db_attribute(\"Port\", tbr_patch_port,"},{"line_number":76,"context_line":"                                  \"tag\", sub_port[\u0027segmentation_id\u0027])"},{"line_number":77,"context_line":"        LOG.info(_LI(\"Added subport: %s\"), sub_port)"},{"line_number":78,"context_line":""},{"line_number":79,"context_line":"    @staticmethod"}],"source_content_type":"text/x-python","patch_set":6,"id":"bacf61ea_17d2c934","line":76,"range":{"start_line":75,"start_character":8,"end_line":76,"end_character":69},"updated":"2016-08-02 18:48:08.000000000","message":"See comments at L50","commit_id":"6749f8b6596d83411dababcaffd1871340ac5963"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"6cb0397ea61885338013352dbaa344d61a71138a","unresolved":false,"context_lines":[{"line_number":77,"context_line":"        LOG.info(_LI(\"Added subport: %s\"), sub_port)"},{"line_number":78,"context_line":""},{"line_number":79,"context_line":"    @staticmethod"},{"line_number":80,"context_line":"    def _gen_trunk_patch_names(port_id):"},{"line_number":81,"context_line":"        return ("},{"line_number":82,"context_line":"            (TRUNK_DEV + \u0027-int-\u0027 + port_id)["},{"line_number":83,"context_line":"                :constants.DEVICE_NAME_MAX_LEN - 1],"}],"source_content_type":"text/x-python","patch_set":6,"id":"bacf61ea_4f730fe8","line":80,"updated":"2016-08-02 18:34:12.000000000","message":"can we add docstrings here? This is returning the names of the ports for the trunk bridge and integration bridge side for the port id.\n\nHowever, if you passed the prefix, this can be a single method. ie.\n\n  def get_ovs_port_names(port_type, port_id):\n    \"\"\"Return the OVS port names for the given port.\n\n    The ports are the ones that plumb into the integration bridge and\n    trunk bridge respectively.\n    \"\"\"\n    # Have a lookup map port_type -\u003e port_prefix and then do\n    return (\n            (port_prefixes[port_type] + \u0027-int-\u0027 + port_id)[\n                :constants.DEVICE_NAME_MAX_LEN - 1],\n            (port_prefixes[port_type] + \u0027-trunk\u0027 + port_id)[\n                :constants.DEVICE_NAME_MAX_LEN - 1])\n\nHaving said that, do we want to get these closer to the other one in the utils module, and perhaps break it down into two separate methods? One that returns the OVS port name for the br-int side and one that returns the OVS port name for the trunk bridge side? I think it would improve readability.","commit_id":"6749f8b6596d83411dababcaffd1871340ac5963"},{"author":{"_account_id":6788,"name":"Rossella Sblendido","email":"rsblendido@suse.com","username":"rossella-o"},"change_message_id":"1cdf8ac83b4041bbe378bb937bfb09f27c0b3fdb","unresolved":false,"context_lines":[{"line_number":77,"context_line":"        LOG.info(_LI(\"Added subport: %s\"), sub_port)"},{"line_number":78,"context_line":""},{"line_number":79,"context_line":"    @staticmethod"},{"line_number":80,"context_line":"    def _gen_trunk_patch_names(port_id):"},{"line_number":81,"context_line":"        return ("},{"line_number":82,"context_line":"            (TRUNK_DEV + \u0027-int-\u0027 + port_id)["},{"line_number":83,"context_line":"                :constants.DEVICE_NAME_MAX_LEN - 1],"}],"source_content_type":"text/x-python","patch_set":6,"id":"bacf61ea_b1c63014","line":80,"in_reply_to":"bacf61ea_4f730fe8","updated":"2016-08-03 18:25:27.000000000","message":"I didn\u0027t use the lookup map, it seemed an overkill for 2 values but I modified the rest","commit_id":"6749f8b6596d83411dababcaffd1871340ac5963"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"6cb0397ea61885338013352dbaa344d61a71138a","unresolved":false,"context_lines":[{"line_number":85,"context_line":"                :constants.DEVICE_NAME_MAX_LEN - 1])"},{"line_number":86,"context_line":""},{"line_number":87,"context_line":"    @staticmethod"},{"line_number":88,"context_line":"    def _gen_subport_patch_names(port_id):"},{"line_number":89,"context_line":"        return ("},{"line_number":90,"context_line":"            (SUBPORT_DEV + \u0027-int-\u0027 + port_id)["},{"line_number":91,"context_line":"                :constants.DEVICE_NAME_MAX_LEN - 1],"}],"source_content_type":"text/x-python","patch_set":6,"id":"bacf61ea_415be32e","line":88,"updated":"2016-08-02 18:34:12.000000000","message":"Then you don\u0027t need this one.","commit_id":"6749f8b6596d83411dababcaffd1871340ac5963"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"6cb0397ea61885338013352dbaa344d61a71138a","unresolved":false,"context_lines":[{"line_number":96,"context_line":"        # TODO(rossella_s) handle resync"},{"line_number":97,"context_line":"        pass"},{"line_number":98,"context_line":""},{"line_number":99,"context_line":"    def remove_trunk_port(self, trunk_port):"},{"line_number":100,"context_line":"        trunk_br_name \u003d utils.gen_trunk_br_name(trunk_port[\u0027id\u0027])"},{"line_number":101,"context_line":"        trunk_br \u003d ovs_lib.OVSBridge(trunk_br_name)"},{"line_number":102,"context_line":"        trunk_br.destroy()"}],"source_content_type":"text/x-python","patch_set":6,"id":"bacf61ea_41f763f5","line":99,"updated":"2016-08-02 18:34:12.000000000","message":"consider just passing parent_port_id instead. Add a docstring?","commit_id":"6749f8b6596d83411dababcaffd1871340ac5963"},{"author":{"_account_id":6788,"name":"Rossella Sblendido","email":"rsblendido@suse.com","username":"rossella-o"},"change_message_id":"1cdf8ac83b4041bbe378bb937bfb09f27c0b3fdb","unresolved":false,"context_lines":[{"line_number":96,"context_line":"        # TODO(rossella_s) handle resync"},{"line_number":97,"context_line":"        pass"},{"line_number":98,"context_line":""},{"line_number":99,"context_line":"    def remove_trunk_port(self, trunk_port):"},{"line_number":100,"context_line":"        trunk_br_name \u003d utils.gen_trunk_br_name(trunk_port[\u0027id\u0027])"},{"line_number":101,"context_line":"        trunk_br \u003d ovs_lib.OVSBridge(trunk_br_name)"},{"line_number":102,"context_line":"        trunk_br.destroy()"}],"source_content_type":"text/x-python","patch_set":6,"id":"bacf61ea_f659be8f","line":99,"in_reply_to":"bacf61ea_41f763f5","updated":"2016-08-03 18:25:27.000000000","message":"Done","commit_id":"6749f8b6596d83411dababcaffd1871340ac5963"},{"author":{"_account_id":4187,"name":"Ryan Tidwell","email":"rtidwell@suse.com","username":"ryan-tidwell"},"change_message_id":"bf969bb722911740b9b5631181b79553fb302757","unresolved":false,"context_lines":[{"line_number":101,"context_line":"        trunk_br \u003d ovs_lib.OVSBridge(trunk_br_name)"},{"line_number":102,"context_line":"        trunk_br.destroy()"},{"line_number":103,"context_line":""},{"line_number":104,"context_line":"    def add_sub_port(self, sub_port, lvid):"},{"line_number":105,"context_line":"        trunk_br_name \u003d utils.gen_trunk_br_name(sub_port[\u0027trunk_id\u0027])"},{"line_number":106,"context_line":"        if ovs_lib.BaseOVS().bridge_exists(trunk_br_name):"},{"line_number":107,"context_line":"            trunk_br \u003d ovs_lib.OVSBridge(trunk_br_name)"}],"source_content_type":"text/x-python","patch_set":6,"id":"bacf61ea_571f215b","line":104,"range":{"start_line":104,"start_character":37,"end_line":104,"end_character":41},"updated":"2016-08-02 18:48:08.000000000","message":"Where does lvid come from and how does the caller figure out what it should be?","commit_id":"6749f8b6596d83411dababcaffd1871340ac5963"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"6cb0397ea61885338013352dbaa344d61a71138a","unresolved":false,"context_lines":[{"line_number":101,"context_line":"        trunk_br \u003d ovs_lib.OVSBridge(trunk_br_name)"},{"line_number":102,"context_line":"        trunk_br.destroy()"},{"line_number":103,"context_line":""},{"line_number":104,"context_line":"    def add_sub_port(self, sub_port, lvid):"},{"line_number":105,"context_line":"        trunk_br_name \u003d utils.gen_trunk_br_name(sub_port[\u0027trunk_id\u0027])"},{"line_number":106,"context_line":"        if ovs_lib.BaseOVS().bridge_exists(trunk_br_name):"},{"line_number":107,"context_line":"            trunk_br \u003d ovs_lib.OVSBridge(trunk_br_name)"}],"source_content_type":"text/x-python","patch_set":6,"id":"bacf61ea_6140a708","line":104,"updated":"2016-08-02 18:34:12.000000000","message":"have you considered passing trunk_id and sub_port_id instead?","commit_id":"6749f8b6596d83411dababcaffd1871340ac5963"},{"author":{"_account_id":6788,"name":"Rossella Sblendido","email":"rsblendido@suse.com","username":"rossella-o"},"change_message_id":"1cdf8ac83b4041bbe378bb937bfb09f27c0b3fdb","unresolved":false,"context_lines":[{"line_number":101,"context_line":"        trunk_br \u003d ovs_lib.OVSBridge(trunk_br_name)"},{"line_number":102,"context_line":"        trunk_br.destroy()"},{"line_number":103,"context_line":""},{"line_number":104,"context_line":"    def add_sub_port(self, sub_port, lvid):"},{"line_number":105,"context_line":"        trunk_br_name \u003d utils.gen_trunk_br_name(sub_port[\u0027trunk_id\u0027])"},{"line_number":106,"context_line":"        if ovs_lib.BaseOVS().bridge_exists(trunk_br_name):"},{"line_number":107,"context_line":"            trunk_br \u003d ovs_lib.OVSBridge(trunk_br_name)"}],"source_content_type":"text/x-python","patch_set":6,"id":"bacf61ea_76202ef8","line":104,"range":{"start_line":104,"start_character":37,"end_line":104,"end_character":41},"in_reply_to":"bacf61ea_3710ada8","updated":"2016-08-03 18:25:27.000000000","message":"I think we need to expose it, otherwise we have to let the caller tag the ports.","commit_id":"6749f8b6596d83411dababcaffd1871340ac5963"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"6fe77c0c96968079d77bb505fc6f4e20bdebc6f6","unresolved":false,"context_lines":[{"line_number":101,"context_line":"        trunk_br \u003d ovs_lib.OVSBridge(trunk_br_name)"},{"line_number":102,"context_line":"        trunk_br.destroy()"},{"line_number":103,"context_line":""},{"line_number":104,"context_line":"    def add_sub_port(self, sub_port, lvid):"},{"line_number":105,"context_line":"        trunk_br_name \u003d utils.gen_trunk_br_name(sub_port[\u0027trunk_id\u0027])"},{"line_number":106,"context_line":"        if ovs_lib.BaseOVS().bridge_exists(trunk_br_name):"},{"line_number":107,"context_line":"            trunk_br \u003d ovs_lib.OVSBridge(trunk_br_name)"}],"source_content_type":"text/x-python","patch_set":6,"id":"bacf61ea_3710ada8","line":104,"range":{"start_line":104,"start_character":37,"end_line":104,"end_character":41},"in_reply_to":"bacf61ea_571f215b","updated":"2016-08-02 18:55:30.000000000","message":"You should find your answer in the base patch, but I am pondering whether we need to expose lvid to the trunk manager at all.","commit_id":"6749f8b6596d83411dababcaffd1871340ac5963"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"91c8a9faf3e317b9f72640cee000d83662c18e29","unresolved":false,"context_lines":[{"line_number":105,"context_line":"        trunk_br_name \u003d utils.gen_trunk_br_name(sub_port[\u0027trunk_id\u0027])"},{"line_number":106,"context_line":"        if ovs_lib.BaseOVS().bridge_exists(trunk_br_name):"},{"line_number":107,"context_line":"            trunk_br \u003d ovs_lib.OVSBridge(trunk_br_name)"},{"line_number":108,"context_line":"            self._create_subport(sub_port, trunk_br, lvid)"},{"line_number":109,"context_line":"        else:"},{"line_number":110,"context_line":"            # check that the VM was spawned, that is the trunk bridge"},{"line_number":111,"context_line":"            # exists. If not we discard this notification"}],"source_content_type":"text/x-python","patch_set":6,"id":"bacf61ea_9e8249c7","line":108,"updated":"2016-08-03 01:52:51.000000000","message":"for the depth of this method I am not sure the private helper is needed. Perhaps you can expand the code in here instead?","commit_id":"6749f8b6596d83411dababcaffd1871340ac5963"},{"author":{"_account_id":6788,"name":"Rossella Sblendido","email":"rsblendido@suse.com","username":"rossella-o"},"change_message_id":"1cdf8ac83b4041bbe378bb937bfb09f27c0b3fdb","unresolved":false,"context_lines":[{"line_number":105,"context_line":"        trunk_br_name \u003d utils.gen_trunk_br_name(sub_port[\u0027trunk_id\u0027])"},{"line_number":106,"context_line":"        if ovs_lib.BaseOVS().bridge_exists(trunk_br_name):"},{"line_number":107,"context_line":"            trunk_br \u003d ovs_lib.OVSBridge(trunk_br_name)"},{"line_number":108,"context_line":"            self._create_subport(sub_port, trunk_br, lvid)"},{"line_number":109,"context_line":"        else:"},{"line_number":110,"context_line":"            # check that the VM was spawned, that is the trunk bridge"},{"line_number":111,"context_line":"            # exists. If not we discard this notification"}],"source_content_type":"text/x-python","patch_set":6,"id":"bacf61ea_36d196fc","line":108,"in_reply_to":"bacf61ea_9e8249c7","updated":"2016-08-03 18:25:27.000000000","message":"Done","commit_id":"6749f8b6596d83411dababcaffd1871340ac5963"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"6cb0397ea61885338013352dbaa344d61a71138a","unresolved":false,"context_lines":[{"line_number":107,"context_line":"            trunk_br \u003d ovs_lib.OVSBridge(trunk_br_name)"},{"line_number":108,"context_line":"            self._create_subport(sub_port, trunk_br, lvid)"},{"line_number":109,"context_line":"        else:"},{"line_number":110,"context_line":"            # check that the VM was spawned, that is the trunk bridge"},{"line_number":111,"context_line":"            # exists. If not we discard this notification"},{"line_number":112,"context_line":"            # because the subport will be processed when the agent detects"},{"line_number":113,"context_line":"            # that the vif of the vm has been plugged in the trunk bridge"}],"source_content_type":"text/x-python","patch_set":6,"id":"bacf61ea_218eaf27","line":110,"updated":"2016-08-02 18:34:12.000000000","message":"Such condition can happen in this scenario:\n\na) user create a trunk with parent port\nb) user boots a VM\nc) user adds sub_ports shortly after\n\nAt this stage, the RPC handler (the component that is in charge or processing Neutron-server initiated events) may end up being called before the parent port shows up on the host. However the subports will be fetched as part of a trunk look up when the parent port does indeed show up on the host.\n\nIs this what you mean? If so, I wonder if we should expose a trunk_exist() method on this manager and have the caller have this checked instead, because an add_sub_port() that does nothing (and that\u0027s ok) does not feel right.\n\nThis should raise in my opinion if the trunk is missing.","commit_id":"6749f8b6596d83411dababcaffd1871340ac5963"},{"author":{"_account_id":6788,"name":"Rossella Sblendido","email":"rsblendido@suse.com","username":"rossella-o"},"change_message_id":"1cdf8ac83b4041bbe378bb937bfb09f27c0b3fdb","unresolved":false,"context_lines":[{"line_number":107,"context_line":"            trunk_br \u003d ovs_lib.OVSBridge(trunk_br_name)"},{"line_number":108,"context_line":"            self._create_subport(sub_port, trunk_br, lvid)"},{"line_number":109,"context_line":"        else:"},{"line_number":110,"context_line":"            # check that the VM was spawned, that is the trunk bridge"},{"line_number":111,"context_line":"            # exists. If not we discard this notification"},{"line_number":112,"context_line":"            # because the subport will be processed when the agent detects"},{"line_number":113,"context_line":"            # that the vif of the vm has been plugged in the trunk bridge"}],"source_content_type":"text/x-python","patch_set":6,"id":"bacf61ea_1677323c","line":110,"in_reply_to":"bacf61ea_218eaf27","updated":"2016-08-03 18:25:27.000000000","message":"good point!","commit_id":"6749f8b6596d83411dababcaffd1871340ac5963"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"6cb0397ea61885338013352dbaa344d61a71138a","unresolved":false,"context_lines":[{"line_number":116,"context_line":"                                            \u0027sp\u0027: sub_port})"},{"line_number":117,"context_line":""},{"line_number":118,"context_line":"    def remove_sub_port(self, sub_port):"},{"line_number":119,"context_line":"        trunk_br_name \u003d utils.gen_trunk_br_name(sub_port[\u0027trunk_id\u0027])"},{"line_number":120,"context_line":"        # no need to process this if the trunk bridge was deleted"},{"line_number":121,"context_line":"        if ovs_lib.BaseOVS.bridge_exists(trunk_br_name):"},{"line_number":122,"context_line":"            trunk_br \u003d ovs_lib.OVSBridge(trunk_br_name)"},{"line_number":123,"context_line":"            int_patch_port, tbr_patch_port \u003d self._gen_subport_patch_names("},{"line_number":124,"context_line":"                sub_port[\u0027port_id\u0027])"}],"source_content_type":"text/x-python","patch_set":6,"id":"bacf61ea_e1dad716","line":121,"range":{"start_line":119,"start_character":8,"end_line":121,"end_character":55},"updated":"2016-08-02 18:34:12.000000000","message":"wrap this into a trunk_exists() method that takes trunk_id and returns True if the OVS bridge exists.","commit_id":"6749f8b6596d83411dababcaffd1871340ac5963"},{"author":{"_account_id":6788,"name":"Rossella Sblendido","email":"rsblendido@suse.com","username":"rossella-o"},"change_message_id":"1cdf8ac83b4041bbe378bb937bfb09f27c0b3fdb","unresolved":false,"context_lines":[{"line_number":116,"context_line":"                                            \u0027sp\u0027: sub_port})"},{"line_number":117,"context_line":""},{"line_number":118,"context_line":"    def remove_sub_port(self, sub_port):"},{"line_number":119,"context_line":"        trunk_br_name \u003d utils.gen_trunk_br_name(sub_port[\u0027trunk_id\u0027])"},{"line_number":120,"context_line":"        # no need to process this if the trunk bridge was deleted"},{"line_number":121,"context_line":"        if ovs_lib.BaseOVS.bridge_exists(trunk_br_name):"},{"line_number":122,"context_line":"            trunk_br \u003d ovs_lib.OVSBridge(trunk_br_name)"},{"line_number":123,"context_line":"            int_patch_port, tbr_patch_port \u003d self._gen_subport_patch_names("},{"line_number":124,"context_line":"                sub_port[\u0027port_id\u0027])"}],"source_content_type":"text/x-python","patch_set":6,"id":"bacf61ea_f6affe7a","line":121,"range":{"start_line":119,"start_character":8,"end_line":121,"end_character":55},"in_reply_to":"bacf61ea_e1dad716","updated":"2016-08-03 18:25:27.000000000","message":"Done","commit_id":"6749f8b6596d83411dababcaffd1871340ac5963"},{"author":{"_account_id":16800,"name":"Rawlin Peters","email":"rawlin.peters@hpe.com","username":"rawlin"},"change_message_id":"c20ae644eeb67f88529ddd01e863b0d2d6a6138c","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":7,"id":"bacf61ea_4990ec4e","updated":"2016-08-03 19:18:37.000000000","message":"I\u0027m not sure how likely this is, but should we prepare for more segmentation_types in the future, like we did with server-side segmentation_id validation?\n\nOr, do we assume that a new segmentation_type might not even be usable with this \"trunk bridge\" approach and cross that bridge when we get to it?","commit_id":"2a853ddbcddc9c9f5058ff6dfc380d8611f64fba"},{"author":{"_account_id":4187,"name":"Ryan Tidwell","email":"rtidwell@suse.com","username":"ryan-tidwell"},"change_message_id":"e6429a82453a3a38ebe06935740e6097793c335c","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":7,"id":"bacf61ea_e949e08f","in_reply_to":"bacf61ea_4990ec4e","updated":"2016-08-03 19:44:40.000000000","message":"Ugh, let\u0027s cross that bridge when we get there :)","commit_id":"2a853ddbcddc9c9f5058ff6dfc380d8611f64fba"},{"author":{"_account_id":16800,"name":"Rawlin Peters","email":"rawlin.peters@hpe.com","username":"rawlin"},"change_message_id":"4993a4db5f1e7862b583cbae7a81a582b57e85b5","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":7,"id":"bacf61ea_df4c8a78","in_reply_to":"bacf61ea_e949e08f","updated":"2016-08-03 20:00:18.000000000","message":"That\u0027s how I\u0027m feeling about it as well.","commit_id":"2a853ddbcddc9c9f5058ff6dfc380d8611f64fba"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"71936408ca08f6186655b0a72aa459c431201b39","unresolved":false,"context_lines":[{"line_number":26,"context_line":"LOG \u003d logging.getLogger(__name__)"},{"line_number":27,"context_line":""},{"line_number":28,"context_line":""},{"line_number":29,"context_line":"class TrunkBridgeNotFound(n_exc.NotFound):"},{"line_number":30,"context_line":"    message \u003d _(\"Trunk bridge %(trunk_id)s could not be found.\")"},{"line_number":31,"context_line":""},{"line_number":32,"context_line":""}],"source_content_type":"text/x-python","patch_set":7,"id":"bacf61ea_1383b9cd","line":29,"updated":"2016-08-03 22:25:33.000000000","message":"shall we put it in /openvswitch/agent/exceptions.py?","commit_id":"2a853ddbcddc9c9f5058ff6dfc380d8611f64fba"},{"author":{"_account_id":6788,"name":"Rossella Sblendido","email":"rsblendido@suse.com","username":"rossella-o"},"change_message_id":"ab4213e14eef1035ec0ef01d0ca52b43aa89ef6f","unresolved":false,"context_lines":[{"line_number":26,"context_line":"LOG \u003d logging.getLogger(__name__)"},{"line_number":27,"context_line":""},{"line_number":28,"context_line":""},{"line_number":29,"context_line":"class TrunkBridgeNotFound(n_exc.NotFound):"},{"line_number":30,"context_line":"    message \u003d _(\"Trunk bridge %(trunk_id)s could not be found.\")"},{"line_number":31,"context_line":""},{"line_number":32,"context_line":""}],"source_content_type":"text/x-python","patch_set":7,"id":"bacf61ea_d896324b","line":29,"in_reply_to":"bacf61ea_1383b9cd","updated":"2016-08-04 17:59:33.000000000","message":"Done","commit_id":"2a853ddbcddc9c9f5058ff6dfc380d8611f64fba"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"d7e1c3907f616ccafdd9e965553bdbe1d5c82bf4","unresolved":false,"context_lines":[{"line_number":32,"context_line":""},{"line_number":33,"context_line":"class TrunkManager(object):"},{"line_number":34,"context_line":""},{"line_number":35,"context_line":"    def __init__(self, br_int):"},{"line_number":36,"context_line":"        self.br_int \u003d br_int"},{"line_number":37,"context_line":""},{"line_number":38,"context_line":"    def create_trunk(self, trunk_id, port_id, lvid):"}],"source_content_type":"text/x-python","patch_set":7,"id":"bacf61ea_ae07e6c7","line":35,"updated":"2016-08-03 22:32:13.000000000","message":"we should have this constructor take some known trunk properties, like the trunk_id and parent_port_id and optionally the subports. Then we can compute here all the OVS port names and OVS bridge names according to our defined translation layer. This way we can see if we can free create/delete_trunk and add/remove_subport of some of the repetitive logic.\n\nThis boils down to whether we want this TrunkManager manage a single trunk or manage all trunks, in which case having stuff created at __init__ type is not the right way to go. In the dependent patch you initialize the TrunkManager once, so I gather that you envision one manager for all trunks, but then perhaps we can define another class that encapsulate how a logical trunk is mapped on top of OVS and that is what the trunk manager handles?","commit_id":"2a853ddbcddc9c9f5058ff6dfc380d8611f64fba"},{"author":{"_account_id":6788,"name":"Rossella Sblendido","email":"rsblendido@suse.com","username":"rossella-o"},"change_message_id":"ab4213e14eef1035ec0ef01d0ca52b43aa89ef6f","unresolved":false,"context_lines":[{"line_number":32,"context_line":""},{"line_number":33,"context_line":"class TrunkManager(object):"},{"line_number":34,"context_line":""},{"line_number":35,"context_line":"    def __init__(self, br_int):"},{"line_number":36,"context_line":"        self.br_int \u003d br_int"},{"line_number":37,"context_line":""},{"line_number":38,"context_line":"    def create_trunk(self, trunk_id, port_id, lvid):"}],"source_content_type":"text/x-python","patch_set":7,"id":"bacf61ea_38e30edb","line":35,"in_reply_to":"bacf61ea_ae07e6c7","updated":"2016-08-04 17:59:33.000000000","message":"Yes I envisioned one TrunkManager to manage all trunks, I will introduce a new class.","commit_id":"2a853ddbcddc9c9f5058ff6dfc380d8611f64fba"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"71936408ca08f6186655b0a72aa459c431201b39","unresolved":false,"context_lines":[{"line_number":36,"context_line":"        self.br_int \u003d br_int"},{"line_number":37,"context_line":""},{"line_number":38,"context_line":"    def create_trunk(self, trunk_id, port_id, lvid):"},{"line_number":39,"context_line":"        \"\"\"Create the trunk port"},{"line_number":40,"context_line":""},{"line_number":41,"context_line":"        @param trunk_id: id of the trunk"},{"line_number":42,"context_line":"        @param port_id: id of the parent port"}],"source_content_type":"text/x-python","patch_set":7,"id":"bacf61ea_f3ea6573","line":39,"updated":"2016-08-03 22:25:33.000000000","message":"nit: so should the method name be create_trunk_port?","commit_id":"2a853ddbcddc9c9f5058ff6dfc380d8611f64fba"},{"author":{"_account_id":6788,"name":"Rossella Sblendido","email":"rsblendido@suse.com","username":"rossella-o"},"change_message_id":"ab4213e14eef1035ec0ef01d0ca52b43aa89ef6f","unresolved":false,"context_lines":[{"line_number":36,"context_line":"        self.br_int \u003d br_int"},{"line_number":37,"context_line":""},{"line_number":38,"context_line":"    def create_trunk(self, trunk_id, port_id, lvid):"},{"line_number":39,"context_line":"        \"\"\"Create the trunk port"},{"line_number":40,"context_line":""},{"line_number":41,"context_line":"        @param trunk_id: id of the trunk"},{"line_number":42,"context_line":"        @param port_id: id of the parent port"}],"source_content_type":"text/x-python","patch_set":7,"id":"bacf61ea_ad285b34","line":39,"in_reply_to":"bacf61ea_f3ea6573","updated":"2016-08-04 17:59:33.000000000","message":"I made it consistent","commit_id":"2a853ddbcddc9c9f5058ff6dfc380d8611f64fba"},{"author":{"_account_id":16800,"name":"Rawlin Peters","email":"rawlin.peters@hpe.com","username":"rawlin"},"change_message_id":"c20ae644eeb67f88529ddd01e863b0d2d6a6138c","unresolved":false,"context_lines":[{"line_number":49,"context_line":"        trunk_br_name \u003d utils.gen_trunk_br_name(trunk_id)"},{"line_number":50,"context_line":"        trunk_br \u003d ovs_lib.OVSBridge(trunk_br_name)"},{"line_number":51,"context_line":"        tp_patch_int \u003d self.get_br_int_port_name(TRUNK_DEV,"},{"line_number":52,"context_line":"            port_id)"},{"line_number":53,"context_line":"        tp_patch_trunk \u003d self.get_br_trunk_port_name(TRUNK_DEV,"},{"line_number":54,"context_line":"            port_id)"},{"line_number":55,"context_line":"        # NOTE(rossella_s): the ovs agent won\u0027t process the port if it has"}],"source_content_type":"text/x-python","patch_set":7,"id":"bacf61ea_37c4f090","line":52,"range":{"start_line":52,"start_character":0,"end_line":52,"end_character":20},"updated":"2016-08-03 19:18:37.000000000","message":"nit: isn\u0027t this short enough to be on the line above? Ditto the line below.","commit_id":"2a853ddbcddc9c9f5058ff6dfc380d8611f64fba"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"71936408ca08f6186655b0a72aa459c431201b39","unresolved":false,"context_lines":[{"line_number":57,"context_line":"        # main loop"},{"line_number":58,"context_line":"        self.br_int.add_patch_port(tp_patch_int, tp_patch_trunk)"},{"line_number":59,"context_line":""},{"line_number":60,"context_line":"        self.br_int.set_db_attribute(\"Port\", tp_patch_int, \"tag\", lvid)"},{"line_number":61,"context_line":""},{"line_number":62,"context_line":"        trunk_br.add_patch_port(tp_patch_trunk, tp_patch_int)"},{"line_number":63,"context_line":""}],"source_content_type":"text/x-python","patch_set":7,"id":"bacf61ea_f3b8a577","line":60,"updated":"2016-08-03 22:25:33.000000000","message":"I am still thinking that this should be done outside this method, but I won\u0027t insist, we can get back to this.","commit_id":"2a853ddbcddc9c9f5058ff6dfc380d8611f64fba"},{"author":{"_account_id":16800,"name":"Rawlin Peters","email":"rawlin.peters@hpe.com","username":"rawlin"},"change_message_id":"c20ae644eeb67f88529ddd01e863b0d2d6a6138c","unresolved":false,"context_lines":[{"line_number":67,"context_line":""},{"line_number":68,"context_line":"        The ports are the ones that plumb into the integration bridge"},{"line_number":69,"context_line":"        \"\"\""},{"line_number":70,"context_line":"        # Have a lookup map port_type -\u003e port_prefix and then do"},{"line_number":71,"context_line":"        return ((prefix + \u0027-int-\u0027 + port_id)["},{"line_number":72,"context_line":"                    :constants.DEVICE_NAME_MAX_LEN - 1])"},{"line_number":73,"context_line":""}],"source_content_type":"text/x-python","patch_set":7,"id":"bacf61ea_972e7c40","line":70,"range":{"start_line":70,"start_character":8,"end_line":70,"end_character":64},"updated":"2016-08-03 19:18:37.000000000","message":"unneeded comment","commit_id":"2a853ddbcddc9c9f5058ff6dfc380d8611f64fba"},{"author":{"_account_id":6788,"name":"Rossella Sblendido","email":"rsblendido@suse.com","username":"rossella-o"},"change_message_id":"ab4213e14eef1035ec0ef01d0ca52b43aa89ef6f","unresolved":false,"context_lines":[{"line_number":67,"context_line":""},{"line_number":68,"context_line":"        The ports are the ones that plumb into the integration bridge"},{"line_number":69,"context_line":"        \"\"\""},{"line_number":70,"context_line":"        # Have a lookup map port_type -\u003e port_prefix and then do"},{"line_number":71,"context_line":"        return ((prefix + \u0027-int-\u0027 + port_id)["},{"line_number":72,"context_line":"                    :constants.DEVICE_NAME_MAX_LEN - 1])"},{"line_number":73,"context_line":""}],"source_content_type":"text/x-python","patch_set":7,"id":"bacf61ea_380aee8a","line":70,"range":{"start_line":70,"start_character":8,"end_line":70,"end_character":64},"in_reply_to":"bacf61ea_972e7c40","updated":"2016-08-04 17:59:33.000000000","message":"Done","commit_id":"2a853ddbcddc9c9f5058ff6dfc380d8611f64fba"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"71936408ca08f6186655b0a72aa459c431201b39","unresolved":false,"context_lines":[{"line_number":75,"context_line":"    def get_br_trunk_port_name(prefix, port_id):"},{"line_number":76,"context_line":"        \"\"\"Return the OVS port names for the given port."},{"line_number":77,"context_line":""},{"line_number":78,"context_line":"        The ports are the ones that plumb into the integration bridge"},{"line_number":79,"context_line":"        \"\"\""},{"line_number":80,"context_line":"        # Have a lookup map port_type -\u003e port_prefix and then do"},{"line_number":81,"context_line":"        return ((prefix + \u0027-trunk-\u0027 + port_id)["}],"source_content_type":"text/x-python","patch_set":7,"id":"bacf61ea_f36f05fa","line":78,"updated":"2016-08-03 22:25:33.000000000","message":"same docstring than  the other one?","commit_id":"2a853ddbcddc9c9f5058ff6dfc380d8611f64fba"},{"author":{"_account_id":6788,"name":"Rossella Sblendido","email":"rsblendido@suse.com","username":"rossella-o"},"change_message_id":"ab4213e14eef1035ec0ef01d0ca52b43aa89ef6f","unresolved":false,"context_lines":[{"line_number":75,"context_line":"    def get_br_trunk_port_name(prefix, port_id):"},{"line_number":76,"context_line":"        \"\"\"Return the OVS port names for the given port."},{"line_number":77,"context_line":""},{"line_number":78,"context_line":"        The ports are the ones that plumb into the integration bridge"},{"line_number":79,"context_line":"        \"\"\""},{"line_number":80,"context_line":"        # Have a lookup map port_type -\u003e port_prefix and then do"},{"line_number":81,"context_line":"        return ((prefix + \u0027-trunk-\u0027 + port_id)["}],"source_content_type":"text/x-python","patch_set":7,"id":"bacf61ea_7800e666","line":78,"in_reply_to":"bacf61ea_f36f05fa","updated":"2016-08-04 17:59:33.000000000","message":"Done","commit_id":"2a853ddbcddc9c9f5058ff6dfc380d8611f64fba"},{"author":{"_account_id":16800,"name":"Rawlin Peters","email":"rawlin.peters@hpe.com","username":"rawlin"},"change_message_id":"c20ae644eeb67f88529ddd01e863b0d2d6a6138c","unresolved":false,"context_lines":[{"line_number":77,"context_line":""},{"line_number":78,"context_line":"        The ports are the ones that plumb into the integration bridge"},{"line_number":79,"context_line":"        \"\"\""},{"line_number":80,"context_line":"        # Have a lookup map port_type -\u003e port_prefix and then do"},{"line_number":81,"context_line":"        return ((prefix + \u0027-trunk-\u0027 + port_id)["},{"line_number":82,"context_line":"                    :constants.DEVICE_NAME_MAX_LEN - 1])"},{"line_number":83,"context_line":""}],"source_content_type":"text/x-python","patch_set":7,"id":"bacf61ea_f7dc1848","line":80,"range":{"start_line":80,"start_character":8,"end_line":80,"end_character":64},"updated":"2016-08-03 19:18:37.000000000","message":"ditto","commit_id":"2a853ddbcddc9c9f5058ff6dfc380d8611f64fba"},{"author":{"_account_id":6788,"name":"Rossella Sblendido","email":"rsblendido@suse.com","username":"rossella-o"},"change_message_id":"ab4213e14eef1035ec0ef01d0ca52b43aa89ef6f","unresolved":false,"context_lines":[{"line_number":77,"context_line":""},{"line_number":78,"context_line":"        The ports are the ones that plumb into the integration bridge"},{"line_number":79,"context_line":"        \"\"\""},{"line_number":80,"context_line":"        # Have a lookup map port_type -\u003e port_prefix and then do"},{"line_number":81,"context_line":"        return ((prefix + \u0027-trunk-\u0027 + port_id)["},{"line_number":82,"context_line":"                    :constants.DEVICE_NAME_MAX_LEN - 1])"},{"line_number":83,"context_line":""}],"source_content_type":"text/x-python","patch_set":7,"id":"bacf61ea_b8f6de8c","line":80,"range":{"start_line":80,"start_character":8,"end_line":80,"end_character":64},"in_reply_to":"bacf61ea_f7dc1848","updated":"2016-08-04 17:59:33.000000000","message":"Done","commit_id":"2a853ddbcddc9c9f5058ff6dfc380d8611f64fba"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"71936408ca08f6186655b0a72aa459c431201b39","unresolved":false,"context_lines":[{"line_number":87,"context_line":""},{"line_number":88,"context_line":"    def remove_trunk_port(self, trunk_port):"},{"line_number":89,"context_line":"        trunk_br_name \u003d utils.gen_trunk_br_name(trunk_port[\u0027id\u0027])"},{"line_number":90,"context_line":"        trunk_br \u003d ovs_lib.OVSBridge(trunk_br_name)"},{"line_number":91,"context_line":"        trunk_br.destroy()"},{"line_number":92,"context_line":""},{"line_number":93,"context_line":"    def trunk_exists(self, trunk_id):"}],"source_content_type":"text/x-python","patch_set":7,"id":"bacf61ea_0e6ef2c8","line":90,"updated":"2016-08-03 22:25:33.000000000","message":"I find this gen_trunk_br_name, get_br_int_port_name getting in the way or reading the code and it could be just me, but I wonder if we are not better off moving some of this stuff in the constructor. We could give the trunk id and parent port id, and hold some of the well known properties in the object state, e.g. trunk_br, int_patch_port, tbr_patch_port, etc.","commit_id":"2a853ddbcddc9c9f5058ff6dfc380d8611f64fba"},{"author":{"_account_id":6788,"name":"Rossella Sblendido","email":"rsblendido@suse.com","username":"rossella-o"},"change_message_id":"ab4213e14eef1035ec0ef01d0ca52b43aa89ef6f","unresolved":false,"context_lines":[{"line_number":87,"context_line":""},{"line_number":88,"context_line":"    def remove_trunk_port(self, trunk_port):"},{"line_number":89,"context_line":"        trunk_br_name \u003d utils.gen_trunk_br_name(trunk_port[\u0027id\u0027])"},{"line_number":90,"context_line":"        trunk_br \u003d ovs_lib.OVSBridge(trunk_br_name)"},{"line_number":91,"context_line":"        trunk_br.destroy()"},{"line_number":92,"context_line":""},{"line_number":93,"context_line":"    def trunk_exists(self, trunk_id):"}],"source_content_type":"text/x-python","patch_set":7,"id":"bacf61ea_8d5f57e4","line":90,"in_reply_to":"bacf61ea_0e6ef2c8","updated":"2016-08-04 17:59:33.000000000","message":"Done","commit_id":"2a853ddbcddc9c9f5058ff6dfc380d8611f64fba"},{"author":{"_account_id":4187,"name":"Ryan Tidwell","email":"rtidwell@suse.com","username":"ryan-tidwell"},"change_message_id":"e6429a82453a3a38ebe06935740e6097793c335c","unresolved":false,"context_lines":[{"line_number":88,"context_line":"    def remove_trunk_port(self, trunk_port):"},{"line_number":89,"context_line":"        trunk_br_name \u003d utils.gen_trunk_br_name(trunk_port[\u0027id\u0027])"},{"line_number":90,"context_line":"        trunk_br \u003d ovs_lib.OVSBridge(trunk_br_name)"},{"line_number":91,"context_line":"        trunk_br.destroy()"},{"line_number":92,"context_line":""},{"line_number":93,"context_line":"    def trunk_exists(self, trunk_id):"},{"line_number":94,"context_line":"        trunk_br_name \u003d utils.gen_trunk_br_name(trunk_id)"}],"source_content_type":"text/x-python","patch_set":7,"id":"bacf61ea_cc9d0abd","line":91,"updated":"2016-08-03 19:44:40.000000000","message":"What if the trunk doesn\u0027t exist? Should we catch an exception here and log?","commit_id":"2a853ddbcddc9c9f5058ff6dfc380d8611f64fba"},{"author":{"_account_id":6788,"name":"Rossella Sblendido","email":"rsblendido@suse.com","username":"rossella-o"},"change_message_id":"ab4213e14eef1035ec0ef01d0ca52b43aa89ef6f","unresolved":false,"context_lines":[{"line_number":88,"context_line":"    def remove_trunk_port(self, trunk_port):"},{"line_number":89,"context_line":"        trunk_br_name \u003d utils.gen_trunk_br_name(trunk_port[\u0027id\u0027])"},{"line_number":90,"context_line":"        trunk_br \u003d ovs_lib.OVSBridge(trunk_br_name)"},{"line_number":91,"context_line":"        trunk_br.destroy()"},{"line_number":92,"context_line":""},{"line_number":93,"context_line":"    def trunk_exists(self, trunk_id):"},{"line_number":94,"context_line":"        trunk_br_name \u003d utils.gen_trunk_br_name(trunk_id)"}],"source_content_type":"text/x-python","patch_set":7,"id":"bacf61ea_6d64a3b8","line":91,"in_reply_to":"bacf61ea_cc9d0abd","updated":"2016-08-04 17:59:33.000000000","message":"no exception, if it doesn\u0027t exist we don\u0027t remove it","commit_id":"2a853ddbcddc9c9f5058ff6dfc380d8611f64fba"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"71936408ca08f6186655b0a72aa459c431201b39","unresolved":false,"context_lines":[{"line_number":91,"context_line":"        trunk_br.destroy()"},{"line_number":92,"context_line":""},{"line_number":93,"context_line":"    def trunk_exists(self, trunk_id):"},{"line_number":94,"context_line":"        trunk_br_name \u003d utils.gen_trunk_br_name(trunk_id)"},{"line_number":95,"context_line":"        return ovs_lib.BaseOVS().bridge_exists(trunk_br_name)"},{"line_number":96,"context_line":""},{"line_number":97,"context_line":"    def add_sub_port(self, trunk_id, port_id, segmentation_id, lvid):"}],"source_content_type":"text/x-python","patch_set":7,"id":"bacf61ea_0eca72a1","line":94,"updated":"2016-08-03 22:25:33.000000000","message":"I am confused, you generate the trunk name by either the port id (like 89) or the trunk id. I think we should move some this method in the construction, I counted 5 instances of trunk_br_name \u003d utils.gen_trunk_br_name(bla)","commit_id":"2a853ddbcddc9c9f5058ff6dfc380d8611f64fba"},{"author":{"_account_id":6788,"name":"Rossella Sblendido","email":"rsblendido@suse.com","username":"rossella-o"},"change_message_id":"ab4213e14eef1035ec0ef01d0ca52b43aa89ef6f","unresolved":false,"context_lines":[{"line_number":91,"context_line":"        trunk_br.destroy()"},{"line_number":92,"context_line":""},{"line_number":93,"context_line":"    def trunk_exists(self, trunk_id):"},{"line_number":94,"context_line":"        trunk_br_name \u003d utils.gen_trunk_br_name(trunk_id)"},{"line_number":95,"context_line":"        return ovs_lib.BaseOVS().bridge_exists(trunk_br_name)"},{"line_number":96,"context_line":""},{"line_number":97,"context_line":"    def add_sub_port(self, trunk_id, port_id, segmentation_id, lvid):"}],"source_content_type":"text/x-python","patch_set":7,"id":"bacf61ea_ed709374","line":94,"in_reply_to":"bacf61ea_0eca72a1","updated":"2016-08-04 17:59:33.000000000","message":"ok","commit_id":"2a853ddbcddc9c9f5058ff6dfc380d8611f64fba"},{"author":{"_account_id":4187,"name":"Ryan Tidwell","email":"rtidwell@suse.com","username":"ryan-tidwell"},"change_message_id":"e6429a82453a3a38ebe06935740e6097793c335c","unresolved":false,"context_lines":[{"line_number":138,"context_line":"                                                       port_id)"},{"line_number":139,"context_line":"            tbr_patch_port \u003d self.get_br_trunk_port_name(SUBPORT_DEV,"},{"line_number":140,"context_line":"                                                         port_id)"},{"line_number":141,"context_line":"            trunk_br.delete_port(tbr_patch_port)"},{"line_number":142,"context_line":"            self.br_int.delete_port(int_patch_port)"}],"source_content_type":"text/x-python","patch_set":7,"id":"bacf61ea_6cc4de91","line":141,"updated":"2016-08-03 19:44:40.000000000","message":"It may be a stretch, but is there a way we can process removal of the patch port pair in an atomic fashion? Do we run the risk of leaving a straggling patch port around?\n\nAt a minimum, should we wrap each delete in a try/except so a failure at L141 doesn\u0027t keep us from removing the br-int port at L142?","commit_id":"2a853ddbcddc9c9f5058ff6dfc380d8611f64fba"},{"author":{"_account_id":4187,"name":"Ryan Tidwell","email":"rtidwell@suse.com","username":"ryan-tidwell"},"change_message_id":"9fbf66af998f63c52c681b496fe48e86db2c2f89","unresolved":false,"context_lines":[{"line_number":138,"context_line":"                                                       port_id)"},{"line_number":139,"context_line":"            tbr_patch_port \u003d self.get_br_trunk_port_name(SUBPORT_DEV,"},{"line_number":140,"context_line":"                                                         port_id)"},{"line_number":141,"context_line":"            trunk_br.delete_port(tbr_patch_port)"},{"line_number":142,"context_line":"            self.br_int.delete_port(int_patch_port)"}],"source_content_type":"text/x-python","patch_set":7,"id":"bacf61ea_df300a0a","line":141,"in_reply_to":"bacf61ea_4c075a1d","updated":"2016-08-03 20:18:59.000000000","message":"No, I don\u0027t think creating the patch port pairs should be atomic. Each pair should be treated individually and port binding updated individually. I\u0027m thinking we will want to ack each subport individually, so processing subports in an atomic way isn\u0027t what we want. This will allow some subports to be usable while the failed ones can be destroyed and re-created by the user. This is why we\u0027re thinking of adding a DEGRADED state to the trunk state machine https://review.openstack.org/#/c/350298/.","commit_id":"2a853ddbcddc9c9f5058ff6dfc380d8611f64fba"},{"author":{"_account_id":16800,"name":"Rawlin Peters","email":"rawlin.peters@hpe.com","username":"rawlin"},"change_message_id":"4993a4db5f1e7862b583cbae7a81a582b57e85b5","unresolved":false,"context_lines":[{"line_number":138,"context_line":"                                                       port_id)"},{"line_number":139,"context_line":"            tbr_patch_port \u003d self.get_br_trunk_port_name(SUBPORT_DEV,"},{"line_number":140,"context_line":"                                                         port_id)"},{"line_number":141,"context_line":"            trunk_br.delete_port(tbr_patch_port)"},{"line_number":142,"context_line":"            self.br_int.delete_port(int_patch_port)"}],"source_content_type":"text/x-python","patch_set":7,"id":"bacf61ea_4c075a1d","line":141,"in_reply_to":"bacf61ea_6cc4de91","updated":"2016-08-03 20:00:18.000000000","message":"I was kind of thinking along the same lines, except also with creating subports.\n\nI\u0027m thinking if we create a trunk with 4k subports, the agent is going to spin for a while just creating patch ports for the trunk. Could that also be atomic as well? I.e. adding all the patch ports for the trunk/subports would be a single ovsdb transaction? I think it would make the agent handling very impressive if it could churn up 4k subports very quickly like that. If the large transaction failed for whatever reason, maybe it could fall back to adding patch ports one-by-one.","commit_id":"2a853ddbcddc9c9f5058ff6dfc380d8611f64fba"},{"author":{"_account_id":6788,"name":"Rossella Sblendido","email":"rsblendido@suse.com","username":"rossella-o"},"change_message_id":"ab4213e14eef1035ec0ef01d0ca52b43aa89ef6f","unresolved":false,"context_lines":[{"line_number":138,"context_line":"                                                       port_id)"},{"line_number":139,"context_line":"            tbr_patch_port \u003d self.get_br_trunk_port_name(SUBPORT_DEV,"},{"line_number":140,"context_line":"                                                         port_id)"},{"line_number":141,"context_line":"            trunk_br.delete_port(tbr_patch_port)"},{"line_number":142,"context_line":"            self.br_int.delete_port(int_patch_port)"}],"source_content_type":"text/x-python","patch_set":7,"id":"bacf61ea_98383af0","line":141,"in_reply_to":"bacf61ea_df300a0a","updated":"2016-08-04 17:59:33.000000000","message":"Ryan if line 141 fails we should let the caller decide what to do with the exception. I could catch is and re-raise it to be able to execute line 142, not sure if it\u0027s worth it","commit_id":"2a853ddbcddc9c9f5058ff6dfc380d8611f64fba"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"5b07675c555530db027345ce601c91ff7c929bbc","unresolved":false,"context_lines":[{"line_number":48,"context_line":"    def __init__(self, trunk_id, port_id):"},{"line_number":49,"context_line":"        self.trunk_id \u003d trunk_id"},{"line_number":50,"context_line":"        self.port_id \u003d port_id"},{"line_number":51,"context_line":"        self.trunk_br_name \u003d utils.gen_trunk_br_name(self.trunk_id)"},{"line_number":52,"context_line":"        self.trunk_br \u003d ovs_lib.OVSBridge(self.trunk_br_name)"},{"line_number":53,"context_line":""},{"line_number":54,"context_line":"    @property"}],"source_content_type":"text/x-python","patch_set":8,"id":"bacf61ea_d779cafd","line":51,"updated":"2016-08-05 01:23:00.000000000","message":"I wonder if I am the only one bothered by the cut. It\u0027s be nice to have trunk_bridge_name and trunk_bridge...but I don\u0027t insist :)","commit_id":"21a80248a25590ce7f5b95dde1ac90073fb58ebe"},{"author":{"_account_id":6788,"name":"Rossella Sblendido","email":"rsblendido@suse.com","username":"rossella-o"},"change_message_id":"a2d5d325697a0fa0dc9ff00d0f6d2d909280de51","unresolved":false,"context_lines":[{"line_number":48,"context_line":"    def __init__(self, trunk_id, port_id):"},{"line_number":49,"context_line":"        self.trunk_id \u003d trunk_id"},{"line_number":50,"context_line":"        self.port_id \u003d port_id"},{"line_number":51,"context_line":"        self.trunk_br_name \u003d utils.gen_trunk_br_name(self.trunk_id)"},{"line_number":52,"context_line":"        self.trunk_br \u003d ovs_lib.OVSBridge(self.trunk_br_name)"},{"line_number":53,"context_line":""},{"line_number":54,"context_line":"    @property"}],"source_content_type":"text/x-python","patch_set":8,"id":"bacf61ea_0ccd0931","line":51,"in_reply_to":"bacf61ea_d779cafd","updated":"2016-08-05 10:09:10.000000000","message":"I don\u0027t want you to be bothered, modified!","commit_id":"21a80248a25590ce7f5b95dde1ac90073fb58ebe"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"5b07675c555530db027345ce601c91ff7c929bbc","unresolved":false,"context_lines":[{"line_number":62,"context_line":""},{"line_number":63,"context_line":"class SubPort(object):"},{"line_number":64,"context_line":""},{"line_number":65,"context_line":"    def __init__(self, trunk_id, port_id, segmentation_id):"},{"line_number":66,"context_line":"        self.trunk_id \u003d trunk_id"},{"line_number":67,"context_line":"        self.port_id \u003d port_id"},{"line_number":68,"context_line":"        self.segmentation_id \u003d segmentation_id"}],"source_content_type":"text/x-python","patch_set":8,"id":"bacf61ea_37d946f4","line":65,"updated":"2016-08-05 01:23:00.000000000","message":"consider making segmentation_id default to None?","commit_id":"21a80248a25590ce7f5b95dde1ac90073fb58ebe"},{"author":{"_account_id":6788,"name":"Rossella Sblendido","email":"rsblendido@suse.com","username":"rossella-o"},"change_message_id":"a2d5d325697a0fa0dc9ff00d0f6d2d909280de51","unresolved":false,"context_lines":[{"line_number":62,"context_line":""},{"line_number":63,"context_line":"class SubPort(object):"},{"line_number":64,"context_line":""},{"line_number":65,"context_line":"    def __init__(self, trunk_id, port_id, segmentation_id):"},{"line_number":66,"context_line":"        self.trunk_id \u003d trunk_id"},{"line_number":67,"context_line":"        self.port_id \u003d port_id"},{"line_number":68,"context_line":"        self.segmentation_id \u003d segmentation_id"}],"source_content_type":"text/x-python","patch_set":8,"id":"bacf61ea_4f5a53f3","line":65,"in_reply_to":"bacf61ea_37d946f4","updated":"2016-08-05 10:09:10.000000000","message":"Done","commit_id":"21a80248a25590ce7f5b95dde1ac90073fb58ebe"},{"author":{"_account_id":7787,"name":"Kevin Benton","email":"kevin@benton.pub","username":"blak111"},"change_message_id":"4f56247e7ed009fd29cba4ca38c00a922eabdd32","unresolved":false,"context_lines":[{"line_number":89,"context_line":"        @param trunk_id: id of the trunk"},{"line_number":90,"context_line":"        @param port_id: id of the parent port"},{"line_number":91,"context_line":"        @param lvid: local VLAN IDs used by the OVS agent for the network the"},{"line_number":92,"context_line":"            trunk is on"},{"line_number":93,"context_line":""},{"line_number":94,"context_line":"        \"\"\""},{"line_number":95,"context_line":"        trunk \u003d Trunk(trunk_id, port_id)"}],"source_content_type":"text/x-python","patch_set":8,"id":"bacf61ea_30113705","line":92,"updated":"2016-08-05 11:48:57.000000000","message":"How do you plan to get this lvid? Will the trunk manager have to call get_devices_details itself for the subports to construct a LocalVLANMapping with the appropriate segmentation details and tun_ports?\n\nBy preventing the main agent loop from managing these ports, there are a few things you will need to watch out for:\n\n * The main loop will not have a LocalVLANMapping for a subport\u0027s network if it doesn\u0027t already have normal ports on that network so you will have to provision the local VLAN somewhere in the trunk code.\n * The _restore_local_vlan_map() function depends on get_vif_ports() which will skip these unmanaged ports so it will need to be modified or else it will not have any of the LocalVLANMapping objects for networks exclusively used by subports when it starts up.\n * I assume you will use the port_bound method to setup these ports. If not, you will have to ensure you call provision_local_vlan so the right DVR rules, etc get setup. If so, you will need to add \u0027other_config\u0027 to the DB for the subports because port_bound looks for it.\n * Calling get_devices_details will put the subport in the BUILD state. Make sure you call update_devices_list to set them all to ACTIVE when done.","commit_id":"21a80248a25590ce7f5b95dde1ac90073fb58ebe"},{"author":{"_account_id":6788,"name":"Rossella Sblendido","email":"rsblendido@suse.com","username":"rossella-o"},"change_message_id":"721fb03e48742d89d7a667c930c5d454ce55ffc7","unresolved":false,"context_lines":[{"line_number":89,"context_line":"        @param trunk_id: id of the trunk"},{"line_number":90,"context_line":"        @param port_id: id of the parent port"},{"line_number":91,"context_line":"        @param lvid: local VLAN IDs used by the OVS agent for the network the"},{"line_number":92,"context_line":"            trunk is on"},{"line_number":93,"context_line":""},{"line_number":94,"context_line":"        \"\"\""},{"line_number":95,"context_line":"        trunk \u003d Trunk(trunk_id, port_id)"}],"source_content_type":"text/x-python","patch_set":8,"id":"bacf61ea_eec82d24","line":92,"in_reply_to":"bacf61ea_30113705","updated":"2016-08-07 21:47:50.000000000","message":"I was planning to get the lvid from the VlanManager [1], it\u0027s a singleton that manages all the local vlan and can allocate a new vlan if the network is not present in the dict.\n\n\u003e  I assume you will use the port_bound method to setup these ports. If not, you will have to ensure you call provision_local_vlan so the right DVR rules, etc get setup. If so, you will need to add \u0027other_config\u0027 to the DB for the subports because port_bound looks for it.\n\nNo actually my idea was to separate the code completely, I wouldn\u0027t have called provision_local_vlan but directly bind_port_to_dvr , I need to check if that would work though.\n\nRegarding the last point, yes but armando wanted to use a different rpc call to decouple trunk ports completely from ml2. Anyway after my last chat with him on Friday, we are going to change approach and do what you suggested, that is process the the ports on br-int (trunk patch and subport patch ports) in the main agent loop. See next PS please.\n\n\n[1] https://review.openstack.org/#/c/349990/","commit_id":"21a80248a25590ce7f5b95dde1ac90073fb58ebe"},{"author":{"_account_id":6788,"name":"Rossella Sblendido","email":"rsblendido@suse.com","username":"rossella-o"},"change_message_id":"046b9c69d59356284b79113b276a490013fa57e9","unresolved":false,"context_lines":[{"line_number":89,"context_line":"        @param trunk_id: id of the trunk"},{"line_number":90,"context_line":"        @param port_id: id of the parent port"},{"line_number":91,"context_line":"        @param lvid: local VLAN IDs used by the OVS agent for the network the"},{"line_number":92,"context_line":"            trunk is on"},{"line_number":93,"context_line":""},{"line_number":94,"context_line":"        \"\"\""},{"line_number":95,"context_line":"        trunk \u003d Trunk(trunk_id, port_id)"}],"source_content_type":"text/x-python","patch_set":8,"id":"bacf61ea_8ef53152","line":92,"in_reply_to":"bacf61ea_eec82d24","updated":"2016-08-07 21:53:38.000000000","message":"by next PS, I mean number 10","commit_id":"21a80248a25590ce7f5b95dde1ac90073fb58ebe"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"5b07675c555530db027345ce601c91ff7c929bbc","unresolved":false,"context_lines":[{"line_number":93,"context_line":""},{"line_number":94,"context_line":"        \"\"\""},{"line_number":95,"context_line":"        trunk \u003d Trunk(trunk_id, port_id)"},{"line_number":96,"context_line":"        if not ovs_lib.BaseOVS().bridge_exists(trunk.trunk_br_name):"},{"line_number":97,"context_line":"            raise exc.TrunkBridgeNotFound(trunk_id)"},{"line_number":98,"context_line":"        # NOTE(rossella_s): the ovs agent won\u0027t process the port if it has"},{"line_number":99,"context_line":"        # no external_ids so these ports won\u0027t be considered in the agent"}],"source_content_type":"text/x-python","patch_set":8,"id":"bacf61ea_7771fe0b","line":96,"updated":"2016-08-05 01:23:00.000000000","message":"consider making this a method of the Trunk class?","commit_id":"21a80248a25590ce7f5b95dde1ac90073fb58ebe"},{"author":{"_account_id":6788,"name":"Rossella Sblendido","email":"rsblendido@suse.com","username":"rossella-o"},"change_message_id":"a2d5d325697a0fa0dc9ff00d0f6d2d909280de51","unresolved":false,"context_lines":[{"line_number":93,"context_line":""},{"line_number":94,"context_line":"        \"\"\""},{"line_number":95,"context_line":"        trunk \u003d Trunk(trunk_id, port_id)"},{"line_number":96,"context_line":"        if not ovs_lib.BaseOVS().bridge_exists(trunk.trunk_br_name):"},{"line_number":97,"context_line":"            raise exc.TrunkBridgeNotFound(trunk_id)"},{"line_number":98,"context_line":"        # NOTE(rossella_s): the ovs agent won\u0027t process the port if it has"},{"line_number":99,"context_line":"        # no external_ids so these ports won\u0027t be considered in the agent"}],"source_content_type":"text/x-python","patch_set":8,"id":"bacf61ea_cf6643ba","line":96,"in_reply_to":"bacf61ea_7771fe0b","updated":"2016-08-05 10:09:10.000000000","message":"I modified this and created a TrunkBridge class","commit_id":"21a80248a25590ce7f5b95dde1ac90073fb58ebe"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"5b07675c555530db027345ce601c91ff7c929bbc","unresolved":false,"context_lines":[{"line_number":114,"context_line":""},{"line_number":115,"context_line":"    def remove_trunk(self, trunk_id, port_id):"},{"line_number":116,"context_line":"        trunk \u003d Trunk(trunk_id, port_id)"},{"line_number":117,"context_line":"        if not ovs_lib.BaseOVS().bridge_exists(trunk.trunk_br_name):"},{"line_number":118,"context_line":"            trunk.trunk_br.destroy()"},{"line_number":119,"context_line":""},{"line_number":120,"context_line":"    def add_sub_port(self, trunk_id, port_id, segmentation_id, lvid):"}],"source_content_type":"text/x-python","patch_set":8,"id":"bacf61ea_5755da4d","line":117,"updated":"2016-08-05 01:23:00.000000000","message":"ditto","commit_id":"21a80248a25590ce7f5b95dde1ac90073fb58ebe"},{"author":{"_account_id":6788,"name":"Rossella Sblendido","email":"rsblendido@suse.com","username":"rossella-o"},"change_message_id":"a2d5d325697a0fa0dc9ff00d0f6d2d909280de51","unresolved":false,"context_lines":[{"line_number":114,"context_line":""},{"line_number":115,"context_line":"    def remove_trunk(self, trunk_id, port_id):"},{"line_number":116,"context_line":"        trunk \u003d Trunk(trunk_id, port_id)"},{"line_number":117,"context_line":"        if not ovs_lib.BaseOVS().bridge_exists(trunk.trunk_br_name):"},{"line_number":118,"context_line":"            trunk.trunk_br.destroy()"},{"line_number":119,"context_line":""},{"line_number":120,"context_line":"    def add_sub_port(self, trunk_id, port_id, segmentation_id, lvid):"}],"source_content_type":"text/x-python","patch_set":8,"id":"bacf61ea_2f06ffcd","line":117,"in_reply_to":"bacf61ea_5755da4d","updated":"2016-08-05 10:09:10.000000000","message":"Done","commit_id":"21a80248a25590ce7f5b95dde1ac90073fb58ebe"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"5b07675c555530db027345ce601c91ff7c929bbc","unresolved":false,"context_lines":[{"line_number":149,"context_line":"        @param trunk_id: id of the trunk"},{"line_number":150,"context_line":"        @param port_id: id of the parent port"},{"line_number":151,"context_line":"        \"\"\""},{"line_number":152,"context_line":"        sub_port \u003d SubPort(trunk_id, port_id, None)"},{"line_number":153,"context_line":""},{"line_number":154,"context_line":"        # no need to process this if the trunk bridge was deleted"},{"line_number":155,"context_line":"        if sub_port.trunk_br_exists():"}],"source_content_type":"text/x-python","patch_set":8,"id":"bacf61ea_17e522a3","line":152,"updated":"2016-08-05 01:23:00.000000000","message":"can avoid specify None if the segmentation id defaults to None","commit_id":"21a80248a25590ce7f5b95dde1ac90073fb58ebe"},{"author":{"_account_id":6788,"name":"Rossella Sblendido","email":"rsblendido@suse.com","username":"rossella-o"},"change_message_id":"a2d5d325697a0fa0dc9ff00d0f6d2d909280de51","unresolved":false,"context_lines":[{"line_number":149,"context_line":"        @param trunk_id: id of the trunk"},{"line_number":150,"context_line":"        @param port_id: id of the parent port"},{"line_number":151,"context_line":"        \"\"\""},{"line_number":152,"context_line":"        sub_port \u003d SubPort(trunk_id, port_id, None)"},{"line_number":153,"context_line":""},{"line_number":154,"context_line":"        # no need to process this if the trunk bridge was deleted"},{"line_number":155,"context_line":"        if sub_port.trunk_br_exists():"}],"source_content_type":"text/x-python","patch_set":8,"id":"bacf61ea_2f2d5f46","line":152,"in_reply_to":"bacf61ea_17e522a3","updated":"2016-08-05 10:09:10.000000000","message":"good point","commit_id":"21a80248a25590ce7f5b95dde1ac90073fb58ebe"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"5b07675c555530db027345ce601c91ff7c929bbc","unresolved":false,"context_lines":[{"line_number":152,"context_line":"        sub_port \u003d SubPort(trunk_id, port_id, None)"},{"line_number":153,"context_line":""},{"line_number":154,"context_line":"        # no need to process this if the trunk bridge was deleted"},{"line_number":155,"context_line":"        if sub_port.trunk_br_exists():"},{"line_number":156,"context_line":"            sub_port.trunk_br.delete_port(sub_port.patch_port_trunk)"},{"line_number":157,"context_line":"            self.br_int.delete_port(sub_port.patch_port_int)"}],"source_content_type":"text/x-python","patch_set":8,"id":"bacf61ea_d7954ae4","line":155,"updated":"2016-08-05 01:23:00.000000000","message":"this method does not exist?","commit_id":"21a80248a25590ce7f5b95dde1ac90073fb58ebe"},{"author":{"_account_id":6788,"name":"Rossella Sblendido","email":"rsblendido@suse.com","username":"rossella-o"},"change_message_id":"a2d5d325697a0fa0dc9ff00d0f6d2d909280de51","unresolved":false,"context_lines":[{"line_number":152,"context_line":"        sub_port \u003d SubPort(trunk_id, port_id, None)"},{"line_number":153,"context_line":""},{"line_number":154,"context_line":"        # no need to process this if the trunk bridge was deleted"},{"line_number":155,"context_line":"        if sub_port.trunk_br_exists():"},{"line_number":156,"context_line":"            sub_port.trunk_br.delete_port(sub_port.patch_port_trunk)"},{"line_number":157,"context_line":"            self.br_int.delete_port(sub_port.patch_port_int)"}],"source_content_type":"text/x-python","patch_set":8,"id":"bacf61ea_0f321ba7","line":155,"in_reply_to":"bacf61ea_d7954ae4","updated":"2016-08-05 10:09:10.000000000","message":"it\u0027s a leftover","commit_id":"21a80248a25590ce7f5b95dde1ac90073fb58ebe"},{"author":{"_account_id":8655,"name":"Jakub Libosvar","email":"libosvar@redhat.com","username":"jlibosva"},"change_message_id":"cfeff869c2a22d35549e06e830c53fc634e8c621","unresolved":false,"context_lines":[{"line_number":25,"context_line":"LOG \u003d logging.getLogger(__name__)"},{"line_number":26,"context_line":""},{"line_number":27,"context_line":""},{"line_number":28,"context_line":"def get_br_int_port_name(prefix, port_id):"},{"line_number":29,"context_line":"    \"\"\"Return the OVS port names for the given port."},{"line_number":30,"context_line":""},{"line_number":31,"context_line":"    The ports are the ones that plumb into the integration bridge"},{"line_number":32,"context_line":"    \"\"\""},{"line_number":33,"context_line":"    return ((prefix + \u0027-int-\u0027 + port_id)["},{"line_number":34,"context_line":"                :constants.DEVICE_NAME_MAX_LEN - 1])"},{"line_number":35,"context_line":""},{"line_number":36,"context_line":""},{"line_number":37,"context_line":"def get_br_trunk_port_name(prefix, port_id):"},{"line_number":38,"context_line":"    \"\"\"Return the OVS port names for the given port."},{"line_number":39,"context_line":""},{"line_number":40,"context_line":"    The ports are the ones that plumb into the trunk bridge"},{"line_number":41,"context_line":"    \"\"\""},{"line_number":42,"context_line":"    return ((prefix + \u0027-trunk-\u0027 + port_id)["},{"line_number":43,"context_line":"                :constants.DEVICE_NAME_MAX_LEN - 1])"},{"line_number":44,"context_line":""},{"line_number":45,"context_line":""},{"line_number":46,"context_line":"class TrunkBridge(object):"}],"source_content_type":"text/x-python","patch_set":10,"id":"9ad45d7e_a7427d3c","line":43,"range":{"start_line":28,"start_character":0,"end_line":43,"end_character":52},"updated":"2016-08-09 13:46:06.000000000","message":"Maybe these belong to utils like the other function for getting name?","commit_id":"d856c99bd854bf73b2540639fcd1e258276d3fb5"},{"author":{"_account_id":6788,"name":"Rossella Sblendido","email":"rsblendido@suse.com","username":"rossella-o"},"change_message_id":"bdec56ebfc66ec88f6375820188b208df096d78c","unresolved":false,"context_lines":[{"line_number":25,"context_line":"LOG \u003d logging.getLogger(__name__)"},{"line_number":26,"context_line":""},{"line_number":27,"context_line":""},{"line_number":28,"context_line":"def get_br_int_port_name(prefix, port_id):"},{"line_number":29,"context_line":"    \"\"\"Return the OVS port names for the given port."},{"line_number":30,"context_line":""},{"line_number":31,"context_line":"    The ports are the ones that plumb into the integration bridge"},{"line_number":32,"context_line":"    \"\"\""},{"line_number":33,"context_line":"    return ((prefix + \u0027-int-\u0027 + port_id)["},{"line_number":34,"context_line":"                :constants.DEVICE_NAME_MAX_LEN - 1])"},{"line_number":35,"context_line":""},{"line_number":36,"context_line":""},{"line_number":37,"context_line":"def get_br_trunk_port_name(prefix, port_id):"},{"line_number":38,"context_line":"    \"\"\"Return the OVS port names for the given port."},{"line_number":39,"context_line":""},{"line_number":40,"context_line":"    The ports are the ones that plumb into the trunk bridge"},{"line_number":41,"context_line":"    \"\"\""},{"line_number":42,"context_line":"    return ((prefix + \u0027-trunk-\u0027 + port_id)["},{"line_number":43,"context_line":"                :constants.DEVICE_NAME_MAX_LEN - 1])"},{"line_number":44,"context_line":""},{"line_number":45,"context_line":""},{"line_number":46,"context_line":"class TrunkBridge(object):"}],"source_content_type":"text/x-python","patch_set":10,"id":"9ad45d7e_b873ee14","line":43,"range":{"start_line":28,"start_character":0,"end_line":43,"end_character":52},"in_reply_to":"9ad45d7e_a7427d3c","updated":"2016-08-12 16:20:20.000000000","message":"they are only used in this file","commit_id":"d856c99bd854bf73b2540639fcd1e258276d3fb5"},{"author":{"_account_id":8655,"name":"Jakub Libosvar","email":"libosvar@redhat.com","username":"jlibosva"},"change_message_id":"cfeff869c2a22d35549e06e830c53fc634e8c621","unresolved":false,"context_lines":[{"line_number":43,"context_line":"                :constants.DEVICE_NAME_MAX_LEN - 1])"},{"line_number":44,"context_line":""},{"line_number":45,"context_line":""},{"line_number":46,"context_line":"class TrunkBridge(object):"},{"line_number":47,"context_line":""},{"line_number":48,"context_line":"    def __init__(self, trunk_id):"},{"line_number":49,"context_line":"        self.name \u003d utils.gen_trunk_br_name(trunk_id)"}],"source_content_type":"text/x-python","patch_set":10,"id":"9ad45d7e_4c1006a9","line":46,"range":{"start_line":46,"start_character":6,"end_line":46,"end_character":17},"updated":"2016-08-09 13:46:06.000000000","message":"I suggest to inherit from OVSBridge here:\n\nclass TrunkOVSBridge(ovs_lib.OVSBridge):\n\n     def __init__(self, trun_id):\n         name \u003d gen..()\n         super(TrunkOVSBridge, self).__init__(name)\n\nthen later you won\u0027t need to call\n\n sub_port.trunk_bridge.bridge.operation()\n\nbut just\n\n sub_port.trunk_bridge.operation()","commit_id":"d856c99bd854bf73b2540639fcd1e258276d3fb5"},{"author":{"_account_id":6788,"name":"Rossella Sblendido","email":"rsblendido@suse.com","username":"rossella-o"},"change_message_id":"bdec56ebfc66ec88f6375820188b208df096d78c","unresolved":false,"context_lines":[{"line_number":43,"context_line":"                :constants.DEVICE_NAME_MAX_LEN - 1])"},{"line_number":44,"context_line":""},{"line_number":45,"context_line":""},{"line_number":46,"context_line":"class TrunkBridge(object):"},{"line_number":47,"context_line":""},{"line_number":48,"context_line":"    def __init__(self, trunk_id):"},{"line_number":49,"context_line":"        self.name \u003d utils.gen_trunk_br_name(trunk_id)"}],"source_content_type":"text/x-python","patch_set":10,"id":"9ad45d7e_18179a55","line":46,"range":{"start_line":46,"start_character":6,"end_line":46,"end_character":17},"in_reply_to":"9ad45d7e_4c1006a9","updated":"2016-08-12 16:20:20.000000000","message":"thanks","commit_id":"d856c99bd854bf73b2540639fcd1e258276d3fb5"},{"author":{"_account_id":8655,"name":"Jakub Libosvar","email":"libosvar@redhat.com","username":"jlibosva"},"change_message_id":"cfeff869c2a22d35549e06e830c53fc634e8c621","unresolved":false,"context_lines":[{"line_number":50,"context_line":"        self.bridge \u003d ovs_lib.OVSBridge(self.name)"},{"line_number":51,"context_line":""},{"line_number":52,"context_line":"    def exists(self):"},{"line_number":53,"context_line":"        return ovs_lib.BaseOVS().bridge_exists(self.name)"},{"line_number":54,"context_line":""},{"line_number":55,"context_line":""},{"line_number":56,"context_line":"class Trunk(object):"}],"source_content_type":"text/x-python","patch_set":10,"id":"9ad45d7e_0c08ce90","line":53,"range":{"start_line":53,"start_character":15,"end_line":53,"end_character":32},"updated":"2016-08-09 13:46:06.000000000","message":"Do we need to instantiate a new api per call? Maybe:\n\n return self.bridge.bridge_exists(self.name)","commit_id":"d856c99bd854bf73b2540639fcd1e258276d3fb5"},{"author":{"_account_id":6788,"name":"Rossella Sblendido","email":"rsblendido@suse.com","username":"rossella-o"},"change_message_id":"bdec56ebfc66ec88f6375820188b208df096d78c","unresolved":false,"context_lines":[{"line_number":50,"context_line":"        self.bridge \u003d ovs_lib.OVSBridge(self.name)"},{"line_number":51,"context_line":""},{"line_number":52,"context_line":"    def exists(self):"},{"line_number":53,"context_line":"        return ovs_lib.BaseOVS().bridge_exists(self.name)"},{"line_number":54,"context_line":""},{"line_number":55,"context_line":""},{"line_number":56,"context_line":"class Trunk(object):"}],"source_content_type":"text/x-python","patch_set":10,"id":"9ad45d7e_5811125d","line":53,"range":{"start_line":53,"start_character":15,"end_line":53,"end_character":32},"in_reply_to":"9ad45d7e_0c08ce90","updated":"2016-08-12 16:20:20.000000000","message":"Done","commit_id":"d856c99bd854bf73b2540639fcd1e258276d3fb5"},{"author":{"_account_id":8655,"name":"Jakub Libosvar","email":"libosvar@redhat.com","username":"jlibosva"},"change_message_id":"cfeff869c2a22d35549e06e830c53fc634e8c621","unresolved":false,"context_lines":[{"line_number":78,"context_line":"        self.trunk_bridge \u003d TrunkBridge(self.trunk_id)"},{"line_number":79,"context_line":""},{"line_number":80,"context_line":"    @property"},{"line_number":81,"context_line":"    def patch_port_int(self):"},{"line_number":82,"context_line":"        return get_br_int_port_name(SUBPORT_DEV, self.port_id)"},{"line_number":83,"context_line":""},{"line_number":84,"context_line":"    @property"}],"source_content_type":"text/x-python","patch_set":10,"id":"9ad45d7e_cc7d16b3","line":81,"range":{"start_line":81,"start_character":8,"end_line":81,"end_character":22},"updated":"2016-08-09 13:46:06.000000000","message":"Super nit: Consider naming it patch_port_int_name - this sounds like you\u0027re returning the patch port itself.","commit_id":"d856c99bd854bf73b2540639fcd1e258276d3fb5"},{"author":{"_account_id":6788,"name":"Rossella Sblendido","email":"rsblendido@suse.com","username":"rossella-o"},"change_message_id":"bdec56ebfc66ec88f6375820188b208df096d78c","unresolved":false,"context_lines":[{"line_number":78,"context_line":"        self.trunk_bridge \u003d TrunkBridge(self.trunk_id)"},{"line_number":79,"context_line":""},{"line_number":80,"context_line":"    @property"},{"line_number":81,"context_line":"    def patch_port_int(self):"},{"line_number":82,"context_line":"        return get_br_int_port_name(SUBPORT_DEV, self.port_id)"},{"line_number":83,"context_line":""},{"line_number":84,"context_line":"    @property"}],"source_content_type":"text/x-python","patch_set":10,"id":"9ad45d7e_7b47b01d","line":81,"range":{"start_line":81,"start_character":8,"end_line":81,"end_character":22},"in_reply_to":"9ad45d7e_cc7d16b3","updated":"2016-08-12 16:20:20.000000000","message":"Done","commit_id":"d856c99bd854bf73b2540639fcd1e258276d3fb5"},{"author":{"_account_id":7787,"name":"Kevin Benton","email":"kevin@benton.pub","username":"blak111"},"change_message_id":"6876446f1299c0ebb4552791c3723ed43068d56e","unresolved":false,"context_lines":[{"line_number":100,"context_line":""},{"line_number":101,"context_line":"        \"\"\""},{"line_number":102,"context_line":"        trunk \u003d Trunk(trunk_id, port_id)"},{"line_number":103,"context_line":"        if not trunk.trunk_bridge.exists():"},{"line_number":104,"context_line":"            raise exc.TrunkBridgeNotFound(trunk_id\u003dtrunk_id)"},{"line_number":105,"context_line":"        # The agent main loop won\u0027t process the trunk since the parent port is"},{"line_number":106,"context_line":"        # on the trunk bridge, not on the br-int."}],"source_content_type":"text/x-python","patch_set":10,"id":"9ad45d7e_9bb19692","line":103,"updated":"2016-08-09 12:44:54.000000000","message":"does this happen because Nova is expected to create it?","commit_id":"d856c99bd854bf73b2540639fcd1e258276d3fb5"},{"author":{"_account_id":6788,"name":"Rossella Sblendido","email":"rsblendido@suse.com","username":"rossella-o"},"change_message_id":"2d6a4696b0be54f1c3d74c2ae1b0feb5828311e3","unresolved":false,"context_lines":[{"line_number":100,"context_line":""},{"line_number":101,"context_line":"        \"\"\""},{"line_number":102,"context_line":"        trunk \u003d Trunk(trunk_id, port_id)"},{"line_number":103,"context_line":"        if not trunk.trunk_bridge.exists():"},{"line_number":104,"context_line":"            raise exc.TrunkBridgeNotFound(trunk_id\u003dtrunk_id)"},{"line_number":105,"context_line":"        # The agent main loop won\u0027t process the trunk since the parent port is"},{"line_number":106,"context_line":"        # on the trunk bridge, not on the br-int."}],"source_content_type":"text/x-python","patch_set":10,"id":"9ad45d7e_eab6f0da","line":103,"in_reply_to":"9ad45d7e_9bb19692","updated":"2016-08-09 16:17:56.000000000","message":"yes nova is expected to create the bridge so that it can plug the VM vif into it.","commit_id":"d856c99bd854bf73b2540639fcd1e258276d3fb5"},{"author":{"_account_id":16800,"name":"Rawlin Peters","email":"rawlin.peters@hpe.com","username":"rawlin"},"change_message_id":"9bd8a2594f175017d2843ff5c52cd7099f43cf3f","unresolved":false,"context_lines":[{"line_number":113,"context_line":"        #  notification that the device is up, since it\u0027s using the"},{"line_number":114,"context_line":"        # same interface ID as the parent port, Nova will receive it and assume"},{"line_number":115,"context_line":"        # that the parent port is UP."},{"line_number":116,"context_line":"        patch_int_attrs \u003d [(\u0027type\u0027, \u0027patch\u0027),"},{"line_number":117,"context_line":"                           (\u0027options\u0027, {\u0027peer\u0027: trunk.patch_port_trunk}),"},{"line_number":118,"context_line":"                           (\u0027external_ids\u0027,"},{"line_number":119,"context_line":"                            {\u0027attached-mac\u0027: port_mac,"},{"line_number":120,"context_line":"                             \u0027iface-id\u0027: port_id})]"},{"line_number":121,"context_line":"        self.br_int.add_port(trunk.patch_port_int, *patch_int_attrs)"},{"line_number":122,"context_line":""},{"line_number":123,"context_line":"        trunk.trunk_bridge.bridge.add_patch_port(trunk.patch_port_trunk,"}],"source_content_type":"text/x-python","patch_set":10,"id":"9ad45d7e_668714d8","line":120,"range":{"start_line":116,"start_character":8,"end_line":120,"end_character":51},"updated":"2016-08-12 17:32:05.000000000","message":"Maybe this should be extracted into it\u0027s own function and reused on L142 as well?","commit_id":"d856c99bd854bf73b2540639fcd1e258276d3fb5"},{"author":{"_account_id":6788,"name":"Rossella Sblendido","email":"rsblendido@suse.com","username":"rossella-o"},"change_message_id":"4e80e5e10d10446ce4d65e10f5e647838cfecade","unresolved":false,"context_lines":[{"line_number":113,"context_line":"        #  notification that the device is up, since it\u0027s using the"},{"line_number":114,"context_line":"        # same interface ID as the parent port, Nova will receive it and assume"},{"line_number":115,"context_line":"        # that the parent port is UP."},{"line_number":116,"context_line":"        patch_int_attrs \u003d [(\u0027type\u0027, \u0027patch\u0027),"},{"line_number":117,"context_line":"                           (\u0027options\u0027, {\u0027peer\u0027: trunk.patch_port_trunk}),"},{"line_number":118,"context_line":"                           (\u0027external_ids\u0027,"},{"line_number":119,"context_line":"                            {\u0027attached-mac\u0027: port_mac,"},{"line_number":120,"context_line":"                             \u0027iface-id\u0027: port_id})]"},{"line_number":121,"context_line":"        self.br_int.add_port(trunk.patch_port_int, *patch_int_attrs)"},{"line_number":122,"context_line":""},{"line_number":123,"context_line":"        trunk.trunk_bridge.bridge.add_patch_port(trunk.patch_port_trunk,"}],"source_content_type":"text/x-python","patch_set":10,"id":"3ac371cc_1910574e","line":120,"range":{"start_line":116,"start_character":8,"end_line":120,"end_character":51},"in_reply_to":"9ad45d7e_668714d8","updated":"2016-08-14 09:07:37.000000000","message":"I don\u0027t see the need to do that tbh","commit_id":"d856c99bd854bf73b2540639fcd1e258276d3fb5"},{"author":{"_account_id":7787,"name":"Kevin Benton","email":"kevin@benton.pub","username":"blak111"},"change_message_id":"6876446f1299c0ebb4552791c3723ed43068d56e","unresolved":false,"context_lines":[{"line_number":125,"context_line":""},{"line_number":126,"context_line":"    def remove_trunk(self, trunk_id, port_id):"},{"line_number":127,"context_line":"        trunk \u003d Trunk(trunk_id, port_id)"},{"line_number":128,"context_line":"        if trunk.trunk_bridge.exists():"},{"line_number":129,"context_line":"            trunk.trunk_bridge.bridge.destroy()"},{"line_number":130,"context_line":""},{"line_number":131,"context_line":"    def add_sub_port(self, trunk_id, port_id, segmentation_id, port_mac):"}],"source_content_type":"text/x-python","patch_set":10,"id":"9ad45d7e_7baca235","line":128,"updated":"2016-08-09 12:44:54.000000000","message":"related to the above question, it\u0027s not clear to me which entity is responsible for the trunk bridge. It seems like we should either create and delete it or do neither...","commit_id":"d856c99bd854bf73b2540639fcd1e258276d3fb5"},{"author":{"_account_id":6788,"name":"Rossella Sblendido","email":"rsblendido@suse.com","username":"rossella-o"},"change_message_id":"2d6a4696b0be54f1c3d74c2ae1b0feb5828311e3","unresolved":false,"context_lines":[{"line_number":125,"context_line":""},{"line_number":126,"context_line":"    def remove_trunk(self, trunk_id, port_id):"},{"line_number":127,"context_line":"        trunk \u003d Trunk(trunk_id, port_id)"},{"line_number":128,"context_line":"        if trunk.trunk_bridge.exists():"},{"line_number":129,"context_line":"            trunk.trunk_bridge.bridge.destroy()"},{"line_number":130,"context_line":""},{"line_number":131,"context_line":"    def add_sub_port(self, trunk_id, port_id, segmentation_id, port_mac):"}],"source_content_type":"text/x-python","patch_set":10,"id":"9ad45d7e_eabc306e","line":128,"in_reply_to":"9ad45d7e_7baca235","updated":"2016-08-09 16:17:56.000000000","message":"Nova creates the trunk bridge but the ovs agent deletes it. The deletion is performed by the agent because we wanted to minimize the changes to os-vif, see [1]\n\n[1]https://review.openstack.org/#/c/318317/6/doc/source/devref/openvswitch_agent.rst@570","commit_id":"d856c99bd854bf73b2540639fcd1e258276d3fb5"},{"author":{"_account_id":7787,"name":"Kevin Benton","email":"kevin@benton.pub","username":"blak111"},"change_message_id":"6876446f1299c0ebb4552791c3723ed43068d56e","unresolved":false,"context_lines":[{"line_number":163,"context_line":"        \"\"\""},{"line_number":164,"context_line":"        sub_port \u003d SubPort(trunk_id, port_id)"},{"line_number":165,"context_line":""},{"line_number":166,"context_line":"        # no need to process this if the trunk bridge was deleted"},{"line_number":167,"context_line":"        if sub_port.trunk_bridge.exists():"},{"line_number":168,"context_line":"            sub_port.trunk_bridge.bridge.delete_port(sub_port.patch_port_trunk)"},{"line_number":169,"context_line":"            self.br_int.delete_port(sub_port.patch_port_int)"}],"source_content_type":"text/x-python","patch_set":10,"id":"9ad45d7e_dbab0e1c","line":166,"updated":"2016-08-09 12:44:54.000000000","message":"do we need to worry about a race here where nova can delete the bridge while we try to delete a subport? similar question with removing a trunk bridge on L126.","commit_id":"d856c99bd854bf73b2540639fcd1e258276d3fb5"},{"author":{"_account_id":6788,"name":"Rossella Sblendido","email":"rsblendido@suse.com","username":"rossella-o"},"change_message_id":"2d6a4696b0be54f1c3d74c2ae1b0feb5828311e3","unresolved":false,"context_lines":[{"line_number":163,"context_line":"        \"\"\""},{"line_number":164,"context_line":"        sub_port \u003d SubPort(trunk_id, port_id)"},{"line_number":165,"context_line":""},{"line_number":166,"context_line":"        # no need to process this if the trunk bridge was deleted"},{"line_number":167,"context_line":"        if sub_port.trunk_bridge.exists():"},{"line_number":168,"context_line":"            sub_port.trunk_bridge.bridge.delete_port(sub_port.patch_port_trunk)"},{"line_number":169,"context_line":"            self.br_int.delete_port(sub_port.patch_port_int)"}],"source_content_type":"text/x-python","patch_set":10,"id":"9ad45d7e_2a6e4801","line":166,"in_reply_to":"9ad45d7e_dbab0e1c","updated":"2016-08-09 16:17:56.000000000","message":"Nova doesn\u0027t delete the trunk bridge, there should be no race. The check is here to cover the case when the subport removal is processed after the trunk removal.","commit_id":"d856c99bd854bf73b2540639fcd1e258276d3fb5"},{"author":{"_account_id":6788,"name":"Rossella Sblendido","email":"rsblendido@suse.com","username":"rossella-o"},"change_message_id":"6fdb96897777f6af5d0bd2653cd5c3d2d93ff33f","unresolved":false,"context_lines":[{"line_number":31,"context_line":"    The ports are the ones that plumb into the integration bridge"},{"line_number":32,"context_line":"    \"\"\""},{"line_number":33,"context_line":"    return ((prefix + \u0027-int-\u0027 + port_id)["},{"line_number":34,"context_line":"                :constants.DEVICE_NAME_MAX_LEN - 1])"},{"line_number":35,"context_line":""},{"line_number":36,"context_line":""},{"line_number":37,"context_line":"def get_br_trunk_port_name(prefix, port_id):"}],"source_content_type":"text/x-python","patch_set":12,"id":"3ac371cc_0e83eccd","line":34,"range":{"start_line":34,"start_character":49,"end_line":34,"end_character":50},"updated":"2016-08-14 14:15:42.000000000","message":"this -1 is not needed actually","commit_id":"fbc10222ada428d48c38538411df1664058dd501"},{"author":{"_account_id":6788,"name":"Rossella Sblendido","email":"rsblendido@suse.com","username":"rossella-o"},"change_message_id":"6fdb96897777f6af5d0bd2653cd5c3d2d93ff33f","unresolved":false,"context_lines":[{"line_number":40,"context_line":"    The ports are the ones that plumb into the trunk bridge"},{"line_number":41,"context_line":"    \"\"\""},{"line_number":42,"context_line":"    return ((prefix + \u0027-trunk-\u0027 + port_id)["},{"line_number":43,"context_line":"                :constants.DEVICE_NAME_MAX_LEN - 1])"},{"line_number":44,"context_line":""},{"line_number":45,"context_line":""},{"line_number":46,"context_line":"class TrunkBridge(ovs_lib.OVSBridge):"}],"source_content_type":"text/x-python","patch_set":12,"id":"3ac371cc_2e6a281b","line":43,"range":{"start_line":43,"start_character":49,"end_line":43,"end_character":50},"updated":"2016-08-14 14:15:42.000000000","message":"ditto","commit_id":"fbc10222ada428d48c38538411df1664058dd501"},{"author":{"_account_id":13770,"name":"Adolfo Duarte","email":"adduarte@redhat.com","username":"adolfoduarte"},"change_message_id":"5e4a23111ebdbcab71fcc366874c21533295882e","unresolved":false,"context_lines":[{"line_number":17,"context_line":"from neutron.plugins.ml2.drivers.openvswitch.agent import exceptions as exc"},{"line_number":18,"context_line":"from neutron.services.trunk import utils"},{"line_number":19,"context_line":""},{"line_number":20,"context_line":"# prefix used for the patch ports corresponding to the trunk"},{"line_number":21,"context_line":"TRUNK_DEV \u003d \u0027tp\u0027"},{"line_number":22,"context_line":"# prefix used for the patch ports corresponding to subports"},{"line_number":23,"context_line":"SUBPORT_DEV \u003d \u0027sp\u0027"},{"line_number":24,"context_line":""},{"line_number":25,"context_line":"LOG \u003d logging.getLogger(__name__)"},{"line_number":26,"context_line":""}],"source_content_type":"text/x-python","patch_set":13,"id":"3ac371cc_535b552e","line":23,"range":{"start_line":20,"start_character":0,"end_line":23,"end_character":18},"updated":"2016-08-16 22:31:04.000000000","message":"do these belong in neutron/services/trunk/constants, or some other file which collects constants?","commit_id":"b4b90ac4ae8d259f503515456f91202ef25c60bb"},{"author":{"_account_id":8655,"name":"Jakub Libosvar","email":"libosvar@redhat.com","username":"jlibosva"},"change_message_id":"c6b9494981dc46186b48a2b37b847c0b2065cde6","unresolved":false,"context_lines":[{"line_number":17,"context_line":"from neutron.plugins.ml2.drivers.openvswitch.agent import exceptions as exc"},{"line_number":18,"context_line":"from neutron.services.trunk import utils"},{"line_number":19,"context_line":""},{"line_number":20,"context_line":"# prefix used for the patch ports corresponding to the trunk"},{"line_number":21,"context_line":"TRUNK_DEV \u003d \u0027tp\u0027"},{"line_number":22,"context_line":"# prefix used for the patch ports corresponding to subports"},{"line_number":23,"context_line":"SUBPORT_DEV \u003d \u0027sp\u0027"},{"line_number":24,"context_line":""},{"line_number":25,"context_line":"LOG \u003d logging.getLogger(__name__)"},{"line_number":26,"context_line":""}],"source_content_type":"text/x-python","patch_set":13,"id":"3ac371cc_43688b87","line":23,"range":{"start_line":20,"start_character":0,"end_line":23,"end_character":18},"in_reply_to":"3ac371cc_535b552e","updated":"2016-08-17 15:21:30.000000000","message":"Unless they are used in other modules that could cause a cyclic imports, I think it\u0027s fine to keep it here. Otherwise it looks like a YAGNI to me.","commit_id":"b4b90ac4ae8d259f503515456f91202ef25c60bb"},{"author":{"_account_id":13770,"name":"Adolfo Duarte","email":"adduarte@redhat.com","username":"adolfoduarte"},"change_message_id":"5e4a23111ebdbcab71fcc366874c21533295882e","unresolved":false,"context_lines":[{"line_number":26,"context_line":""},{"line_number":27,"context_line":""},{"line_number":28,"context_line":"def get_br_int_port_name(prefix, port_id):"},{"line_number":29,"context_line":"    \"\"\"Return the OVS port names for the given port."},{"line_number":30,"context_line":""},{"line_number":31,"context_line":"    The ports are the ones that plumb into the integration bridge"},{"line_number":32,"context_line":"    \"\"\""}],"source_content_type":"text/x-python","patch_set":13,"id":"3ac371cc_93ab0dd6","line":29,"range":{"start_line":29,"start_character":47,"end_line":29,"end_character":51},"updated":"2016-08-16 22:31:04.000000000","message":"nit: \"give port id\"","commit_id":"b4b90ac4ae8d259f503515456f91202ef25c60bb"},{"author":{"_account_id":8655,"name":"Jakub Libosvar","email":"libosvar@redhat.com","username":"jlibosva"},"change_message_id":"c6b9494981dc46186b48a2b37b847c0b2065cde6","unresolved":false,"context_lines":[{"line_number":26,"context_line":""},{"line_number":27,"context_line":""},{"line_number":28,"context_line":"def get_br_int_port_name(prefix, port_id):"},{"line_number":29,"context_line":"    \"\"\"Return the OVS port names for the given port."},{"line_number":30,"context_line":""},{"line_number":31,"context_line":"    The ports are the ones that plumb into the integration bridge"},{"line_number":32,"context_line":"    \"\"\""}],"source_content_type":"text/x-python","patch_set":13,"id":"3ac371cc_c312bb08","line":29,"range":{"start_line":29,"start_character":47,"end_line":29,"end_character":51},"in_reply_to":"3ac371cc_93ab0dd6","updated":"2016-08-17 15:21:30.000000000","message":"Done","commit_id":"b4b90ac4ae8d259f503515456f91202ef25c60bb"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"6a89c25e5853c1f019e26194f2341301d3a2c780","unresolved":false,"context_lines":[{"line_number":28,"context_line":"def get_br_int_port_name(prefix, port_id):"},{"line_number":29,"context_line":"    \"\"\"Return the OVS port names for the given port."},{"line_number":30,"context_line":""},{"line_number":31,"context_line":"    The ports are the ones that plumb into the integration bridge"},{"line_number":32,"context_line":"    \"\"\""},{"line_number":33,"context_line":"    return ((prefix + \u0027-int-\u0027 + port_id)["},{"line_number":34,"context_line":"                :constants.DEVICE_NAME_MAX_LEN])"}],"source_content_type":"text/x-python","patch_set":13,"id":"3ac371cc_6651830e","line":31,"updated":"2016-08-16 16:12:25.000000000","message":"I\u0027d add a trailing period.","commit_id":"b4b90ac4ae8d259f503515456f91202ef25c60bb"},{"author":{"_account_id":13770,"name":"Adolfo Duarte","email":"adduarte@redhat.com","username":"adolfoduarte"},"change_message_id":"5e4a23111ebdbcab71fcc366874c21533295882e","unresolved":false,"context_lines":[{"line_number":28,"context_line":"def get_br_int_port_name(prefix, port_id):"},{"line_number":29,"context_line":"    \"\"\"Return the OVS port names for the given port."},{"line_number":30,"context_line":""},{"line_number":31,"context_line":"    The ports are the ones that plumb into the integration bridge"},{"line_number":32,"context_line":"    \"\"\""},{"line_number":33,"context_line":"    return ((prefix + \u0027-int-\u0027 + port_id)["},{"line_number":34,"context_line":"                :constants.DEVICE_NAME_MAX_LEN])"}],"source_content_type":"text/x-python","patch_set":13,"id":"3ac371cc_13d43d45","line":31,"range":{"start_line":31,"start_character":4,"end_line":31,"end_character":14},"updated":"2016-08-16 22:31:04.000000000","message":"not sure what \"ports\" refers to.","commit_id":"b4b90ac4ae8d259f503515456f91202ef25c60bb"},{"author":{"_account_id":8655,"name":"Jakub Libosvar","email":"libosvar@redhat.com","username":"jlibosva"},"change_message_id":"c6b9494981dc46186b48a2b37b847c0b2065cde6","unresolved":false,"context_lines":[{"line_number":28,"context_line":"def get_br_int_port_name(prefix, port_id):"},{"line_number":29,"context_line":"    \"\"\"Return the OVS port names for the given port."},{"line_number":30,"context_line":""},{"line_number":31,"context_line":"    The ports are the ones that plumb into the integration bridge"},{"line_number":32,"context_line":"    \"\"\""},{"line_number":33,"context_line":"    return ((prefix + \u0027-int-\u0027 + port_id)["},{"line_number":34,"context_line":"                :constants.DEVICE_NAME_MAX_LEN])"}],"source_content_type":"text/x-python","patch_set":13,"id":"3ac371cc_83da834a","line":31,"range":{"start_line":31,"start_character":4,"end_line":31,"end_character":14},"in_reply_to":"3ac371cc_13d43d45","updated":"2016-08-17 15:21:30.000000000","message":"Yep, maybe a singular makes more sense here.","commit_id":"b4b90ac4ae8d259f503515456f91202ef25c60bb"},{"author":{"_account_id":8655,"name":"Jakub Libosvar","email":"libosvar@redhat.com","username":"jlibosva"},"change_message_id":"c6b9494981dc46186b48a2b37b847c0b2065cde6","unresolved":false,"context_lines":[{"line_number":28,"context_line":"def get_br_int_port_name(prefix, port_id):"},{"line_number":29,"context_line":"    \"\"\"Return the OVS port names for the given port."},{"line_number":30,"context_line":""},{"line_number":31,"context_line":"    The ports are the ones that plumb into the integration bridge"},{"line_number":32,"context_line":"    \"\"\""},{"line_number":33,"context_line":"    return ((prefix + \u0027-int-\u0027 + port_id)["},{"line_number":34,"context_line":"                :constants.DEVICE_NAME_MAX_LEN])"}],"source_content_type":"text/x-python","patch_set":13,"id":"3ac371cc_e30d37e9","line":31,"in_reply_to":"3ac371cc_6651830e","updated":"2016-08-17 15:21:30.000000000","message":"Done","commit_id":"b4b90ac4ae8d259f503515456f91202ef25c60bb"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"6a89c25e5853c1f019e26194f2341301d3a2c780","unresolved":false,"context_lines":[{"line_number":37,"context_line":"def get_br_trunk_port_name(prefix, port_id):"},{"line_number":38,"context_line":"    \"\"\"Return the OVS port names for the given port."},{"line_number":39,"context_line":""},{"line_number":40,"context_line":"    The ports are the ones that plumb into the trunk bridge"},{"line_number":41,"context_line":"    \"\"\""},{"line_number":42,"context_line":"    return ((prefix + \u0027-trunk-\u0027 + port_id)["},{"line_number":43,"context_line":"                :constants.DEVICE_NAME_MAX_LEN])"}],"source_content_type":"text/x-python","patch_set":13,"id":"3ac371cc_86759f99","line":40,"updated":"2016-08-16 16:12:25.000000000","message":"I\u0027d add a trailing period.","commit_id":"b4b90ac4ae8d259f503515456f91202ef25c60bb"},{"author":{"_account_id":13770,"name":"Adolfo Duarte","email":"adduarte@redhat.com","username":"adolfoduarte"},"change_message_id":"5e4a23111ebdbcab71fcc366874c21533295882e","unresolved":false,"context_lines":[{"line_number":37,"context_line":"def get_br_trunk_port_name(prefix, port_id):"},{"line_number":38,"context_line":"    \"\"\"Return the OVS port names for the given port."},{"line_number":39,"context_line":""},{"line_number":40,"context_line":"    The ports are the ones that plumb into the trunk bridge"},{"line_number":41,"context_line":"    \"\"\""},{"line_number":42,"context_line":"    return ((prefix + \u0027-trunk-\u0027 + port_id)["},{"line_number":43,"context_line":"                :constants.DEVICE_NAME_MAX_LEN])"}],"source_content_type":"text/x-python","patch_set":13,"id":"3ac371cc_936e6d94","line":40,"range":{"start_line":40,"start_character":4,"end_line":40,"end_character":59},"updated":"2016-08-16 22:31:04.000000000","message":"same comments as above. also perhaps change to just: \ngenerates port name from prefix and port_id","commit_id":"b4b90ac4ae8d259f503515456f91202ef25c60bb"},{"author":{"_account_id":8655,"name":"Jakub Libosvar","email":"libosvar@redhat.com","username":"jlibosva"},"change_message_id":"c6b9494981dc46186b48a2b37b847c0b2065cde6","unresolved":false,"context_lines":[{"line_number":37,"context_line":"def get_br_trunk_port_name(prefix, port_id):"},{"line_number":38,"context_line":"    \"\"\"Return the OVS port names for the given port."},{"line_number":39,"context_line":""},{"line_number":40,"context_line":"    The ports are the ones that plumb into the trunk bridge"},{"line_number":41,"context_line":"    \"\"\""},{"line_number":42,"context_line":"    return ((prefix + \u0027-trunk-\u0027 + port_id)["},{"line_number":43,"context_line":"                :constants.DEVICE_NAME_MAX_LEN])"}],"source_content_type":"text/x-python","patch_set":13,"id":"3ac371cc_063a21cc","line":40,"in_reply_to":"3ac371cc_86759f99","updated":"2016-08-17 15:21:30.000000000","message":"Done","commit_id":"b4b90ac4ae8d259f503515456f91202ef25c60bb"},{"author":{"_account_id":8655,"name":"Jakub Libosvar","email":"libosvar@redhat.com","username":"jlibosva"},"change_message_id":"c6b9494981dc46186b48a2b37b847c0b2065cde6","unresolved":false,"context_lines":[{"line_number":37,"context_line":"def get_br_trunk_port_name(prefix, port_id):"},{"line_number":38,"context_line":"    \"\"\"Return the OVS port names for the given port."},{"line_number":39,"context_line":""},{"line_number":40,"context_line":"    The ports are the ones that plumb into the trunk bridge"},{"line_number":41,"context_line":"    \"\"\""},{"line_number":42,"context_line":"    return ((prefix + \u0027-trunk-\u0027 + port_id)["},{"line_number":43,"context_line":"                :constants.DEVICE_NAME_MAX_LEN])"}],"source_content_type":"text/x-python","patch_set":13,"id":"3ac371cc_663315f7","line":40,"range":{"start_line":40,"start_character":4,"end_line":40,"end_character":59},"in_reply_to":"3ac371cc_936e6d94","updated":"2016-08-17 15:21:30.000000000","message":"Done","commit_id":"b4b90ac4ae8d259f503515456f91202ef25c60bb"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"6a89c25e5853c1f019e26194f2341301d3a2c780","unresolved":false,"context_lines":[{"line_number":58,"context_line":"    def __init__(self, trunk_id, port_id):"},{"line_number":59,"context_line":"        self.trunk_id \u003d trunk_id"},{"line_number":60,"context_line":"        self.port_id \u003d port_id"},{"line_number":61,"context_line":"        self.trunk_bridge \u003d TrunkBridge(self.trunk_id)"},{"line_number":62,"context_line":""},{"line_number":63,"context_line":"    @property"},{"line_number":64,"context_line":"    def patch_port_int_name(self):"}],"source_content_type":"text/x-python","patch_set":13,"id":"3ac371cc_e68573ad","line":61,"updated":"2016-08-16 16:12:25.000000000","message":"could this be more readable if it were just \u0027bridge\u0027?","commit_id":"b4b90ac4ae8d259f503515456f91202ef25c60bb"},{"author":{"_account_id":8655,"name":"Jakub Libosvar","email":"libosvar@redhat.com","username":"jlibosva"},"change_message_id":"c6b9494981dc46186b48a2b37b847c0b2065cde6","unresolved":false,"context_lines":[{"line_number":58,"context_line":"    def __init__(self, trunk_id, port_id):"},{"line_number":59,"context_line":"        self.trunk_id \u003d trunk_id"},{"line_number":60,"context_line":"        self.port_id \u003d port_id"},{"line_number":61,"context_line":"        self.trunk_bridge \u003d TrunkBridge(self.trunk_id)"},{"line_number":62,"context_line":""},{"line_number":63,"context_line":"    @property"},{"line_number":64,"context_line":"    def patch_port_int_name(self):"}],"source_content_type":"text/x-python","patch_set":13,"id":"3ac371cc_26e0fd28","line":61,"in_reply_to":"3ac371cc_e68573ad","updated":"2016-08-17 15:21:30.000000000","message":"Done","commit_id":"b4b90ac4ae8d259f503515456f91202ef25c60bb"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"6a89c25e5853c1f019e26194f2341301d3a2c780","unresolved":false,"context_lines":[{"line_number":75,"context_line":"        self.trunk_id \u003d trunk_id"},{"line_number":76,"context_line":"        self.port_id \u003d port_id"},{"line_number":77,"context_line":"        self.segmentation_id \u003d segmentation_id"},{"line_number":78,"context_line":"        self.trunk_bridge \u003d TrunkBridge(self.trunk_id)"},{"line_number":79,"context_line":""},{"line_number":80,"context_line":"    @property"},{"line_number":81,"context_line":"    def patch_port_int_name(self):"}],"source_content_type":"text/x-python","patch_set":13,"id":"3ac371cc_8183c955","line":78,"updated":"2016-08-16 16:12:25.000000000","message":"consider dropping trunk_ for readability.","commit_id":"b4b90ac4ae8d259f503515456f91202ef25c60bb"},{"author":{"_account_id":8655,"name":"Jakub Libosvar","email":"libosvar@redhat.com","username":"jlibosva"},"change_message_id":"c6b9494981dc46186b48a2b37b847c0b2065cde6","unresolved":false,"context_lines":[{"line_number":75,"context_line":"        self.trunk_id \u003d trunk_id"},{"line_number":76,"context_line":"        self.port_id \u003d port_id"},{"line_number":77,"context_line":"        self.segmentation_id \u003d segmentation_id"},{"line_number":78,"context_line":"        self.trunk_bridge \u003d TrunkBridge(self.trunk_id)"},{"line_number":79,"context_line":""},{"line_number":80,"context_line":"    @property"},{"line_number":81,"context_line":"    def patch_port_int_name(self):"}],"source_content_type":"text/x-python","patch_set":13,"id":"3ac371cc_0672217b","line":78,"in_reply_to":"3ac371cc_8183c955","updated":"2016-08-17 15:21:30.000000000","message":"I squashed those two object as they are very similar.","commit_id":"b4b90ac4ae8d259f503515456f91202ef25c60bb"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"6a89c25e5853c1f019e26194f2341301d3a2c780","unresolved":false,"context_lines":[{"line_number":93,"context_line":""},{"line_number":94,"context_line":"    def create_trunk(self, trunk_id, port_id, port_mac):"},{"line_number":95,"context_line":"        \"\"\"Create the trunk"},{"line_number":96,"context_line":""},{"line_number":97,"context_line":"        @param trunk_id: id of the trunk"},{"line_number":98,"context_line":"        @param port_id: id of the parent port"},{"line_number":99,"context_line":"        @param port_mac: the MAC address of the parent port"}],"source_content_type":"text/x-python","patch_set":13,"id":"3ac371cc_c6de773e","line":96,"updated":"2016-08-16 16:12:25.000000000","message":"Shall be more specific to what this create operation entails? I.e. this patches the bridge for trunk_id with with the integration bridge by means of parent port identified by port_id","commit_id":"b4b90ac4ae8d259f503515456f91202ef25c60bb"},{"author":{"_account_id":8655,"name":"Jakub Libosvar","email":"libosvar@redhat.com","username":"jlibosva"},"change_message_id":"c6b9494981dc46186b48a2b37b847c0b2065cde6","unresolved":false,"context_lines":[{"line_number":93,"context_line":""},{"line_number":94,"context_line":"    def create_trunk(self, trunk_id, port_id, port_mac):"},{"line_number":95,"context_line":"        \"\"\"Create the trunk"},{"line_number":96,"context_line":""},{"line_number":97,"context_line":"        @param trunk_id: id of the trunk"},{"line_number":98,"context_line":"        @param port_id: id of the parent port"},{"line_number":99,"context_line":"        @param port_mac: the MAC address of the parent port"}],"source_content_type":"text/x-python","patch_set":13,"id":"3ac371cc_d7c8b1aa","line":96,"in_reply_to":"3ac371cc_c6de773e","updated":"2016-08-17 15:21:30.000000000","message":"Copy\u0026pasted","commit_id":"b4b90ac4ae8d259f503515456f91202ef25c60bb"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"6a89c25e5853c1f019e26194f2341301d3a2c780","unresolved":false,"context_lines":[{"line_number":94,"context_line":"    def create_trunk(self, trunk_id, port_id, port_mac):"},{"line_number":95,"context_line":"        \"\"\"Create the trunk"},{"line_number":96,"context_line":""},{"line_number":97,"context_line":"        @param trunk_id: id of the trunk"},{"line_number":98,"context_line":"        @param port_id: id of the parent port"},{"line_number":99,"context_line":"        @param port_mac: the MAC address of the parent port"},{"line_number":100,"context_line":""}],"source_content_type":"text/x-python","patch_set":13,"id":"3ac371cc_86eabf0d","line":97,"updated":"2016-08-16 16:12:25.000000000","message":"trailing periods?","commit_id":"b4b90ac4ae8d259f503515456f91202ef25c60bb"},{"author":{"_account_id":8655,"name":"Jakub Libosvar","email":"libosvar@redhat.com","username":"jlibosva"},"change_message_id":"c6b9494981dc46186b48a2b37b847c0b2065cde6","unresolved":false,"context_lines":[{"line_number":94,"context_line":"    def create_trunk(self, trunk_id, port_id, port_mac):"},{"line_number":95,"context_line":"        \"\"\"Create the trunk"},{"line_number":96,"context_line":""},{"line_number":97,"context_line":"        @param trunk_id: id of the trunk"},{"line_number":98,"context_line":"        @param port_id: id of the parent port"},{"line_number":99,"context_line":"        @param port_mac: the MAC address of the parent port"},{"line_number":100,"context_line":""}],"source_content_type":"text/x-python","patch_set":13,"id":"3ac371cc_46c0992a","line":97,"in_reply_to":"3ac371cc_86eabf0d","updated":"2016-08-17 15:21:30.000000000","message":"Done, also changed the format so it fits the rest of neutron code.","commit_id":"b4b90ac4ae8d259f503515456f91202ef25c60bb"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"6a89c25e5853c1f019e26194f2341301d3a2c780","unresolved":false,"context_lines":[{"line_number":97,"context_line":"        @param trunk_id: id of the trunk"},{"line_number":98,"context_line":"        @param port_id: id of the parent port"},{"line_number":99,"context_line":"        @param port_mac: the MAC address of the parent port"},{"line_number":100,"context_line":""},{"line_number":101,"context_line":"        \"\"\""},{"line_number":102,"context_line":"        trunk \u003d Trunk(trunk_id, port_id)"},{"line_number":103,"context_line":"        if not trunk.trunk_bridge.exists():"}],"source_content_type":"text/x-python","patch_set":13,"id":"3ac371cc_66d4e346","line":100,"updated":"2016-08-16 16:12:25.000000000","message":"wanna document that this raises if the OVS bridge does not exist?","commit_id":"b4b90ac4ae8d259f503515456f91202ef25c60bb"},{"author":{"_account_id":8655,"name":"Jakub Libosvar","email":"libosvar@redhat.com","username":"jlibosva"},"change_message_id":"c6b9494981dc46186b48a2b37b847c0b2065cde6","unresolved":false,"context_lines":[{"line_number":97,"context_line":"        @param trunk_id: id of the trunk"},{"line_number":98,"context_line":"        @param port_id: id of the parent port"},{"line_number":99,"context_line":"        @param port_mac: the MAC address of the parent port"},{"line_number":100,"context_line":""},{"line_number":101,"context_line":"        \"\"\""},{"line_number":102,"context_line":"        trunk \u003d Trunk(trunk_id, port_id)"},{"line_number":103,"context_line":"        if not trunk.trunk_bridge.exists():"}],"source_content_type":"text/x-python","patch_set":13,"id":"3ac371cc_9cbe6063","line":100,"in_reply_to":"3ac371cc_66d4e346","updated":"2016-08-17 15:21:30.000000000","message":"Done","commit_id":"b4b90ac4ae8d259f503515456f91202ef25c60bb"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"6a89c25e5853c1f019e26194f2341301d3a2c780","unresolved":false,"context_lines":[{"line_number":100,"context_line":""},{"line_number":101,"context_line":"        \"\"\""},{"line_number":102,"context_line":"        trunk \u003d Trunk(trunk_id, port_id)"},{"line_number":103,"context_line":"        if not trunk.trunk_bridge.exists():"},{"line_number":104,"context_line":"            raise exc.TrunkBridgeNotFound(trunk_id\u003dtrunk_id)"},{"line_number":105,"context_line":"        # The agent main loop won\u0027t process the trunk since the parent port is"},{"line_number":106,"context_line":"        # on the trunk bridge, not on the br-int."}],"source_content_type":"text/x-python","patch_set":13,"id":"3ac371cc_86bd9f6a","line":103,"updated":"2016-08-16 16:12:25.000000000","message":"if we dropped the trunk_ this would read slightly better.","commit_id":"b4b90ac4ae8d259f503515456f91202ef25c60bb"},{"author":{"_account_id":8655,"name":"Jakub Libosvar","email":"libosvar@redhat.com","username":"jlibosva"},"change_message_id":"c6b9494981dc46186b48a2b37b847c0b2065cde6","unresolved":false,"context_lines":[{"line_number":100,"context_line":""},{"line_number":101,"context_line":"        \"\"\""},{"line_number":102,"context_line":"        trunk \u003d Trunk(trunk_id, port_id)"},{"line_number":103,"context_line":"        if not trunk.trunk_bridge.exists():"},{"line_number":104,"context_line":"            raise exc.TrunkBridgeNotFound(trunk_id\u003dtrunk_id)"},{"line_number":105,"context_line":"        # The agent main loop won\u0027t process the trunk since the parent port is"},{"line_number":106,"context_line":"        # on the trunk bridge, not on the br-int."}],"source_content_type":"text/x-python","patch_set":13,"id":"3ac371cc_5754c1c8","line":103,"in_reply_to":"3ac371cc_86bd9f6a","updated":"2016-08-17 15:21:30.000000000","message":"Done","commit_id":"b4b90ac4ae8d259f503515456f91202ef25c60bb"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"6a89c25e5853c1f019e26194f2341301d3a2c780","unresolved":false,"context_lines":[{"line_number":112,"context_line":"        # network). When the patch port is wired, the OVS agent will send a"},{"line_number":113,"context_line":"        #  notification that the device is up, since it\u0027s using the"},{"line_number":114,"context_line":"        # same interface ID as the parent port, Nova will receive it and assume"},{"line_number":115,"context_line":"        # that the parent port is UP."},{"line_number":116,"context_line":"        patch_int_attrs \u003d [(\u0027type\u0027, \u0027patch\u0027),"},{"line_number":117,"context_line":"                           (\u0027options\u0027, {\u0027peer\u0027: trunk.patch_port_trunk_name}),"},{"line_number":118,"context_line":"                           (\u0027external_ids\u0027,"}],"source_content_type":"text/x-python","patch_set":13,"id":"3ac371cc_261dcbbd","line":115,"updated":"2016-08-16 16:12:25.000000000","message":"This long comment may get in the way of readability of this method. Perhaps this may be summarize it a bit? What about:\n\nOnce the bridges are connected with the following patch ports, the OVS will recognize the ports for processing and it will take over the wiring process and everything that entails.\nNOTE(rossella_s): revisit this integration part, should tighter control over the wiring logic for trunk ports be required.","commit_id":"b4b90ac4ae8d259f503515456f91202ef25c60bb"},{"author":{"_account_id":8655,"name":"Jakub Libosvar","email":"libosvar@redhat.com","username":"jlibosva"},"change_message_id":"c6b9494981dc46186b48a2b37b847c0b2065cde6","unresolved":false,"context_lines":[{"line_number":112,"context_line":"        # network). When the patch port is wired, the OVS agent will send a"},{"line_number":113,"context_line":"        #  notification that the device is up, since it\u0027s using the"},{"line_number":114,"context_line":"        # same interface ID as the parent port, Nova will receive it and assume"},{"line_number":115,"context_line":"        # that the parent port is UP."},{"line_number":116,"context_line":"        patch_int_attrs \u003d [(\u0027type\u0027, \u0027patch\u0027),"},{"line_number":117,"context_line":"                           (\u0027options\u0027, {\u0027peer\u0027: trunk.patch_port_trunk_name}),"},{"line_number":118,"context_line":"                           (\u0027external_ids\u0027,"}],"source_content_type":"text/x-python","patch_set":13,"id":"3ac371cc_17752963","line":115,"in_reply_to":"3ac371cc_261dcbbd","updated":"2016-08-17 15:21:30.000000000","message":"Copy\u0026pasted","commit_id":"b4b90ac4ae8d259f503515456f91202ef25c60bb"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"6a89c25e5853c1f019e26194f2341301d3a2c780","unresolved":false,"context_lines":[{"line_number":117,"context_line":"                           (\u0027options\u0027, {\u0027peer\u0027: trunk.patch_port_trunk_name}),"},{"line_number":118,"context_line":"                           (\u0027external_ids\u0027,"},{"line_number":119,"context_line":"                            {\u0027attached-mac\u0027: port_mac,"},{"line_number":120,"context_line":"                             \u0027iface-id\u0027: port_id})]"},{"line_number":121,"context_line":"        self.br_int.add_port(trunk.patch_port_int_name, *patch_int_attrs)"},{"line_number":122,"context_line":""},{"line_number":123,"context_line":"        trunk.trunk_bridge.add_patch_port(trunk.patch_port_trunk_name,"}],"source_content_type":"text/x-python","patch_set":13,"id":"3ac371cc_8100e902","line":120,"updated":"2016-08-16 16:12:25.000000000","message":"I\u0027d extract this marshalling into a util function to avoid repeating it twice, but twice we can still manage :)","commit_id":"b4b90ac4ae8d259f503515456f91202ef25c60bb"},{"author":{"_account_id":8655,"name":"Jakub Libosvar","email":"libosvar@redhat.com","username":"jlibosva"},"change_message_id":"c6b9494981dc46186b48a2b37b847c0b2065cde6","unresolved":false,"context_lines":[{"line_number":117,"context_line":"                           (\u0027options\u0027, {\u0027peer\u0027: trunk.patch_port_trunk_name}),"},{"line_number":118,"context_line":"                           (\u0027external_ids\u0027,"},{"line_number":119,"context_line":"                            {\u0027attached-mac\u0027: port_mac,"},{"line_number":120,"context_line":"                             \u0027iface-id\u0027: port_id})]"},{"line_number":121,"context_line":"        self.br_int.add_port(trunk.patch_port_int_name, *patch_int_attrs)"},{"line_number":122,"context_line":""},{"line_number":123,"context_line":"        trunk.trunk_bridge.add_patch_port(trunk.patch_port_trunk_name,"}],"source_content_type":"text/x-python","patch_set":13,"id":"3ac371cc_f77b2d26","line":120,"in_reply_to":"3ac371cc_8100e902","updated":"2016-08-17 15:21:30.000000000","message":"Done","commit_id":"b4b90ac4ae8d259f503515456f91202ef25c60bb"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"6a89c25e5853c1f019e26194f2341301d3a2c780","unresolved":false,"context_lines":[{"line_number":123,"context_line":"        trunk.trunk_bridge.add_patch_port(trunk.patch_port_trunk_name,"},{"line_number":124,"context_line":"                                          trunk.patch_port_int_name)"},{"line_number":125,"context_line":""},{"line_number":126,"context_line":"    def remove_trunk(self, trunk_id, port_id):"},{"line_number":127,"context_line":"        trunk \u003d Trunk(trunk_id, port_id)"},{"line_number":128,"context_line":"        if trunk.trunk_bridge.exists():"},{"line_number":129,"context_line":"            trunk.trunk_bridge.destroy()"}],"source_content_type":"text/x-python","patch_set":13,"id":"3ac371cc_066fef2b","line":126,"updated":"2016-08-16 16:12:25.000000000","message":"forgot the docstring?","commit_id":"b4b90ac4ae8d259f503515456f91202ef25c60bb"},{"author":{"_account_id":8655,"name":"Jakub Libosvar","email":"libosvar@redhat.com","username":"jlibosva"},"change_message_id":"c6b9494981dc46186b48a2b37b847c0b2065cde6","unresolved":false,"context_lines":[{"line_number":123,"context_line":"        trunk.trunk_bridge.add_patch_port(trunk.patch_port_trunk_name,"},{"line_number":124,"context_line":"                                          trunk.patch_port_int_name)"},{"line_number":125,"context_line":""},{"line_number":126,"context_line":"    def remove_trunk(self, trunk_id, port_id):"},{"line_number":127,"context_line":"        trunk \u003d Trunk(trunk_id, port_id)"},{"line_number":128,"context_line":"        if trunk.trunk_bridge.exists():"},{"line_number":129,"context_line":"            trunk.trunk_bridge.destroy()"}],"source_content_type":"text/x-python","patch_set":13,"id":"3ac371cc_f7c96d5a","line":126,"in_reply_to":"3ac371cc_066fef2b","updated":"2016-08-17 15:21:30.000000000","message":"Done","commit_id":"b4b90ac4ae8d259f503515456f91202ef25c60bb"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"6a89c25e5853c1f019e26194f2341301d3a2c780","unresolved":false,"context_lines":[{"line_number":125,"context_line":""},{"line_number":126,"context_line":"    def remove_trunk(self, trunk_id, port_id):"},{"line_number":127,"context_line":"        trunk \u003d Trunk(trunk_id, port_id)"},{"line_number":128,"context_line":"        if trunk.trunk_bridge.exists():"},{"line_number":129,"context_line":"            trunk.trunk_bridge.destroy()"},{"line_number":130,"context_line":""},{"line_number":131,"context_line":"    def add_sub_port(self, trunk_id, port_id, segmentation_id, port_mac):"}],"source_content_type":"text/x-python","patch_set":13,"id":"3ac371cc_46ac4734","line":128,"updated":"2016-08-16 16:12:25.000000000","message":"so this one.","commit_id":"b4b90ac4ae8d259f503515456f91202ef25c60bb"},{"author":{"_account_id":8655,"name":"Jakub Libosvar","email":"libosvar@redhat.com","username":"jlibosva"},"change_message_id":"c6b9494981dc46186b48a2b37b847c0b2065cde6","unresolved":false,"context_lines":[{"line_number":125,"context_line":""},{"line_number":126,"context_line":"    def remove_trunk(self, trunk_id, port_id):"},{"line_number":127,"context_line":"        trunk \u003d Trunk(trunk_id, port_id)"},{"line_number":128,"context_line":"        if trunk.trunk_bridge.exists():"},{"line_number":129,"context_line":"            trunk.trunk_bridge.destroy()"},{"line_number":130,"context_line":""},{"line_number":131,"context_line":"    def add_sub_port(self, trunk_id, port_id, segmentation_id, port_mac):"}],"source_content_type":"text/x-python","patch_set":13,"id":"3ac371cc_57c32138","line":128,"in_reply_to":"3ac371cc_46ac4734","updated":"2016-08-17 15:21:30.000000000","message":"Done","commit_id":"b4b90ac4ae8d259f503515456f91202ef25c60bb"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"6a89c25e5853c1f019e26194f2341301d3a2c780","unresolved":false,"context_lines":[{"line_number":126,"context_line":"    def remove_trunk(self, trunk_id, port_id):"},{"line_number":127,"context_line":"        trunk \u003d Trunk(trunk_id, port_id)"},{"line_number":128,"context_line":"        if trunk.trunk_bridge.exists():"},{"line_number":129,"context_line":"            trunk.trunk_bridge.destroy()"},{"line_number":130,"context_line":""},{"line_number":131,"context_line":"    def add_sub_port(self, trunk_id, port_id, segmentation_id, port_mac):"},{"line_number":132,"context_line":"        \"\"\"Create a sub_port"}],"source_content_type":"text/x-python","patch_set":13,"id":"3ac371cc_8632bf0e","line":129,"updated":"2016-08-16 16:12:25.000000000","message":"wanna log a debug statement in case the port is gone already?","commit_id":"b4b90ac4ae8d259f503515456f91202ef25c60bb"},{"author":{"_account_id":8655,"name":"Jakub Libosvar","email":"libosvar@redhat.com","username":"jlibosva"},"change_message_id":"c6b9494981dc46186b48a2b37b847c0b2065cde6","unresolved":false,"context_lines":[{"line_number":126,"context_line":"    def remove_trunk(self, trunk_id, port_id):"},{"line_number":127,"context_line":"        trunk \u003d Trunk(trunk_id, port_id)"},{"line_number":128,"context_line":"        if trunk.trunk_bridge.exists():"},{"line_number":129,"context_line":"            trunk.trunk_bridge.destroy()"},{"line_number":130,"context_line":""},{"line_number":131,"context_line":"    def add_sub_port(self, trunk_id, port_id, segmentation_id, port_mac):"},{"line_number":132,"context_line":"        \"\"\"Create a sub_port"}],"source_content_type":"text/x-python","patch_set":13,"id":"3ac371cc_77329d60","line":129,"in_reply_to":"3ac371cc_8632bf0e","updated":"2016-08-17 15:21:30.000000000","message":"Done","commit_id":"b4b90ac4ae8d259f503515456f91202ef25c60bb"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"6a89c25e5853c1f019e26194f2341301d3a2c780","unresolved":false,"context_lines":[{"line_number":131,"context_line":"    def add_sub_port(self, trunk_id, port_id, segmentation_id, port_mac):"},{"line_number":132,"context_line":"        \"\"\"Create a sub_port"},{"line_number":133,"context_line":""},{"line_number":134,"context_line":"        @param trunk_id: id of the trunk"},{"line_number":135,"context_line":"        @param port_id: id of the parent port"},{"line_number":136,"context_line":"        @segmentation_id: segmentation id associated with this sub-port"},{"line_number":137,"context_line":"        @param port_mac: MAC address of the parent port"}],"source_content_type":"text/x-python","patch_set":13,"id":"3ac371cc_e621f3b5","line":134,"updated":"2016-08-16 16:12:25.000000000","message":"trailing periods?","commit_id":"b4b90ac4ae8d259f503515456f91202ef25c60bb"},{"author":{"_account_id":8655,"name":"Jakub Libosvar","email":"libosvar@redhat.com","username":"jlibosva"},"change_message_id":"c6b9494981dc46186b48a2b37b847c0b2065cde6","unresolved":false,"context_lines":[{"line_number":131,"context_line":"    def add_sub_port(self, trunk_id, port_id, segmentation_id, port_mac):"},{"line_number":132,"context_line":"        \"\"\"Create a sub_port"},{"line_number":133,"context_line":""},{"line_number":134,"context_line":"        @param trunk_id: id of the trunk"},{"line_number":135,"context_line":"        @param port_id: id of the parent port"},{"line_number":136,"context_line":"        @segmentation_id: segmentation id associated with this sub-port"},{"line_number":137,"context_line":"        @param port_mac: MAC address of the parent port"}],"source_content_type":"text/x-python","patch_set":13,"id":"3ac371cc_d758b18c","line":134,"in_reply_to":"3ac371cc_e621f3b5","updated":"2016-08-17 15:21:30.000000000","message":"Done","commit_id":"b4b90ac4ae8d259f503515456f91202ef25c60bb"},{"author":{"_account_id":16800,"name":"Rawlin Peters","email":"rawlin.peters@hpe.com","username":"rawlin"},"change_message_id":"159ffc3a726fd087615ae5226e15cc7cbddc13fe","unresolved":false,"context_lines":[{"line_number":132,"context_line":"        \"\"\"Create a sub_port"},{"line_number":133,"context_line":""},{"line_number":134,"context_line":"        @param trunk_id: id of the trunk"},{"line_number":135,"context_line":"        @param port_id: id of the parent port"},{"line_number":136,"context_line":"        @segmentation_id: segmentation id associated with this sub-port"},{"line_number":137,"context_line":"        @param port_mac: MAC address of the parent port"},{"line_number":138,"context_line":""}],"source_content_type":"text/x-python","patch_set":13,"id":"3ac371cc_01a519a1","line":135,"range":{"start_line":135,"start_character":34,"end_line":135,"end_character":40},"updated":"2016-08-16 16:24:31.000000000","message":"I think this should be \"child\" because it\u0027s referring to the subport, whereas the untagged trunk port is the \"parent port\".","commit_id":"b4b90ac4ae8d259f503515456f91202ef25c60bb"},{"author":{"_account_id":8655,"name":"Jakub Libosvar","email":"libosvar@redhat.com","username":"jlibosva"},"change_message_id":"c6b9494981dc46186b48a2b37b847c0b2065cde6","unresolved":false,"context_lines":[{"line_number":132,"context_line":"        \"\"\"Create a sub_port"},{"line_number":133,"context_line":""},{"line_number":134,"context_line":"        @param trunk_id: id of the trunk"},{"line_number":135,"context_line":"        @param port_id: id of the parent port"},{"line_number":136,"context_line":"        @segmentation_id: segmentation id associated with this sub-port"},{"line_number":137,"context_line":"        @param port_mac: MAC address of the parent port"},{"line_number":138,"context_line":""}],"source_content_type":"text/x-python","patch_set":13,"id":"3ac371cc_b75d357b","line":135,"range":{"start_line":135,"start_character":34,"end_line":135,"end_character":40},"in_reply_to":"3ac371cc_01a519a1","updated":"2016-08-17 15:21:30.000000000","message":"Done","commit_id":"b4b90ac4ae8d259f503515456f91202ef25c60bb"},{"author":{"_account_id":16800,"name":"Rawlin Peters","email":"rawlin.peters@hpe.com","username":"rawlin"},"change_message_id":"159ffc3a726fd087615ae5226e15cc7cbddc13fe","unresolved":false,"context_lines":[{"line_number":134,"context_line":"        @param trunk_id: id of the trunk"},{"line_number":135,"context_line":"        @param port_id: id of the parent port"},{"line_number":136,"context_line":"        @segmentation_id: segmentation id associated with this sub-port"},{"line_number":137,"context_line":"        @param port_mac: MAC address of the parent port"},{"line_number":138,"context_line":""},{"line_number":139,"context_line":"        \"\"\""},{"line_number":140,"context_line":"        sub_port \u003d SubPort(trunk_id, port_id, segmentation_id)"}],"source_content_type":"text/x-python","patch_set":13,"id":"3ac371cc_21aad570","line":137,"range":{"start_line":137,"start_character":44,"end_line":137,"end_character":50},"updated":"2016-08-16 16:24:31.000000000","message":"ditto L135","commit_id":"b4b90ac4ae8d259f503515456f91202ef25c60bb"},{"author":{"_account_id":8655,"name":"Jakub Libosvar","email":"libosvar@redhat.com","username":"jlibosva"},"change_message_id":"c6b9494981dc46186b48a2b37b847c0b2065cde6","unresolved":false,"context_lines":[{"line_number":134,"context_line":"        @param trunk_id: id of the trunk"},{"line_number":135,"context_line":"        @param port_id: id of the parent port"},{"line_number":136,"context_line":"        @segmentation_id: segmentation id associated with this sub-port"},{"line_number":137,"context_line":"        @param port_mac: MAC address of the parent port"},{"line_number":138,"context_line":""},{"line_number":139,"context_line":"        \"\"\""},{"line_number":140,"context_line":"        sub_port \u003d SubPort(trunk_id, port_id, segmentation_id)"}],"source_content_type":"text/x-python","patch_set":13,"id":"3ac371cc_1757e958","line":137,"range":{"start_line":137,"start_character":44,"end_line":137,"end_character":50},"in_reply_to":"3ac371cc_21aad570","updated":"2016-08-17 15:21:30.000000000","message":"Done","commit_id":"b4b90ac4ae8d259f503515456f91202ef25c60bb"},{"author":{"_account_id":16800,"name":"Rawlin Peters","email":"rawlin.peters@hpe.com","username":"rawlin"},"change_message_id":"159ffc3a726fd087615ae5226e15cc7cbddc13fe","unresolved":false,"context_lines":[{"line_number":160,"context_line":"        \"\"\"Remove a sub_port"},{"line_number":161,"context_line":""},{"line_number":162,"context_line":"        @param trunk_id: id of the trunk"},{"line_number":163,"context_line":"        @param port_id: id of the parent port"},{"line_number":164,"context_line":"        \"\"\""},{"line_number":165,"context_line":"        sub_port \u003d SubPort(trunk_id, port_id)"},{"line_number":166,"context_line":""}],"source_content_type":"text/x-python","patch_set":13,"id":"3ac371cc_61084d92","line":163,"range":{"start_line":163,"start_character":34,"end_line":163,"end_character":40},"updated":"2016-08-16 16:24:31.000000000","message":"ditto L135","commit_id":"b4b90ac4ae8d259f503515456f91202ef25c60bb"},{"author":{"_account_id":8655,"name":"Jakub Libosvar","email":"libosvar@redhat.com","username":"jlibosva"},"change_message_id":"c6b9494981dc46186b48a2b37b847c0b2065cde6","unresolved":false,"context_lines":[{"line_number":160,"context_line":"        \"\"\"Remove a sub_port"},{"line_number":161,"context_line":""},{"line_number":162,"context_line":"        @param trunk_id: id of the trunk"},{"line_number":163,"context_line":"        @param port_id: id of the parent port"},{"line_number":164,"context_line":"        \"\"\""},{"line_number":165,"context_line":"        sub_port \u003d SubPort(trunk_id, port_id)"},{"line_number":166,"context_line":""}],"source_content_type":"text/x-python","patch_set":13,"id":"3ac371cc_57fb2147","line":163,"range":{"start_line":163,"start_character":34,"end_line":163,"end_character":40},"in_reply_to":"3ac371cc_61084d92","updated":"2016-08-17 15:21:30.000000000","message":"Done","commit_id":"b4b90ac4ae8d259f503515456f91202ef25c60bb"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"6a89c25e5853c1f019e26194f2341301d3a2c780","unresolved":false,"context_lines":[{"line_number":167,"context_line":"        # no need to process this if the trunk bridge was deleted"},{"line_number":168,"context_line":"        if sub_port.trunk_bridge.exists():"},{"line_number":169,"context_line":"            sub_port.trunk_bridge.delete_port(sub_port.patch_port_trunk_name)"},{"line_number":170,"context_line":"            self.br_int.delete_port(sub_port.patch_port_int_name)"}],"source_content_type":"text/x-python","patch_set":13,"id":"3ac371cc_619fadb4","line":170,"updated":"2016-08-16 16:12:25.000000000","message":"wanna log a debug statement for when a bridge is gone already?","commit_id":"b4b90ac4ae8d259f503515456f91202ef25c60bb"},{"author":{"_account_id":8655,"name":"Jakub Libosvar","email":"libosvar@redhat.com","username":"jlibosva"},"change_message_id":"c6b9494981dc46186b48a2b37b847c0b2065cde6","unresolved":false,"context_lines":[{"line_number":167,"context_line":"        # no need to process this if the trunk bridge was deleted"},{"line_number":168,"context_line":"        if sub_port.trunk_bridge.exists():"},{"line_number":169,"context_line":"            sub_port.trunk_bridge.delete_port(sub_port.patch_port_trunk_name)"},{"line_number":170,"context_line":"            self.br_int.delete_port(sub_port.patch_port_int_name)"}],"source_content_type":"text/x-python","patch_set":13,"id":"3ac371cc_378f85cd","line":170,"in_reply_to":"3ac371cc_619fadb4","updated":"2016-08-17 15:21:30.000000000","message":"Done","commit_id":"b4b90ac4ae8d259f503515456f91202ef25c60bb"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"523ad8d8bf969ffed667c1f787c3243a51bc67ca","unresolved":false,"context_lines":[{"line_number":119,"context_line":"        \"\"\"Remove the trunk bridge.\"\"\""},{"line_number":120,"context_line":"        trunk \u003d Trunk(trunk_id, port_id)"},{"line_number":121,"context_line":"        if trunk.bridge.exists():"},{"line_number":122,"context_line":"            trunk.bridge.destroy()"},{"line_number":123,"context_line":"        else:"},{"line_number":124,"context_line":"            LOG.debug(\"Trunk bridge with id %s doesn\u0027t exist.\", trunk_id)"},{"line_number":125,"context_line":""}],"source_content_type":"text/x-python","patch_set":14,"id":"3ac371cc_1b71b6a8","line":122,"updated":"2016-08-17 21:06:53.000000000","message":"Taking the comments below into consideration, we may want to make this symmetric to create_trunk: if create_trunk is doing br_int.add_port we should do the opposite in remove trunk.\n\nOne thing worth mentioning is error handling all over this class. Do we let OVS errors bubble up? Or is there any error handling that can be done here locally? I think we should think harder about the failure modes involved. For instance, if we fail adding a patch port on br-int do we roll back the bridge creation?","commit_id":"abab5a703c94f6658dc090da258e44fd1f1efeec"},{"author":{"_account_id":4187,"name":"Ryan Tidwell","email":"rtidwell@suse.com","username":"ryan-tidwell"},"change_message_id":"c19016661f96aa6e070ca9deda9723c4d13cd660","unresolved":false,"context_lines":[{"line_number":119,"context_line":"        \"\"\"Remove the trunk bridge.\"\"\""},{"line_number":120,"context_line":"        trunk \u003d Trunk(trunk_id, port_id)"},{"line_number":121,"context_line":"        if trunk.bridge.exists():"},{"line_number":122,"context_line":"            trunk.bridge.destroy()"},{"line_number":123,"context_line":"        else:"},{"line_number":124,"context_line":"            LOG.debug(\"Trunk bridge with id %s doesn\u0027t exist.\", trunk_id)"},{"line_number":125,"context_line":""}],"source_content_type":"text/x-python","patch_set":14,"id":"3ac371cc_7c08a1da","line":122,"in_reply_to":"3ac371cc_1b71b6a8","updated":"2016-08-17 21:24:15.000000000","message":"I\u0027m not sure how we would rollback bridge creation since os-vif is creating the trunk bridge. However, I think it would be reasonable in such a case to mark the trunk in ERROR state and report that back to Nova somehow (Nova will eventually timeout if we never wire the patch ports for the trunk to br-int). Where we can I think attempting to wrap things like patch port pair create/remove in ovsdb transactions would be a nice touch.\n\nI would need to stew on it a little more, but my initial thought is that any OVS errors result in the trunk going to ERROR or DEGRADED state (ERROR for trunk wiring errors and DEGRADED for subport wiring failures). Debugging this could still become a nightmare as we don\u0027t have a way to expose the details of what failed to the user. Currently, the user would only see the trunk move to an ERROR or DEGRADED state without any information as to why. Combing through log files would be the only way to debug at the moment, and that\u0027s not fun to do. Maybe we can punt on those details on our first pass though.","commit_id":"abab5a703c94f6658dc090da258e44fd1f1efeec"},{"author":{"_account_id":16800,"name":"Rawlin Peters","email":"rawlin.peters@hpe.com","username":"rawlin"},"change_message_id":"517eb05ffcd5840ae83f434fa8bbca807860d443","unresolved":false,"context_lines":[{"line_number":119,"context_line":"        \"\"\"Remove the trunk bridge.\"\"\""},{"line_number":120,"context_line":"        trunk \u003d Trunk(trunk_id, port_id)"},{"line_number":121,"context_line":"        if trunk.bridge.exists():"},{"line_number":122,"context_line":"            trunk.bridge.destroy()"},{"line_number":123,"context_line":"        else:"},{"line_number":124,"context_line":"            LOG.debug(\"Trunk bridge with id %s doesn\u0027t exist.\", trunk_id)"},{"line_number":125,"context_line":""}],"source_content_type":"text/x-python","patch_set":14,"id":"3ac371cc_0b24c15b","line":122,"in_reply_to":"3ac371cc_255d6c15","updated":"2016-08-17 23:04:26.000000000","message":"Let\u0027s wrap the creation of patch port pairs into a single ovsdb transaction. If the \u0027tp\u0027 patch port pair creation fails, it should bubble up to the caller (ovsdb_handler). The ovsdb_handler would then set the trunk state to ERROR.\n\nIf an \u0027sp\u0027 patch port pair creation fails, it will bubble up to the ovsdb_handler, and it would set the trunk state to DEGRADED.\n\nBy having them done as a transaction, there are no partial failures.\n\nNow, if trunk bridge/\u0027tp\u0027 patch port pair deletion fails, we could also bubble it up to the ovsdb_handler, but I don\u0027t think the ovsdb_handler could take any action on that except for maybe logging the error and returning. Maybe we could periodically reattempt to delete the stale trunk bridge/patch ports somehow? What kind of error handling does the LB agent do in this scenario when it fails to delete a network bridge?","commit_id":"abab5a703c94f6658dc090da258e44fd1f1efeec"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"f6ee6848fa0cff26793820ccdc022aad19c3286b","unresolved":false,"context_lines":[{"line_number":119,"context_line":"        \"\"\"Remove the trunk bridge.\"\"\""},{"line_number":120,"context_line":"        trunk \u003d Trunk(trunk_id, port_id)"},{"line_number":121,"context_line":"        if trunk.bridge.exists():"},{"line_number":122,"context_line":"            trunk.bridge.destroy()"},{"line_number":123,"context_line":"        else:"},{"line_number":124,"context_line":"            LOG.debug(\"Trunk bridge with id %s doesn\u0027t exist.\", trunk_id)"},{"line_number":125,"context_line":""}],"source_content_type":"text/x-python","patch_set":14,"id":"3ac371cc_255d6c15","line":122,"in_reply_to":"3ac371cc_7c08a1da","updated":"2016-08-17 22:27:13.000000000","message":"Sorry, I meant if 115 fails we should undo line 113.\n\nAs for your troubleshooting, how is this any different from my instance booted but it\u0027s in error state? There are obviously more use cases where lack of admin access makes troubleshooting complicated and the ultimate recovery action is \u0027retry\u0027 and hope for the best. Your point is well take though. Troubleshooting is something we wanted to address in Newton [1], and having something that can give more insight into what went wrong applies to trunk as much as any other resource that Neutron is in charge of.\n\nI don\u0027t believe that punting is the right thing to do though: we\u0027re surely gonna hit these issues and not dealing with these means we\u0027re gonna ship something flaky.\n\n[1] https://blueprints.launchpad.net/neutron/+spec/troubleshooting","commit_id":"abab5a703c94f6658dc090da258e44fd1f1efeec"},{"author":{"_account_id":4187,"name":"Ryan Tidwell","email":"rtidwell@suse.com","username":"ryan-tidwell"},"change_message_id":"41b7042315bbc7f0ca711ebc1fd6b3d51508f2c6","unresolved":false,"context_lines":[{"line_number":121,"context_line":"        if trunk.bridge.exists():"},{"line_number":122,"context_line":"            trunk.bridge.destroy()"},{"line_number":123,"context_line":"        else:"},{"line_number":124,"context_line":"            LOG.debug(\"Trunk bridge with id %s doesn\u0027t exist.\", trunk_id)"},{"line_number":125,"context_line":""},{"line_number":126,"context_line":"    def add_sub_port(self, trunk_id, port_id, segmentation_id, port_mac):"},{"line_number":127,"context_line":"        \"\"\"Create a sub_port."}],"source_content_type":"text/x-python","patch_set":14,"id":"3ac371cc_84da70e6","line":124,"updated":"2016-08-17 18:13:09.000000000","message":"We destroy the trunk bridge here and the patch port originating from it is destroyed. However, I\u0027m observing that the patch port on the br-int side will be left around. I think we need to destroy that patch port when we destory the bridge.","commit_id":"abab5a703c94f6658dc090da258e44fd1f1efeec"},{"author":{"_account_id":16800,"name":"Rawlin Peters","email":"rawlin.peters@hpe.com","username":"rawlin"},"change_message_id":"4e1aef123e5683cd838178a3b8a7953fcf04de9e","unresolved":false,"context_lines":[{"line_number":121,"context_line":"        if trunk.bridge.exists():"},{"line_number":122,"context_line":"            trunk.bridge.destroy()"},{"line_number":123,"context_line":"        else:"},{"line_number":124,"context_line":"            LOG.debug(\"Trunk bridge with id %s doesn\u0027t exist.\", trunk_id)"},{"line_number":125,"context_line":""},{"line_number":126,"context_line":"    def add_sub_port(self, trunk_id, port_id, segmentation_id, port_mac):"},{"line_number":127,"context_line":"        \"\"\"Create a sub_port."}],"source_content_type":"text/x-python","patch_set":14,"id":"3ac371cc_b4b99717","line":124,"in_reply_to":"3ac371cc_84da70e6","updated":"2016-08-17 19:04:22.000000000","message":"The ovsdb_handler does that [1] before calling this method, but it does seem like that logic could belong to the TrunkManager rather than the ovsdb_handler. I\u0027m kind of on the fence there...\n\n[1] https://review.openstack.org/#/c/347466/3/neutron/services/trunk/drivers/openvswitch/agent/ovsdb_handler.py@84","commit_id":"abab5a703c94f6658dc090da258e44fd1f1efeec"},{"author":{"_account_id":4187,"name":"Ryan Tidwell","email":"rtidwell@suse.com","username":"ryan-tidwell"},"change_message_id":"9bfec86a5b07a5c9627992164c13b67a66efa3ce","unresolved":false,"context_lines":[{"line_number":121,"context_line":"        if trunk.bridge.exists():"},{"line_number":122,"context_line":"            trunk.bridge.destroy()"},{"line_number":123,"context_line":"        else:"},{"line_number":124,"context_line":"            LOG.debug(\"Trunk bridge with id %s doesn\u0027t exist.\", trunk_id)"},{"line_number":125,"context_line":""},{"line_number":126,"context_line":"    def add_sub_port(self, trunk_id, port_id, segmentation_id, port_mac):"},{"line_number":127,"context_line":"        \"\"\"Create a sub_port."}],"source_content_type":"text/x-python","patch_set":14,"id":"3ac371cc_d4c25333","line":124,"in_reply_to":"3ac371cc_b4b99717","updated":"2016-08-17 19:12:38.000000000","message":"That\u0027s not how I read that code. I see the subport patch pairs getting removed, but not the br-int side of the trunk patch pair.","commit_id":"abab5a703c94f6658dc090da258e44fd1f1efeec"},{"author":{"_account_id":16800,"name":"Rawlin Peters","email":"rawlin.peters@hpe.com","username":"rawlin"},"change_message_id":"8b679286f09c6e877c33021ca52a414a511f279f","unresolved":false,"context_lines":[{"line_number":121,"context_line":"        if trunk.bridge.exists():"},{"line_number":122,"context_line":"            trunk.bridge.destroy()"},{"line_number":123,"context_line":"        else:"},{"line_number":124,"context_line":"            LOG.debug(\"Trunk bridge with id %s doesn\u0027t exist.\", trunk_id)"},{"line_number":125,"context_line":""},{"line_number":126,"context_line":"    def add_sub_port(self, trunk_id, port_id, segmentation_id, port_mac):"},{"line_number":127,"context_line":"        \"\"\"Create a sub_port."}],"source_content_type":"text/x-python","patch_set":14,"id":"3ac371cc_4724f75e","line":124,"in_reply_to":"3ac371cc_d4c25333","updated":"2016-08-17 19:42:27.000000000","message":"Oh I was confused, I thought you meant more than just the \u0027tp\u0027 patch port on br-int not getting deleted. That has been overlooked, and that makes me lean more towards moving the subport patch port deletion into this method as well (as well as deleting the \u0027tp\u0027 patch on br-int).\n\nI\u0027m wondering if maybe we\u0027d want to delete the trunk bridge and all of its patch port pairs as a single ovsdb transaction, rather than doing singular operations. Also, it still seems like one subport add/remove operation could be a single transaction as well. If any part fails, we don\u0027t gain anything by having it partially added/removed.","commit_id":"abab5a703c94f6658dc090da258e44fd1f1efeec"},{"author":{"_account_id":16800,"name":"Rawlin Peters","email":"rawlin.peters@hpe.com","username":"rawlin"},"change_message_id":"e17e94d81592fd4eb35c671d154964f1e7f3ed4d","unresolved":false,"context_lines":[{"line_number":161,"context_line":"        \"\"\""},{"line_number":162,"context_line":"        ovsdb \u003d self.bridge.ovsdb"},{"line_number":163,"context_line":"        with self.ovsdb_transaction() as txn:"},{"line_number":164,"context_line":"            super(SubPort, self).create_patch_port_to_bridge(br_int)"},{"line_number":165,"context_line":"            txn.add(ovsdb.db_set("},{"line_number":166,"context_line":"                \"Port\", self.patch_port_trunk_name,"},{"line_number":167,"context_line":"                (\"tag\", self.segmentation_id)))"}],"source_content_type":"text/x-python","patch_set":16,"id":"1ac06dbe_6dced25b","line":164,"range":{"start_line":164,"start_character":12,"end_line":164,"end_character":68},"updated":"2016-08-19 18:16:15.000000000","message":"This is why we need the shiny new context manager, right? I\u0027m wondering if we can save a little complexity by just adding a tag\u003dNone param to Trunk.create_patch_port_to_bridge() with:\n\n if tag is not None:\n     # set the segmentation_id on the port\n\nIMO your current solution is better OOP because the Trunk object shouldn\u0027t contain logic that pertains to its subclass, but there is a possible trade-off here worth considering.\n\nAlternatively we could move the Trunk.create_patch_port_to_bridge() implementation into a private module function with a tag\u003dNone parameter, then Trunk/SubPort.create_patch_port_to_bridge() would just call the private module function. Thoughts?","commit_id":"f231bad31b0c9867e50f5fe9836aaf9ef523b783"},{"author":{"_account_id":8655,"name":"Jakub Libosvar","email":"libosvar@redhat.com","username":"jlibosva"},"change_message_id":"0da71fd592d110ed9d4425e91fee2db7c707473a","unresolved":false,"context_lines":[{"line_number":161,"context_line":"        \"\"\""},{"line_number":162,"context_line":"        ovsdb \u003d self.bridge.ovsdb"},{"line_number":163,"context_line":"        with self.ovsdb_transaction() as txn:"},{"line_number":164,"context_line":"            super(SubPort, self).create_patch_port_to_bridge(br_int)"},{"line_number":165,"context_line":"            txn.add(ovsdb.db_set("},{"line_number":166,"context_line":"                \"Port\", self.patch_port_trunk_name,"},{"line_number":167,"context_line":"                (\"tag\", self.segmentation_id)))"}],"source_content_type":"text/x-python","patch_set":16,"id":"1ac06dbe_a607111b","line":164,"range":{"start_line":164,"start_character":12,"end_line":164,"end_character":68},"in_reply_to":"1ac06dbe_6dced25b","updated":"2016-08-22 09:13:32.000000000","message":"Alternatively we can also pass the transaction as an optional parameter and in that case not create a new context. imo it would decrease readability.\n\nI like the idea about private function. I\u0027ll try to come up with it in (next patches + 1) - I\u0027ll first fix the other comment so later we can just pick which implementation we like better.","commit_id":"f231bad31b0c9867e50f5fe9836aaf9ef523b783"},{"author":{"_account_id":16800,"name":"Rawlin Peters","email":"rawlin.peters@hpe.com","username":"rawlin"},"change_message_id":"c5491481bc77d7811e54e34e4866a44e47965959","unresolved":false,"context_lines":[{"line_number":27,"context_line":""},{"line_number":28,"context_line":"    The port name is the one that plumbs into the integration bridge."},{"line_number":29,"context_line":"    \"\"\""},{"line_number":30,"context_line":"    return (prefix + \u0027-int-\u0027 + port_id)[:constants.DEVICE_NAME_MAX_LEN]"},{"line_number":31,"context_line":""},{"line_number":32,"context_line":""},{"line_number":33,"context_line":"def get_br_trunk_port_name(prefix, port_id):"}],"source_content_type":"text/x-python","patch_set":17,"id":"1ac06dbe_482efb43","line":30,"range":{"start_line":30,"start_character":51,"end_line":30,"end_character":70},"updated":"2016-08-22 20:16:04.000000000","message":"I think we need to assess this length restriction and the one below.\n\nWith names like \"tp-trunk-12345\", there\u0027s only roughly a million possible names. That and the fact that we\u0027re taking only the first 5 digits of a UUID means there\u0027s probably high chance of collision.\n\nPatch port names don\u0027t have the same length restrictions as linux kernel devices, so we should make the names longer if we can. We could use the entire port_id even, but maybe that might be too long?","commit_id":"91ab58a7959f1672877f75eb55e13421941f4664"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"a7be148ac4482228b7c1f5ef384c205eb7379d5c","unresolved":false,"context_lines":[{"line_number":27,"context_line":""},{"line_number":28,"context_line":"    The port name is the one that plumbs into the integration bridge."},{"line_number":29,"context_line":"    \"\"\""},{"line_number":30,"context_line":"    return (prefix + \u0027-int-\u0027 + port_id)[:constants.DEVICE_NAME_MAX_LEN]"},{"line_number":31,"context_line":""},{"line_number":32,"context_line":""},{"line_number":33,"context_line":"def get_br_trunk_port_name(prefix, port_id):"}],"source_content_type":"text/x-python","patch_set":17,"id":"1ac06dbe_a1a345ff","line":30,"range":{"start_line":30,"start_character":51,"end_line":30,"end_character":70},"in_reply_to":"1ac06dbe_482efb43","updated":"2016-08-22 23:51:04.000000000","message":"Perhaps we can trim the labels to -in- and -tr- and that gives us 9 digits to play with (or even -i- and -t- to gain an extra digit), which should give us plenty on the host, and make the problem a lot less likely to occur. We can even consider dropping one dash to gain yet another digit.\n\nThe point of name exhaustion is well taken though, we should fix this more holistically and this might involve adding the generated name to the model, but for the sake of this patch perhaps we can simply give more space to the random part of the port name.","commit_id":"91ab58a7959f1672877f75eb55e13421941f4664"},{"author":{"_account_id":8655,"name":"Jakub Libosvar","email":"libosvar@redhat.com","username":"jlibosva"},"change_message_id":"0029608f69b8ec903e8174ec7615940146554420","unresolved":false,"context_lines":[{"line_number":27,"context_line":""},{"line_number":28,"context_line":"    The port name is the one that plumbs into the integration bridge."},{"line_number":29,"context_line":"    \"\"\""},{"line_number":30,"context_line":"    return (prefix + \u0027-int-\u0027 + port_id)[:constants.DEVICE_NAME_MAX_LEN]"},{"line_number":31,"context_line":""},{"line_number":32,"context_line":""},{"line_number":33,"context_line":"def get_br_trunk_port_name(prefix, port_id):"}],"source_content_type":"text/x-python","patch_set":17,"id":"1ac06dbe_4f56dc5c","line":30,"range":{"start_line":30,"start_character":51,"end_line":30,"end_character":70},"in_reply_to":"1ac06dbe_a1a345ff","updated":"2016-08-23 12:39:34.000000000","message":"We could reflect what we do with hybrid-plugging veth pairs (qvo, qvb): \u0027tpt\u0027 - for trunk port on trunk side, \u0027spt\u0027 for subport on trunk side, \u0027spi\u0027 - for subport on integration bridge.\n\nWe can also be more defensive and catch error coming from ovsdb in case port already exists and re-generate the name.","commit_id":"91ab58a7959f1672877f75eb55e13421941f4664"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"a7be148ac4482228b7c1f5ef384c205eb7379d5c","unresolved":false,"context_lines":[{"line_number":62,"context_line":"        return self.bridge_exists(self.br_name)"},{"line_number":63,"context_line":""},{"line_number":64,"context_line":""},{"line_number":65,"context_line":"class Trunk(object):"},{"line_number":66,"context_line":"    DEV_PREFIX \u003d \u0027tp\u0027"},{"line_number":67,"context_line":""},{"line_number":68,"context_line":"    def __init__(self, trunk_id, port_id, port_mac\u003dNone):"}],"source_content_type":"text/x-python","patch_set":17,"id":"1ac06dbe_61978dec","line":65,"updated":"2016-08-22 23:51:04.000000000","message":"I\u0027d almost call this TrunkParentPort, because it\u0027s clear from the hierarchy that both classes represent Ports, but it\u0027s a minor improvement IMO","commit_id":"91ab58a7959f1672877f75eb55e13421941f4664"},{"author":{"_account_id":8655,"name":"Jakub Libosvar","email":"libosvar@redhat.com","username":"jlibosva"},"change_message_id":"0029608f69b8ec903e8174ec7615940146554420","unresolved":false,"context_lines":[{"line_number":62,"context_line":"        return self.bridge_exists(self.br_name)"},{"line_number":63,"context_line":""},{"line_number":64,"context_line":""},{"line_number":65,"context_line":"class Trunk(object):"},{"line_number":66,"context_line":"    DEV_PREFIX \u003d \u0027tp\u0027"},{"line_number":67,"context_line":""},{"line_number":68,"context_line":"    def __init__(self, trunk_id, port_id, port_mac\u003dNone):"}],"source_content_type":"text/x-python","patch_set":17,"id":"1ac06dbe_afc2f0e6","line":65,"in_reply_to":"1ac06dbe_61978dec","updated":"2016-08-23 12:39:34.000000000","message":"Done","commit_id":"91ab58a7959f1672877f75eb55e13421941f4664"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"a7be148ac4482228b7c1f5ef384c205eb7379d5c","unresolved":false,"context_lines":[{"line_number":94,"context_line":"                finally:"},{"line_number":95,"context_line":"                    self._transaction \u003d None"},{"line_number":96,"context_line":""},{"line_number":97,"context_line":"    def create_patch_port_to_bridge(self, br_int):"},{"line_number":98,"context_line":"        \"\"\"Create patch ports between trunk bridge and given bridge."},{"line_number":99,"context_line":""},{"line_number":100,"context_line":"        The method creates one patch port on the given bridge side using"}],"source_content_type":"text/x-python","patch_set":17,"id":"1ac06dbe_c5248c61","line":97,"updated":"2016-08-22 23:51:04.000000000","message":"why not call it create() or plug()? We could at this point take br_int as constructor parameter but I don\u0027t mind if we don\u0027t.","commit_id":"91ab58a7959f1672877f75eb55e13421941f4664"},{"author":{"_account_id":8655,"name":"Jakub Libosvar","email":"libosvar@redhat.com","username":"jlibosva"},"change_message_id":"0029608f69b8ec903e8174ec7615940146554420","unresolved":false,"context_lines":[{"line_number":94,"context_line":"                finally:"},{"line_number":95,"context_line":"                    self._transaction \u003d None"},{"line_number":96,"context_line":""},{"line_number":97,"context_line":"    def create_patch_port_to_bridge(self, br_int):"},{"line_number":98,"context_line":"        \"\"\"Create patch ports between trunk bridge and given bridge."},{"line_number":99,"context_line":""},{"line_number":100,"context_line":"        The method creates one patch port on the given bridge side using"}],"source_content_type":"text/x-python","patch_set":17,"id":"1ac06dbe_eaf5f6ec","line":97,"in_reply_to":"1ac06dbe_c5248c61","updated":"2016-08-23 12:39:34.000000000","message":"Renamed to plug(). Programatically it will be easier to pass bridge in init() but generally I find it more reasonable to tell the destination of where you would like to plug.","commit_id":"91ab58a7959f1672877f75eb55e13421941f4664"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"a7be148ac4482228b7c1f5ef384c205eb7379d5c","unresolved":false,"context_lines":[{"line_number":133,"context_line":"                       subport."},{"line_number":134,"context_line":"        \"\"\""},{"line_number":135,"context_line":"        ovsdb \u003d self.bridge.ovsdb"},{"line_number":136,"context_line":"        with ovsdb.transaction() as txn:"},{"line_number":137,"context_line":"            txn.add(ovsdb.del_br(self.bridge.br_name))"},{"line_number":138,"context_line":"            txn.add(ovsdb.del_port(self.patch_port_int_name,"},{"line_number":139,"context_line":"                                   bridge.br_name))"}],"source_content_type":"text/x-python","patch_set":17,"id":"1ac06dbe_85df340c","line":136,"updated":"2016-08-22 23:51:04.000000000","message":"shouldn\u0027t this be:\n\nwith self.ovsdb_transaction() as txn:","commit_id":"91ab58a7959f1672877f75eb55e13421941f4664"},{"author":{"_account_id":8655,"name":"Jakub Libosvar","email":"libosvar@redhat.com","username":"jlibosva"},"change_message_id":"0029608f69b8ec903e8174ec7615940146554420","unresolved":false,"context_lines":[{"line_number":133,"context_line":"                       subport."},{"line_number":134,"context_line":"        \"\"\""},{"line_number":135,"context_line":"        ovsdb \u003d self.bridge.ovsdb"},{"line_number":136,"context_line":"        with ovsdb.transaction() as txn:"},{"line_number":137,"context_line":"            txn.add(ovsdb.del_br(self.bridge.br_name))"},{"line_number":138,"context_line":"            txn.add(ovsdb.del_port(self.patch_port_int_name,"},{"line_number":139,"context_line":"                                   bridge.br_name))"}],"source_content_type":"text/x-python","patch_set":17,"id":"1ac06dbe_d761d03a","line":136,"in_reply_to":"1ac06dbe_85df340c","updated":"2016-08-23 12:39:34.000000000","message":"It doesn\u0027t matter as we don\u0027t use nested transaction here. But generally now subclasses can\u0027t use delete() in its transaction context. So fixed.","commit_id":"91ab58a7959f1672877f75eb55e13421941f4664"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"a7be148ac4482228b7c1f5ef384c205eb7379d5c","unresolved":false,"context_lines":[{"line_number":161,"context_line":"        \"\"\""},{"line_number":162,"context_line":"        ovsdb \u003d self.bridge.ovsdb"},{"line_number":163,"context_line":"        with self.ovsdb_transaction() as txn:"},{"line_number":164,"context_line":"            super(SubPort, self).create_patch_port_to_bridge(br_int)"},{"line_number":165,"context_line":"            txn.add(ovsdb.db_set("},{"line_number":166,"context_line":"                \"Port\", self.patch_port_trunk_name,"},{"line_number":167,"context_line":"                (\"tag\", self.segmentation_id)))"}],"source_content_type":"text/x-python","patch_set":17,"id":"1ac06dbe_c10be128","line":164,"updated":"2016-08-22 23:51:04.000000000","message":"This needs support for nested transaction. It\u0027s my understanding that you\u0027d need to take care of that as follow up.\n\nAlternatively you could get rid of line 116 and line 163 and defer the invocation of the transaction to the caller like at line 211. Though this is not as clean and symmetric with the delete operation.\n\nTo be honest I feel like we could get rid of the nested manager issue if we avoided inheritance altogether as in this case we\u0027re only saving a handful of lines of code. We could simply extract the ovs transaction manager into a base class and have both trunk and subport use it rather than inherit. REMEMBER: reuse !\u003d inheritance. Composition is just as effective.","commit_id":"91ab58a7959f1672877f75eb55e13421941f4664"},{"author":{"_account_id":8655,"name":"Jakub Libosvar","email":"libosvar@redhat.com","username":"jlibosva"},"change_message_id":"0029608f69b8ec903e8174ec7615940146554420","unresolved":false,"context_lines":[{"line_number":161,"context_line":"        \"\"\""},{"line_number":162,"context_line":"        ovsdb \u003d self.bridge.ovsdb"},{"line_number":163,"context_line":"        with self.ovsdb_transaction() as txn:"},{"line_number":164,"context_line":"            super(SubPort, self).create_patch_port_to_bridge(br_int)"},{"line_number":165,"context_line":"            txn.add(ovsdb.db_set("},{"line_number":166,"context_line":"                \"Port\", self.patch_port_trunk_name,"},{"line_number":167,"context_line":"                (\"tag\", self.segmentation_id)))"}],"source_content_type":"text/x-python","patch_set":17,"id":"1ac06dbe_8fae0fe4","line":164,"in_reply_to":"1ac06dbe_c10be128","updated":"2016-08-23 12:39:34.000000000","message":"Follow up it is.","commit_id":"91ab58a7959f1672877f75eb55e13421941f4664"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"a7be148ac4482228b7c1f5ef384c205eb7379d5c","unresolved":false,"context_lines":[{"line_number":176,"context_line":"                       subport."},{"line_number":177,"context_line":"        \"\"\""},{"line_number":178,"context_line":"        ovsdb \u003d self.bridge.ovsdb"},{"line_number":179,"context_line":"        with ovsdb.transaction() as txn:"},{"line_number":180,"context_line":"            txn.add(ovsdb.del_port(self.patch_port_trunk_name,"},{"line_number":181,"context_line":"                                   self.bridge.br_name))"},{"line_number":182,"context_line":"            txn.add(ovsdb.del_port(self.patch_port_int_name,"}],"source_content_type":"text/x-python","patch_set":17,"id":"1ac06dbe_c5e5acdc","line":179,"updated":"2016-08-22 23:51:04.000000000","message":"shouldn\u0027t this be:\n\nwith self.ovsdb_transaction() as txn:","commit_id":"91ab58a7959f1672877f75eb55e13421941f4664"},{"author":{"_account_id":8655,"name":"Jakub Libosvar","email":"libosvar@redhat.com","username":"jlibosva"},"change_message_id":"0029608f69b8ec903e8174ec7615940146554420","unresolved":false,"context_lines":[{"line_number":176,"context_line":"                       subport."},{"line_number":177,"context_line":"        \"\"\""},{"line_number":178,"context_line":"        ovsdb \u003d self.bridge.ovsdb"},{"line_number":179,"context_line":"        with ovsdb.transaction() as txn:"},{"line_number":180,"context_line":"            txn.add(ovsdb.del_port(self.patch_port_trunk_name,"},{"line_number":181,"context_line":"                                   self.bridge.br_name))"},{"line_number":182,"context_line":"            txn.add(ovsdb.del_port(self.patch_port_int_name,"}],"source_content_type":"text/x-python","patch_set":17,"id":"1ac06dbe_6aec66f3","line":179,"in_reply_to":"1ac06dbe_c5e5acdc","updated":"2016-08-23 12:39:34.000000000","message":"Done","commit_id":"91ab58a7959f1672877f75eb55e13421941f4664"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"a7be148ac4482228b7c1f5ef384c205eb7379d5c","unresolved":false,"context_lines":[{"line_number":216,"context_line":"        if trunk.bridge.exists():"},{"line_number":217,"context_line":"            trunk.delete(self.br_int)"},{"line_number":218,"context_line":"        else:"},{"line_number":219,"context_line":"            LOG.debug(\"Trunk bridge with id %s doesn\u0027t exist.\", trunk_id)"},{"line_number":220,"context_line":""},{"line_number":221,"context_line":"    def add_sub_port(self, trunk_id, port_id, port_mac, segmentation_id):"},{"line_number":222,"context_line":"        \"\"\"Create a sub_port."}],"source_content_type":"text/x-python","patch_set":17,"id":"1ac06dbe_c533ec60","line":219,"updated":"2016-08-22 23:51:04.000000000","message":"a note reminding ourselves when this might occur would be nice. I can\u0027t remember anymore already :)","commit_id":"91ab58a7959f1672877f75eb55e13421941f4664"},{"author":{"_account_id":8655,"name":"Jakub Libosvar","email":"libosvar@redhat.com","username":"jlibosva"},"change_message_id":"0029608f69b8ec903e8174ec7615940146554420","unresolved":false,"context_lines":[{"line_number":216,"context_line":"        if trunk.bridge.exists():"},{"line_number":217,"context_line":"            trunk.delete(self.br_int)"},{"line_number":218,"context_line":"        else:"},{"line_number":219,"context_line":"            LOG.debug(\"Trunk bridge with id %s doesn\u0027t exist.\", trunk_id)"},{"line_number":220,"context_line":""},{"line_number":221,"context_line":"    def add_sub_port(self, trunk_id, port_id, port_mac, segmentation_id):"},{"line_number":222,"context_line":"        \"\"\"Create a sub_port."}],"source_content_type":"text/x-python","patch_set":17,"id":"1ac06dbe_c5d46d21","line":219,"in_reply_to":"1ac06dbe_c533ec60","updated":"2016-08-23 12:39:34.000000000","message":"I don\u0027t know in this case either. Can it be that we want to avoid exceptions when calling remove_trunk() twice with same ids?","commit_id":"91ab58a7959f1672877f75eb55e13421941f4664"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"a7be148ac4482228b7c1f5ef384c205eb7379d5c","unresolved":false,"context_lines":[{"line_number":229,"context_line":"        \"\"\""},{"line_number":230,"context_line":"        sub_port \u003d SubPort(trunk_id, port_id, port_mac, segmentation_id)"},{"line_number":231,"context_line":"        if not sub_port.bridge.exists():"},{"line_number":232,"context_line":"            raise exc.TrunkBridgeNotFound(bridge\u003dsub_port.bridge.br_name)"},{"line_number":233,"context_line":"        sub_port.create_patch_port_to_bridge(self.br_int)"},{"line_number":234,"context_line":""},{"line_number":235,"context_line":"    def remove_sub_port(self, trunk_id, port_id):"}],"source_content_type":"text/x-python","patch_set":17,"id":"1ac06dbe_8562943c","line":232,"updated":"2016-08-22 23:51:04.000000000","message":"This could exist if the boot of a VM (ie. creation of the trunk bridge) takes longer of an API operation of adding subports. We should make a note about this (which was highlighted in [1]). Bear in mind that the caller of this method might as well consider it\u0027s ok to swallow the exception.\n\n[1] https://review.openstack.org/#/c/335536/6/neutron/services/trunk/drivers/openvswitch/agent/trunk_manager.py@110","commit_id":"91ab58a7959f1672877f75eb55e13421941f4664"},{"author":{"_account_id":8655,"name":"Jakub Libosvar","email":"libosvar@redhat.com","username":"jlibosva"},"change_message_id":"0029608f69b8ec903e8174ec7615940146554420","unresolved":false,"context_lines":[{"line_number":229,"context_line":"        \"\"\""},{"line_number":230,"context_line":"        sub_port \u003d SubPort(trunk_id, port_id, port_mac, segmentation_id)"},{"line_number":231,"context_line":"        if not sub_port.bridge.exists():"},{"line_number":232,"context_line":"            raise exc.TrunkBridgeNotFound(bridge\u003dsub_port.bridge.br_name)"},{"line_number":233,"context_line":"        sub_port.create_patch_port_to_bridge(self.br_int)"},{"line_number":234,"context_line":""},{"line_number":235,"context_line":"    def remove_sub_port(self, trunk_id, port_id):"}],"source_content_type":"text/x-python","patch_set":17,"id":"1ac06dbe_cc013508","line":232,"in_reply_to":"1ac06dbe_8562943c","updated":"2016-08-23 12:39:34.000000000","message":"Done","commit_id":"91ab58a7959f1672877f75eb55e13421941f4664"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"a7be148ac4482228b7c1f5ef384c205eb7379d5c","unresolved":false,"context_lines":[{"line_number":244,"context_line":"        if sub_port.bridge.exists():"},{"line_number":245,"context_line":"            sub_port.delete(self.br_int)"},{"line_number":246,"context_line":"        else:"},{"line_number":247,"context_line":"            LOG.debug(\"Trunk bridge with id %s doesn\u0027t exist.\", trunk_id)"}],"source_content_type":"text/x-python","patch_set":17,"id":"1ac06dbe_052984e6","line":247,"updated":"2016-08-22 23:51:04.000000000","message":"ditto.","commit_id":"91ab58a7959f1672877f75eb55e13421941f4664"},{"author":{"_account_id":8655,"name":"Jakub Libosvar","email":"libosvar@redhat.com","username":"jlibosva"},"change_message_id":"0029608f69b8ec903e8174ec7615940146554420","unresolved":false,"context_lines":[{"line_number":244,"context_line":"        if sub_port.bridge.exists():"},{"line_number":245,"context_line":"            sub_port.delete(self.br_int)"},{"line_number":246,"context_line":"        else:"},{"line_number":247,"context_line":"            LOG.debug(\"Trunk bridge with id %s doesn\u0027t exist.\", trunk_id)"}],"source_content_type":"text/x-python","patch_set":17,"id":"1ac06dbe_8f128f55","line":247,"in_reply_to":"1ac06dbe_052984e6","updated":"2016-08-23 12:39:34.000000000","message":"Done","commit_id":"91ab58a7959f1672877f75eb55e13421941f4664"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"8e1dac1f98e90be9e26ce8297d5c12f9c3a645d4","unresolved":false,"context_lines":[{"line_number":143,"context_line":""},{"line_number":144,"context_line":""},{"line_number":145,"context_line":"class SubPort(TrunkParentPort):"},{"line_number":146,"context_line":"    # Patch port names have form of spi-\u003chash\u003e or spt-\u003chash\u003e respectivelly."},{"line_number":147,"context_line":"    DEV_PREFIX \u003d \u0027sp\u0027"},{"line_number":148,"context_line":""},{"line_number":149,"context_line":"    def __init__(self, trunk_id, port_id, port_mac\u003dNone, segmentation_id\u003dNone):"}],"source_content_type":"text/x-python","patch_set":18,"id":"1ac06dbe_a1431212","line":146,"updated":"2016-08-23 15:24:53.000000000","message":"nit: respectively.","commit_id":"c0517671c69b7f565477ba303e3864504b54e80d"},{"author":{"_account_id":8655,"name":"Jakub Libosvar","email":"libosvar@redhat.com","username":"jlibosva"},"change_message_id":"7389e9aeab2ff6dbb6cac1662b293c0fe79c1051","unresolved":false,"context_lines":[{"line_number":143,"context_line":""},{"line_number":144,"context_line":""},{"line_number":145,"context_line":"class SubPort(TrunkParentPort):"},{"line_number":146,"context_line":"    # Patch port names have form of spi-\u003chash\u003e or spt-\u003chash\u003e respectivelly."},{"line_number":147,"context_line":"    DEV_PREFIX \u003d \u0027sp\u0027"},{"line_number":148,"context_line":""},{"line_number":149,"context_line":"    def __init__(self, trunk_id, port_id, port_mac\u003dNone, segmentation_id\u003dNone):"}],"source_content_type":"text/x-python","patch_set":18,"id":"1ac06dbe_4af2339b","line":146,"in_reply_to":"1ac06dbe_a1431212","updated":"2016-08-23 15:47:07.000000000","message":"Done","commit_id":"c0517671c69b7f565477ba303e3864504b54e80d"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"8e1dac1f98e90be9e26ce8297d5c12f9c3a645d4","unresolved":false,"context_lines":[{"line_number":218,"context_line":"        \"\"\"Remove the trunk bridge.\"\"\""},{"line_number":219,"context_line":"        trunk \u003d TrunkParentPort(trunk_id, port_id)"},{"line_number":220,"context_line":"        if trunk.bridge.exists():"},{"line_number":221,"context_line":"            trunk.delete(self.br_int)"},{"line_number":222,"context_line":"        else:"},{"line_number":223,"context_line":"            LOG.debug(\"Trunk bridge with id %s doesn\u0027t exist.\", trunk_id)"},{"line_number":224,"context_line":""}],"source_content_type":"text/x-python","patch_set":18,"id":"1ac06dbe_a1eaf271","line":221,"updated":"2016-08-23 15:24:53.000000000","message":"note to self: I must admit this reads a bit funny, in that it seems you\u0027re deleting br_int. I wonder if at this point unplug() is more readable than delete() but don\u0027t respin just for that.","commit_id":"c0517671c69b7f565477ba303e3864504b54e80d"},{"author":{"_account_id":8655,"name":"Jakub Libosvar","email":"libosvar@redhat.com","username":"jlibosva"},"change_message_id":"7389e9aeab2ff6dbb6cac1662b293c0fe79c1051","unresolved":false,"context_lines":[{"line_number":218,"context_line":"        \"\"\"Remove the trunk bridge.\"\"\""},{"line_number":219,"context_line":"        trunk \u003d TrunkParentPort(trunk_id, port_id)"},{"line_number":220,"context_line":"        if trunk.bridge.exists():"},{"line_number":221,"context_line":"            trunk.delete(self.br_int)"},{"line_number":222,"context_line":"        else:"},{"line_number":223,"context_line":"            LOG.debug(\"Trunk bridge with id %s doesn\u0027t exist.\", trunk_id)"},{"line_number":224,"context_line":""}],"source_content_type":"text/x-python","patch_set":18,"id":"1ac06dbe_0f2a0ddb","line":221,"in_reply_to":"1ac06dbe_a1eaf271","updated":"2016-08-23 15:47:07.000000000","message":"I agree but I\u0027m more in favor of respinning because of that :)","commit_id":"c0517671c69b7f565477ba303e3864504b54e80d"},{"author":{"_account_id":16800,"name":"Rawlin Peters","email":"rawlin.peters@hpe.com","username":"rawlin"},"change_message_id":"4e158ac15fcb8971335c4098422b0eb9a048e843","unresolved":false,"context_lines":[{"line_number":35,"context_line":""},{"line_number":36,"context_line":"    The port name is the one that plumbs into the trunk bridge."},{"line_number":37,"context_line":"    \"\"\""},{"line_number":38,"context_line":"    return (\"%st-%s\" % (prefix, port_id))[:constants.DEVICE_NAME_MAX_LEN]"},{"line_number":39,"context_line":""},{"line_number":40,"context_line":""},{"line_number":41,"context_line":"def get_patch_peer_attrs(peer_name, port_mac\u003dNone, port_id\u003dNone):"}],"source_content_type":"text/x-python","patch_set":19,"id":"1ac06dbe_64e76340","line":38,"range":{"start_line":38,"start_character":13,"end_line":38,"end_character":19},"updated":"2016-08-23 16:17:23.000000000","message":"I\u0027m good with the new naming scheme; we\u0027re only one digit worse off than \"qr-*\" ports for instance. But, I think that should be plenty of room to work with.","commit_id":"d51fc94a571d9d1dafa882c288cd2723f9b4f0fa"},{"author":{"_account_id":16800,"name":"Rawlin Peters","email":"rawlin.peters@hpe.com","username":"rawlin"},"change_message_id":"4e158ac15fcb8971335c4098422b0eb9a048e843","unresolved":false,"context_lines":[{"line_number":241,"context_line":"    def remove_sub_port(self, trunk_id, port_id):"},{"line_number":242,"context_line":"        \"\"\"Remove a sub_port."},{"line_number":243,"context_line":""},{"line_number":244,"context_line":"        @param trunk_id: id of the trunk"},{"line_number":245,"context_line":"        @param port_id: id of the child port"},{"line_number":246,"context_line":"        \"\"\""},{"line_number":247,"context_line":"        sub_port \u003d SubPort(trunk_id, port_id)"}],"source_content_type":"text/x-python","patch_set":19,"id":"1ac06dbe_c411f705","line":244,"range":{"start_line":244,"start_character":8,"end_line":244,"end_character":9},"updated":"2016-08-23 16:17:23.000000000","message":"nit: you\u0027ve used \u0027:\u0027 in all the other docstrings","commit_id":"d51fc94a571d9d1dafa882c288cd2723f9b4f0fa"},{"author":{"_account_id":8655,"name":"Jakub Libosvar","email":"libosvar@redhat.com","username":"jlibosva"},"change_message_id":"2914d966d813c9b14abce791101e74c588eab7f2","unresolved":false,"context_lines":[{"line_number":241,"context_line":"    def remove_sub_port(self, trunk_id, port_id):"},{"line_number":242,"context_line":"        \"\"\"Remove a sub_port."},{"line_number":243,"context_line":""},{"line_number":244,"context_line":"        @param trunk_id: id of the trunk"},{"line_number":245,"context_line":"        @param port_id: id of the child port"},{"line_number":246,"context_line":"        \"\"\""},{"line_number":247,"context_line":"        sub_port \u003d SubPort(trunk_id, port_id)"}],"source_content_type":"text/x-python","patch_set":19,"id":"1ac06dbe_8466df4e","line":244,"range":{"start_line":244,"start_character":8,"end_line":244,"end_character":9},"in_reply_to":"1ac06dbe_c411f705","updated":"2016-08-23 16:21:37.000000000","message":"Yeah, actually in previous patchsets there were used this Doxygen-like style of comments and I tried to replace it and missed this one.","commit_id":"d51fc94a571d9d1dafa882c288cd2723f9b4f0fa"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"ce215eab6a612b7b1be8f782a555f11a81b101ce","unresolved":false,"context_lines":[{"line_number":23,"context_line":""},{"line_number":24,"context_line":""},{"line_number":25,"context_line":"def get_br_int_port_name(prefix, port_id):"},{"line_number":26,"context_line":"    \"\"\"Return the OVS port name for the given port id."},{"line_number":27,"context_line":""},{"line_number":28,"context_line":"    The port name is the one that plumbs into the integration bridge."},{"line_number":29,"context_line":"    \"\"\""}],"source_content_type":"text/x-python","patch_set":22,"id":"1ac06dbe_8ff546ee","line":26,"updated":"2016-08-23 21:22:03.000000000","message":"ID","commit_id":"64da69aabadb6303bf112eacd969f907fe6a4c44"},{"author":{"_account_id":8655,"name":"Jakub Libosvar","email":"libosvar@redhat.com","username":"jlibosva"},"change_message_id":"b896e03f9335e2436e7db16cc48fccfc4efd1a86","unresolved":false,"context_lines":[{"line_number":23,"context_line":""},{"line_number":24,"context_line":""},{"line_number":25,"context_line":"def get_br_int_port_name(prefix, port_id):"},{"line_number":26,"context_line":"    \"\"\"Return the OVS port name for the given port id."},{"line_number":27,"context_line":""},{"line_number":28,"context_line":"    The port name is the one that plumbs into the integration bridge."},{"line_number":29,"context_line":"    \"\"\""}],"source_content_type":"text/x-python","patch_set":22,"id":"1ac06dbe_52dc8145","line":26,"in_reply_to":"1ac06dbe_8ff546ee","updated":"2016-08-24 06:51:57.000000000","message":"Done","commit_id":"64da69aabadb6303bf112eacd969f907fe6a4c44"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"ce215eab6a612b7b1be8f782a555f11a81b101ce","unresolved":false,"context_lines":[{"line_number":30,"context_line":"    return (\"%si-%s\" % (prefix, port_id))[:constants.DEVICE_NAME_MAX_LEN]"},{"line_number":31,"context_line":""},{"line_number":32,"context_line":""},{"line_number":33,"context_line":"def get_br_trunk_port_name(prefix, port_id):"},{"line_number":34,"context_line":"    \"\"\"Return the OVS port name for the given port id."},{"line_number":35,"context_line":""},{"line_number":36,"context_line":"    The port name is the one that plumbs into the trunk bridge."},{"line_number":37,"context_line":"    \"\"\""}],"source_content_type":"text/x-python","patch_set":22,"id":"1ac06dbe_efe03a2b","line":34,"range":{"start_line":33,"start_character":44,"end_line":34,"end_character":52},"updated":"2016-08-23 21:22:03.000000000","message":"ID","commit_id":"64da69aabadb6303bf112eacd969f907fe6a4c44"},{"author":{"_account_id":8655,"name":"Jakub Libosvar","email":"libosvar@redhat.com","username":"jlibosva"},"change_message_id":"b896e03f9335e2436e7db16cc48fccfc4efd1a86","unresolved":false,"context_lines":[{"line_number":30,"context_line":"    return (\"%si-%s\" % (prefix, port_id))[:constants.DEVICE_NAME_MAX_LEN]"},{"line_number":31,"context_line":""},{"line_number":32,"context_line":""},{"line_number":33,"context_line":"def get_br_trunk_port_name(prefix, port_id):"},{"line_number":34,"context_line":"    \"\"\"Return the OVS port name for the given port id."},{"line_number":35,"context_line":""},{"line_number":36,"context_line":"    The port name is the one that plumbs into the trunk bridge."},{"line_number":37,"context_line":"    \"\"\""}],"source_content_type":"text/x-python","patch_set":22,"id":"1ac06dbe_32df453b","line":34,"range":{"start_line":33,"start_character":44,"end_line":34,"end_character":52},"in_reply_to":"1ac06dbe_efe03a2b","updated":"2016-08-24 06:51:57.000000000","message":"Done","commit_id":"64da69aabadb6303bf112eacd969f907fe6a4c44"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"ce215eab6a612b7b1be8f782a555f11a81b101ce","unresolved":false,"context_lines":[{"line_number":198,"context_line":"        This patches the bridge for trunk_id with the integration bridge"},{"line_number":199,"context_line":"        by means of parent port identified by port_id."},{"line_number":200,"context_line":""},{"line_number":201,"context_line":"        :param trunk_id: id of the trunk."},{"line_number":202,"context_line":"        :param port_id: id of the parent port."},{"line_number":203,"context_line":"        :param port_mac: the MAC address of the parent port."},{"line_number":204,"context_line":"        :raises: TrunkBridgeNotFound -- In case trunk bridge doesn\u0027t exist."}],"source_content_type":"text/x-python","patch_set":22,"id":"1ac06dbe_4f534e17","line":201,"updated":"2016-08-23 21:22:03.000000000","message":"this should be ID","commit_id":"64da69aabadb6303bf112eacd969f907fe6a4c44"},{"author":{"_account_id":8655,"name":"Jakub Libosvar","email":"libosvar@redhat.com","username":"jlibosva"},"change_message_id":"b896e03f9335e2436e7db16cc48fccfc4efd1a86","unresolved":false,"context_lines":[{"line_number":198,"context_line":"        This patches the bridge for trunk_id with the integration bridge"},{"line_number":199,"context_line":"        by means of parent port identified by port_id."},{"line_number":200,"context_line":""},{"line_number":201,"context_line":"        :param trunk_id: id of the trunk."},{"line_number":202,"context_line":"        :param port_id: id of the parent port."},{"line_number":203,"context_line":"        :param port_mac: the MAC address of the parent port."},{"line_number":204,"context_line":"        :raises: TrunkBridgeNotFound -- In case trunk bridge doesn\u0027t exist."}],"source_content_type":"text/x-python","patch_set":22,"id":"1ac06dbe_b2eb35db","line":201,"in_reply_to":"1ac06dbe_4f534e17","updated":"2016-08-24 06:51:57.000000000","message":"Done","commit_id":"64da69aabadb6303bf112eacd969f907fe6a4c44"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"ce215eab6a612b7b1be8f782a555f11a81b101ce","unresolved":false,"context_lines":[{"line_number":199,"context_line":"        by means of parent port identified by port_id."},{"line_number":200,"context_line":""},{"line_number":201,"context_line":"        :param trunk_id: id of the trunk."},{"line_number":202,"context_line":"        :param port_id: id of the parent port."},{"line_number":203,"context_line":"        :param port_mac: the MAC address of the parent port."},{"line_number":204,"context_line":"        :raises: TrunkBridgeNotFound -- In case trunk bridge doesn\u0027t exist."},{"line_number":205,"context_line":""}],"source_content_type":"text/x-python","patch_set":22,"id":"1ac06dbe_cf3f3eb2","line":202,"updated":"2016-08-23 21:22:03.000000000","message":"ditto","commit_id":"64da69aabadb6303bf112eacd969f907fe6a4c44"},{"author":{"_account_id":8655,"name":"Jakub Libosvar","email":"libosvar@redhat.com","username":"jlibosva"},"change_message_id":"b896e03f9335e2436e7db16cc48fccfc4efd1a86","unresolved":false,"context_lines":[{"line_number":199,"context_line":"        by means of parent port identified by port_id."},{"line_number":200,"context_line":""},{"line_number":201,"context_line":"        :param trunk_id: id of the trunk."},{"line_number":202,"context_line":"        :param port_id: id of the parent port."},{"line_number":203,"context_line":"        :param port_mac: the MAC address of the parent port."},{"line_number":204,"context_line":"        :raises: TrunkBridgeNotFound -- In case trunk bridge doesn\u0027t exist."},{"line_number":205,"context_line":""}],"source_content_type":"text/x-python","patch_set":22,"id":"1ac06dbe_12bde9d7","line":202,"in_reply_to":"1ac06dbe_cf3f3eb2","updated":"2016-08-24 06:51:57.000000000","message":"Done","commit_id":"64da69aabadb6303bf112eacd969f907fe6a4c44"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"ce215eab6a612b7b1be8f782a555f11a81b101ce","unresolved":false,"context_lines":[{"line_number":220,"context_line":"        if trunk.bridge.exists():"},{"line_number":221,"context_line":"            trunk.unplug(self.br_int)"},{"line_number":222,"context_line":"        else:"},{"line_number":223,"context_line":"            LOG.debug(\"Trunk bridge with id %s doesn\u0027t exist.\", trunk_id)"},{"line_number":224,"context_line":""},{"line_number":225,"context_line":"    def add_sub_port(self, trunk_id, port_id, port_mac, segmentation_id):"},{"line_number":226,"context_line":"        \"\"\"Create a sub_port."}],"source_content_type":"text/x-python","patch_set":22,"id":"1ac06dbe_8fcc26bc","line":223,"updated":"2016-08-23 21:22:03.000000000","message":"ID","commit_id":"64da69aabadb6303bf112eacd969f907fe6a4c44"},{"author":{"_account_id":8655,"name":"Jakub Libosvar","email":"libosvar@redhat.com","username":"jlibosva"},"change_message_id":"b896e03f9335e2436e7db16cc48fccfc4efd1a86","unresolved":false,"context_lines":[{"line_number":220,"context_line":"        if trunk.bridge.exists():"},{"line_number":221,"context_line":"            trunk.unplug(self.br_int)"},{"line_number":222,"context_line":"        else:"},{"line_number":223,"context_line":"            LOG.debug(\"Trunk bridge with id %s doesn\u0027t exist.\", trunk_id)"},{"line_number":224,"context_line":""},{"line_number":225,"context_line":"    def add_sub_port(self, trunk_id, port_id, port_mac, segmentation_id):"},{"line_number":226,"context_line":"        \"\"\"Create a sub_port."}],"source_content_type":"text/x-python","patch_set":22,"id":"1ac06dbe_f2bf6dcd","line":223,"in_reply_to":"1ac06dbe_8fcc26bc","updated":"2016-08-24 06:51:57.000000000","message":"Done","commit_id":"64da69aabadb6303bf112eacd969f907fe6a4c44"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"ce215eab6a612b7b1be8f782a555f11a81b101ce","unresolved":false,"context_lines":[{"line_number":225,"context_line":"    def add_sub_port(self, trunk_id, port_id, port_mac, segmentation_id):"},{"line_number":226,"context_line":"        \"\"\"Create a sub_port."},{"line_number":227,"context_line":""},{"line_number":228,"context_line":"        :param trunk_id: id of the trunk"},{"line_number":229,"context_line":"        :param port_id: id of the child port"},{"line_number":230,"context_line":"        :param segmentation_id: segmentation id associated with this sub-port"},{"line_number":231,"context_line":"        :param port_mac: MAC address of the child port"}],"source_content_type":"text/x-python","patch_set":22,"id":"1ac06dbe_efb2fa4a","line":228,"updated":"2016-08-23 21:22:03.000000000","message":"ditto","commit_id":"64da69aabadb6303bf112eacd969f907fe6a4c44"},{"author":{"_account_id":8655,"name":"Jakub Libosvar","email":"libosvar@redhat.com","username":"jlibosva"},"change_message_id":"b896e03f9335e2436e7db16cc48fccfc4efd1a86","unresolved":false,"context_lines":[{"line_number":225,"context_line":"    def add_sub_port(self, trunk_id, port_id, port_mac, segmentation_id):"},{"line_number":226,"context_line":"        \"\"\"Create a sub_port."},{"line_number":227,"context_line":""},{"line_number":228,"context_line":"        :param trunk_id: id of the trunk"},{"line_number":229,"context_line":"        :param port_id: id of the child port"},{"line_number":230,"context_line":"        :param segmentation_id: segmentation id associated with this sub-port"},{"line_number":231,"context_line":"        :param port_mac: MAC address of the child port"}],"source_content_type":"text/x-python","patch_set":22,"id":"1ac06dbe_32b625f9","line":228,"in_reply_to":"1ac06dbe_efb2fa4a","updated":"2016-08-24 06:51:57.000000000","message":"Done","commit_id":"64da69aabadb6303bf112eacd969f907fe6a4c44"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"ce215eab6a612b7b1be8f782a555f11a81b101ce","unresolved":false,"context_lines":[{"line_number":226,"context_line":"        \"\"\"Create a sub_port."},{"line_number":227,"context_line":""},{"line_number":228,"context_line":"        :param trunk_id: id of the trunk"},{"line_number":229,"context_line":"        :param port_id: id of the child port"},{"line_number":230,"context_line":"        :param segmentation_id: segmentation id associated with this sub-port"},{"line_number":231,"context_line":"        :param port_mac: MAC address of the child port"},{"line_number":232,"context_line":""}],"source_content_type":"text/x-python","patch_set":22,"id":"1ac06dbe_0fb4b632","line":229,"updated":"2016-08-23 21:22:03.000000000","message":"ditto","commit_id":"64da69aabadb6303bf112eacd969f907fe6a4c44"},{"author":{"_account_id":8655,"name":"Jakub Libosvar","email":"libosvar@redhat.com","username":"jlibosva"},"change_message_id":"b896e03f9335e2436e7db16cc48fccfc4efd1a86","unresolved":false,"context_lines":[{"line_number":226,"context_line":"        \"\"\"Create a sub_port."},{"line_number":227,"context_line":""},{"line_number":228,"context_line":"        :param trunk_id: id of the trunk"},{"line_number":229,"context_line":"        :param port_id: id of the child port"},{"line_number":230,"context_line":"        :param segmentation_id: segmentation id associated with this sub-port"},{"line_number":231,"context_line":"        :param port_mac: MAC address of the child port"},{"line_number":232,"context_line":""}],"source_content_type":"text/x-python","patch_set":22,"id":"1ac06dbe_92d1d925","line":229,"in_reply_to":"1ac06dbe_0fb4b632","updated":"2016-08-24 06:51:57.000000000","message":"Done","commit_id":"64da69aabadb6303bf112eacd969f907fe6a4c44"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"ce215eab6a612b7b1be8f782a555f11a81b101ce","unresolved":false,"context_lines":[{"line_number":227,"context_line":""},{"line_number":228,"context_line":"        :param trunk_id: id of the trunk"},{"line_number":229,"context_line":"        :param port_id: id of the child port"},{"line_number":230,"context_line":"        :param segmentation_id: segmentation id associated with this sub-port"},{"line_number":231,"context_line":"        :param port_mac: MAC address of the child port"},{"line_number":232,"context_line":""},{"line_number":233,"context_line":"        \"\"\""}],"source_content_type":"text/x-python","patch_set":22,"id":"1ac06dbe_cfc29e84","line":230,"updated":"2016-08-23 21:22:03.000000000","message":"ID","commit_id":"64da69aabadb6303bf112eacd969f907fe6a4c44"},{"author":{"_account_id":8655,"name":"Jakub Libosvar","email":"libosvar@redhat.com","username":"jlibosva"},"change_message_id":"b896e03f9335e2436e7db16cc48fccfc4efd1a86","unresolved":false,"context_lines":[{"line_number":227,"context_line":""},{"line_number":228,"context_line":"        :param trunk_id: id of the trunk"},{"line_number":229,"context_line":"        :param port_id: id of the child port"},{"line_number":230,"context_line":"        :param segmentation_id: segmentation id associated with this sub-port"},{"line_number":231,"context_line":"        :param port_mac: MAC address of the child port"},{"line_number":232,"context_line":""},{"line_number":233,"context_line":"        \"\"\""}],"source_content_type":"text/x-python","patch_set":22,"id":"1ac06dbe_d2c7d161","line":230,"in_reply_to":"1ac06dbe_cfc29e84","updated":"2016-08-24 06:51:57.000000000","message":"Done","commit_id":"64da69aabadb6303bf112eacd969f907fe6a4c44"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"ce215eab6a612b7b1be8f782a555f11a81b101ce","unresolved":false,"context_lines":[{"line_number":241,"context_line":"    def remove_sub_port(self, trunk_id, port_id):"},{"line_number":242,"context_line":"        \"\"\"Remove a sub_port."},{"line_number":243,"context_line":""},{"line_number":244,"context_line":"        :param trunk_id: id of the trunk"},{"line_number":245,"context_line":"        :param port_id: id of the child port"},{"line_number":246,"context_line":"        \"\"\""},{"line_number":247,"context_line":"        sub_port \u003d SubPort(trunk_id, port_id)"}],"source_content_type":"text/x-python","patch_set":22,"id":"1ac06dbe_4fefce1d","line":244,"updated":"2016-08-23 21:22:03.000000000","message":"here","commit_id":"64da69aabadb6303bf112eacd969f907fe6a4c44"},{"author":{"_account_id":8655,"name":"Jakub Libosvar","email":"libosvar@redhat.com","username":"jlibosva"},"change_message_id":"b896e03f9335e2436e7db16cc48fccfc4efd1a86","unresolved":false,"context_lines":[{"line_number":241,"context_line":"    def remove_sub_port(self, trunk_id, port_id):"},{"line_number":242,"context_line":"        \"\"\"Remove a sub_port."},{"line_number":243,"context_line":""},{"line_number":244,"context_line":"        :param trunk_id: id of the trunk"},{"line_number":245,"context_line":"        :param port_id: id of the child port"},{"line_number":246,"context_line":"        \"\"\""},{"line_number":247,"context_line":"        sub_port \u003d SubPort(trunk_id, port_id)"}],"source_content_type":"text/x-python","patch_set":22,"id":"1ac06dbe_b2c21551","line":244,"in_reply_to":"1ac06dbe_4fefce1d","updated":"2016-08-24 06:51:57.000000000","message":"Done","commit_id":"64da69aabadb6303bf112eacd969f907fe6a4c44"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"ce215eab6a612b7b1be8f782a555f11a81b101ce","unresolved":false,"context_lines":[{"line_number":242,"context_line":"        \"\"\"Remove a sub_port."},{"line_number":243,"context_line":""},{"line_number":244,"context_line":"        :param trunk_id: id of the trunk"},{"line_number":245,"context_line":"        :param port_id: id of the child port"},{"line_number":246,"context_line":"        \"\"\""},{"line_number":247,"context_line":"        sub_port \u003d SubPort(trunk_id, port_id)"},{"line_number":248,"context_line":""}],"source_content_type":"text/x-python","patch_set":22,"id":"1ac06dbe_aff2c203","line":245,"updated":"2016-08-23 21:22:03.000000000","message":"here","commit_id":"64da69aabadb6303bf112eacd969f907fe6a4c44"},{"author":{"_account_id":8655,"name":"Jakub Libosvar","email":"libosvar@redhat.com","username":"jlibosva"},"change_message_id":"b896e03f9335e2436e7db16cc48fccfc4efd1a86","unresolved":false,"context_lines":[{"line_number":242,"context_line":"        \"\"\"Remove a sub_port."},{"line_number":243,"context_line":""},{"line_number":244,"context_line":"        :param trunk_id: id of the trunk"},{"line_number":245,"context_line":"        :param port_id: id of the child port"},{"line_number":246,"context_line":"        \"\"\""},{"line_number":247,"context_line":"        sub_port \u003d SubPort(trunk_id, port_id)"},{"line_number":248,"context_line":""}],"source_content_type":"text/x-python","patch_set":22,"id":"1ac06dbe_12a4c9b7","line":245,"in_reply_to":"1ac06dbe_aff2c203","updated":"2016-08-24 06:51:57.000000000","message":"Done","commit_id":"64da69aabadb6303bf112eacd969f907fe6a4c44"},{"author":{"_account_id":7787,"name":"Kevin Benton","email":"kevin@benton.pub","username":"blak111"},"change_message_id":"a607a070564972fabbf11d4a0835618a47dd869a","unresolved":false,"context_lines":[{"line_number":85,"context_line":""},{"line_number":86,"context_line":"        The object caches whether its already in transaction and if it is, the"},{"line_number":87,"context_line":"        original transaction is returned.  This behavior enables calling"},{"line_number":88,"context_line":"        manager several times while always getting the same transaction."},{"line_number":89,"context_line":"        \"\"\""},{"line_number":90,"context_line":"        if self._transaction:"},{"line_number":91,"context_line":"            yield self._transaction"}],"source_content_type":"text/x-python","patch_set":23,"id":"1ac06dbe_8a3059ea","line":88,"updated":"2016-08-24 17:09:51.000000000","message":"...unless you exit and then re-enter. it might not matter for our use case, but consider the following.\n\nwith tpp.ovsdb_transaction() as txn:\n    for thing in list_of_things:\n        with tpp.ovsdb_transaction() as inner:\n            # inner \u003d\u003d txn only on 1st item because of L98\n            inner.add(thing)","commit_id":"35ffbed6f748cc7f8f4dcba86dd90e193dd38dcc"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"c84a9df8dcde04b1b39a9acc11b807c3cacedd74","unresolved":false,"context_lines":[{"line_number":85,"context_line":""},{"line_number":86,"context_line":"        The object caches whether its already in transaction and if it is, the"},{"line_number":87,"context_line":"        original transaction is returned.  This behavior enables calling"},{"line_number":88,"context_line":"        manager several times while always getting the same transaction."},{"line_number":89,"context_line":"        \"\"\""},{"line_number":90,"context_line":"        if self._transaction:"},{"line_number":91,"context_line":"            yield self._transaction"}],"source_content_type":"text/x-python","patch_set":23,"id":"1ac06dbe_adf44587","line":88,"in_reply_to":"1ac06dbe_689fe050","updated":"2016-08-24 20:23:50.000000000","message":"I won\u0027t be long, just tweaking tests before I push.","commit_id":"35ffbed6f748cc7f8f4dcba86dd90e193dd38dcc"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"42559bd2431195202ba9e6a0d7e485aac4e406e9","unresolved":false,"context_lines":[{"line_number":85,"context_line":""},{"line_number":86,"context_line":"        The object caches whether its already in transaction and if it is, the"},{"line_number":87,"context_line":"        original transaction is returned.  This behavior enables calling"},{"line_number":88,"context_line":"        manager several times while always getting the same transaction."},{"line_number":89,"context_line":"        \"\"\""},{"line_number":90,"context_line":"        if self._transaction:"},{"line_number":91,"context_line":"            yield self._transaction"}],"source_content_type":"text/x-python","patch_set":23,"id":"1ac06dbe_c14517b4","line":88,"in_reply_to":"1ac06dbe_81367fe5","updated":"2016-08-24 17:59:28.000000000","message":"If the intention is to provide support for nested transaction directly in ovs_lib at some point because we think it\u0027s gonna be useful in the future, I guess we\u0027ll have to get back here and revisit this code anyway.\n\nAvoiding the nested transaction might be an option, but at that point I\u0027d avoid the inheritance between parent and subport altogether.\n\nSo we have two options:\n\na) we leave this as is, knowing we\u0027ll have to come back here to revisit the nested transaction support and touch this code;\n\nb) get rid of the nested transaction support altogether, which may still be added in the future, but it does not gonna have an impact on the trunk manager.\n\nThe gate is still relatively clogged, we can keep this with the 2 +2 and wait for the gate to recover. In the meantime I can post a follow-up patch that tries to remove the use of the nested transaction and see how it looks and we can make a final decision.\n\nThoughts?","commit_id":"35ffbed6f748cc7f8f4dcba86dd90e193dd38dcc"},{"author":{"_account_id":16800,"name":"Rawlin Peters","email":"rawlin.peters@hpe.com","username":"rawlin"},"change_message_id":"495903eb0707065064950aa46851e8bc4ce93e09","unresolved":false,"context_lines":[{"line_number":85,"context_line":""},{"line_number":86,"context_line":"        The object caches whether its already in transaction and if it is, the"},{"line_number":87,"context_line":"        original transaction is returned.  This behavior enables calling"},{"line_number":88,"context_line":"        manager several times while always getting the same transaction."},{"line_number":89,"context_line":"        \"\"\""},{"line_number":90,"context_line":"        if self._transaction:"},{"line_number":91,"context_line":"            yield self._transaction"}],"source_content_type":"text/x-python","patch_set":23,"id":"1ac06dbe_81367fe5","line":88,"in_reply_to":"1ac06dbe_8a3059ea","updated":"2016-08-24 17:42:57.000000000","message":"Wouldn\u0027t that be using the method how it\u0027s not intended? I.e. the \"inner\" transaction wouldn\u0027t be needed, and the outer \"txn\" should be used.\n\nIf this is a problem, maybe we should avoid the context manager all together and try my suggestion about a shared private function [1].\n\n[1] https://review.openstack.org/#/c/335536/16/neutron/services/trunk/drivers/openvswitch/agent/trunk_manager.py@164","commit_id":"35ffbed6f748cc7f8f4dcba86dd90e193dd38dcc"},{"author":{"_account_id":16800,"name":"Rawlin Peters","email":"rawlin.peters@hpe.com","username":"rawlin"},"change_message_id":"022c6aab1bf5d35c635a9b13ded3f4ddfcad9ff9","unresolved":false,"context_lines":[{"line_number":85,"context_line":""},{"line_number":86,"context_line":"        The object caches whether its already in transaction and if it is, the"},{"line_number":87,"context_line":"        original transaction is returned.  This behavior enables calling"},{"line_number":88,"context_line":"        manager several times while always getting the same transaction."},{"line_number":89,"context_line":"        \"\"\""},{"line_number":90,"context_line":"        if self._transaction:"},{"line_number":91,"context_line":"            yield self._transaction"}],"source_content_type":"text/x-python","patch_set":23,"id":"1ac06dbe_689fe050","line":88,"in_reply_to":"1ac06dbe_92f7eb8b","updated":"2016-08-24 19:15:42.000000000","message":"@Jakub: your paste shows this works even in the case that Kevin pointed out, but this context manager is still somewhat confusing as we can see.\n\nI think it\u0027s worth it to at least see an alternate implementation that avoids the context manager/nested transaction approach (Option B from Armando\u0027s comment). We might see that we like the follow-up implementation better.","commit_id":"35ffbed6f748cc7f8f4dcba86dd90e193dd38dcc"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"9cb9551d840be44916939165a7e6bd17d78f3b50","unresolved":false,"context_lines":[{"line_number":85,"context_line":""},{"line_number":86,"context_line":"        The object caches whether its already in transaction and if it is, the"},{"line_number":87,"context_line":"        original transaction is returned.  This behavior enables calling"},{"line_number":88,"context_line":"        manager several times while always getting the same transaction."},{"line_number":89,"context_line":"        \"\"\""},{"line_number":90,"context_line":"        if self._transaction:"},{"line_number":91,"context_line":"            yield self._transaction"}],"source_content_type":"text/x-python","patch_set":23,"id":"1ac06dbe_13e133d1","line":88,"in_reply_to":"1ac06dbe_adf44587","updated":"2016-08-24 21:56:29.000000000","message":"I tweaked things a bit in [1]. Plug/unplug operations take a transaction context the same way other neutron operations take a context. I am not strongly opinionated on which approach is cleaner, but if we can punt on the nested transaction problem altogether, perhaps that\u0027s less code we would need to worry about and that\u0027s a good thing :)\n\n[1] https://review.openstack.org/#/c/360089/","commit_id":"35ffbed6f748cc7f8f4dcba86dd90e193dd38dcc"},{"author":{"_account_id":8655,"name":"Jakub Libosvar","email":"libosvar@redhat.com","username":"jlibosva"},"change_message_id":"591d6dbd7e618d30bce5e206b8986edfbbaad2a3","unresolved":false,"context_lines":[{"line_number":85,"context_line":""},{"line_number":86,"context_line":"        The object caches whether its already in transaction and if it is, the"},{"line_number":87,"context_line":"        original transaction is returned.  This behavior enables calling"},{"line_number":88,"context_line":"        manager several times while always getting the same transaction."},{"line_number":89,"context_line":"        \"\"\""},{"line_number":90,"context_line":"        if self._transaction:"},{"line_number":91,"context_line":"            yield self._transaction"}],"source_content_type":"text/x-python","patch_set":23,"id":"1ac06dbe_92f7eb8b","line":88,"in_reply_to":"1ac06dbe_c14517b4","updated":"2016-08-24 18:45:33.000000000","message":"@Kevin: If you exit and re-enter it still works. Commit will be called after txn.__exit__ is called, not inner.__exit__. All inner transactions will return self._transaction on L91 and then return, while __exit__ is called after L98..\n\nhttp://paste.openstack.org/show/563116/","commit_id":"35ffbed6f748cc7f8f4dcba86dd90e193dd38dcc"}],"neutron/services/trunk/utils.py":[{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"6cb0397ea61885338013352dbaa344d61a71138a","unresolved":false,"context_lines":[{"line_number":15,"context_line":""},{"line_number":16,"context_line":""},{"line_number":17,"context_line":"def gen_trunk_br_name(trunk_port_id):"},{"line_number":18,"context_line":"    return (\u0027tbr-\u0027 + trunk_port_id)[:n_const.DEVICE_NAME_MAX_LEN - 1]"}],"source_content_type":"text/x-python","patch_set":6,"id":"bacf61ea_21786ff8","line":18,"updated":"2016-08-02 18:34:12.000000000","message":"do we want a string literal for this prefix?","commit_id":"6749f8b6596d83411dababcaffd1871340ac5963"},{"author":{"_account_id":6788,"name":"Rossella Sblendido","email":"rsblendido@suse.com","username":"rossella-o"},"change_message_id":"1cdf8ac83b4041bbe378bb937bfb09f27c0b3fdb","unresolved":false,"context_lines":[{"line_number":15,"context_line":""},{"line_number":16,"context_line":""},{"line_number":17,"context_line":"def gen_trunk_br_name(trunk_port_id):"},{"line_number":18,"context_line":"    return (\u0027tbr-\u0027 + trunk_port_id)[:n_const.DEVICE_NAME_MAX_LEN - 1]"}],"source_content_type":"text/x-python","patch_set":6,"id":"bacf61ea_91a32cb1","line":18,"in_reply_to":"bacf61ea_21786ff8","updated":"2016-08-03 18:25:27.000000000","message":"not sure what you are suggesting...","commit_id":"6749f8b6596d83411dababcaffd1871340ac5963"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"1af1db5c8f3a36793f3abde1cb8c74f218618172","unresolved":false,"context_lines":[{"line_number":15,"context_line":""},{"line_number":16,"context_line":""},{"line_number":17,"context_line":"def gen_trunk_br_name(trunk_port_id):"},{"line_number":18,"context_line":"    return (\u0027tbr-\u0027 + trunk_port_id)[:n_const.DEVICE_NAME_MAX_LEN - 1]"}],"source_content_type":"text/x-python","patch_set":6,"id":"bacf61ea_d13da4de","line":18,"in_reply_to":"bacf61ea_91a32cb1","updated":"2016-08-03 18:26:27.000000000","message":"turn tbr- into a constant.","commit_id":"6749f8b6596d83411dababcaffd1871340ac5963"},{"author":{"_account_id":16800,"name":"Rawlin Peters","email":"rawlin.peters@hpe.com","username":"rawlin"},"change_message_id":"c20ae644eeb67f88529ddd01e863b0d2d6a6138c","unresolved":false,"context_lines":[{"line_number":14,"context_line":"from neutron_lib import constants as n_const"},{"line_number":15,"context_line":""},{"line_number":16,"context_line":""},{"line_number":17,"context_line":"def gen_trunk_br_name(trunk_id):"},{"line_number":18,"context_line":"    return (\u0027tbr-\u0027 + trunk_id)[:n_const.DEVICE_NAME_MAX_LEN - 1]"}],"source_content_type":"text/x-python","patch_set":7,"id":"bacf61ea_779308fb","line":17,"range":{"start_line":17,"start_character":22,"end_line":17,"end_character":30},"updated":"2016-08-03 19:18:37.000000000","message":"It might make debugging slightly easier to be able to follow the same uuid suffix all the way from the VM to br-int. In that case, we should stick with using the parent port id, but I\u0027m not too adamant about it.","commit_id":"2a853ddbcddc9c9f5058ff6dfc380d8611f64fba"},{"author":{"_account_id":6788,"name":"Rossella Sblendido","email":"rsblendido@suse.com","username":"rossella-o"},"change_message_id":"ab4213e14eef1035ec0ef01d0ca52b43aa89ef6f","unresolved":false,"context_lines":[{"line_number":14,"context_line":"from neutron_lib import constants as n_const"},{"line_number":15,"context_line":""},{"line_number":16,"context_line":""},{"line_number":17,"context_line":"def gen_trunk_br_name(trunk_id):"},{"line_number":18,"context_line":"    return (\u0027tbr-\u0027 + trunk_id)[:n_const.DEVICE_NAME_MAX_LEN - 1]"}],"source_content_type":"text/x-python","patch_set":7,"id":"bacf61ea_506a1282","line":17,"range":{"start_line":17,"start_character":22,"end_line":17,"end_character":30},"in_reply_to":"bacf61ea_779308fb","updated":"2016-08-04 17:59:33.000000000","message":"then I need to pass the parent port ID of the trunk for the subport creation too","commit_id":"2a853ddbcddc9c9f5058ff6dfc380d8611f64fba"},{"author":{"_account_id":6788,"name":"Rossella Sblendido","email":"rsblendido@suse.com","username":"rossella-o"},"change_message_id":"6fdb96897777f6af5d0bd2653cd5c3d2d93ff33f","unresolved":false,"context_lines":[{"line_number":21,"context_line":""},{"line_number":22,"context_line":"def gen_trunk_br_name(trunk_id):"},{"line_number":23,"context_line":"    return ((ovs_const.TRUNK_BR_PREFIX + trunk_id)"},{"line_number":24,"context_line":"            [:constants.DEVICE_NAME_MAX_LEN - 1])"},{"line_number":25,"context_line":""},{"line_number":26,"context_line":""},{"line_number":27,"context_line":"def are_agent_types_available_on_host(context, agent_types, host):"}],"source_content_type":"text/x-python","patch_set":12,"id":"3ac371cc_2e234807","side":"PARENT","line":24,"updated":"2016-08-14 14:15:42.000000000","message":"I realized from the functional test that this is not needed","commit_id":"4478987fbddd9997f06753fa5e3f555c57588b74"},{"author":{"_account_id":4187,"name":"Ryan Tidwell","email":"rtidwell@suse.com","username":"ryan-tidwell"},"change_message_id":"6b09f5087901f849a19a2d3a99739d9b4909dc2a","unresolved":false,"context_lines":[{"line_number":21,"context_line":""},{"line_number":22,"context_line":"def gen_trunk_br_name(trunk_id):"},{"line_number":23,"context_line":"    return ((ovs_const.TRUNK_BR_PREFIX + trunk_id)"},{"line_number":24,"context_line":"            [:constants.DEVICE_NAME_MAX_LEN])"},{"line_number":25,"context_line":""},{"line_number":26,"context_line":""},{"line_number":27,"context_line":"def are_agent_types_available_on_host(context, agent_types, host):"}],"source_content_type":"text/x-python","patch_set":13,"id":"3ac371cc_6cd23302","line":24,"updated":"2016-08-15 22:28:47.000000000","message":"I think nova only allows the device name length to be constants.DEVICE_NAME_MAX_LEN - 1. I\u0027m seeing a disconnect as I hack this together in my environment, nova seems to truncate the bridge name when creating it so it ends up being named something the agent doesn\u0027t expect.","commit_id":"b4b90ac4ae8d259f503515456f91202ef25c60bb"},{"author":{"_account_id":16800,"name":"Rawlin Peters","email":"rawlin.peters@hpe.com","username":"rawlin"},"change_message_id":"21160a82b34e6116cde847cab4def50babc58b70","unresolved":false,"context_lines":[{"line_number":21,"context_line":""},{"line_number":22,"context_line":"def gen_trunk_br_name(trunk_id):"},{"line_number":23,"context_line":"    return ((ovs_const.TRUNK_BR_PREFIX + trunk_id)"},{"line_number":24,"context_line":"            [:constants.DEVICE_NAME_MAX_LEN])"},{"line_number":25,"context_line":""},{"line_number":26,"context_line":""},{"line_number":27,"context_line":"def are_agent_types_available_on_host(context, agent_types, host):"}],"source_content_type":"text/x-python","patch_set":13,"id":"3ac371cc_cc4d279b","line":24,"in_reply_to":"3ac371cc_6cd23302","updated":"2016-08-15 22:38:54.000000000","message":"Ryan is correct. Nova truncates the value of the vif_details \u0027bridge_name\u0027 to 14 chars, which is why I originally wrote this method to have the \u0027-1\u0027.\n\nSo, the \u0027-1\u0027 is still necessary here for the bridge name but not in the patch port names, because those essentially have no length limit.","commit_id":"b4b90ac4ae8d259f503515456f91202ef25c60bb"},{"author":{"_account_id":8655,"name":"Jakub Libosvar","email":"libosvar@redhat.com","username":"jlibosva"},"change_message_id":"c6b9494981dc46186b48a2b37b847c0b2065cde6","unresolved":false,"context_lines":[{"line_number":21,"context_line":""},{"line_number":22,"context_line":"def gen_trunk_br_name(trunk_id):"},{"line_number":23,"context_line":"    return ((ovs_const.TRUNK_BR_PREFIX + trunk_id)"},{"line_number":24,"context_line":"            [:constants.DEVICE_NAME_MAX_LEN])"},{"line_number":25,"context_line":""},{"line_number":26,"context_line":""},{"line_number":27,"context_line":"def are_agent_types_available_on_host(context, agent_types, host):"}],"source_content_type":"text/x-python","patch_set":13,"id":"3ac371cc_f7afad27","line":24,"in_reply_to":"3ac371cc_cc4d279b","updated":"2016-08-17 15:21:30.000000000","message":"Done","commit_id":"b4b90ac4ae8d259f503515456f91202ef25c60bb"}],"neutron/tests/common/conn_testers.py":[{"author":{"_account_id":8655,"name":"Jakub Libosvar","email":"libosvar@redhat.com","username":"jlibosva"},"change_message_id":"cfeff869c2a22d35549e06e830c53fc634e8c621","unresolved":false,"context_lines":[{"line_number":395,"context_line":""},{"line_number":396,"context_line":"    def _setUp(self):"},{"line_number":397,"context_line":"        super(OVSTrunkConnectionTester, self)._setUp()"},{"line_number":398,"context_line":"        if self.bridge is None:"},{"line_number":399,"context_line":"            self.bridge \u003d self.useFixture("},{"line_number":400,"context_line":"                net_helpers.OVSBridgeFixture()).bridge"},{"line_number":401,"context_line":"        self._peer \u003d self.useFixture(machine_fixtures.FakeMachine("}],"source_content_type":"text/x-python","patch_set":10,"id":"9ad45d7e_47b8e1e5","line":398,"range":{"start_line":398,"start_character":11,"end_line":398,"end_character":30},"updated":"2016-08-09 13:46:06.000000000","message":"This is always false as super()._setUp() will create a new OVS bridge on L354. Maybe we shouldn\u0027t call super() here as it creates also peer machines and we should create a br_trunk bridge automatically here instead and exposing bridge and br_trunk attributes back?","commit_id":"d856c99bd854bf73b2540639fcd1e258276d3fb5"},{"author":{"_account_id":6788,"name":"Rossella Sblendido","email":"rsblendido@suse.com","username":"rossella-o"},"change_message_id":"bdec56ebfc66ec88f6375820188b208df096d78c","unresolved":false,"context_lines":[{"line_number":395,"context_line":""},{"line_number":396,"context_line":"    def _setUp(self):"},{"line_number":397,"context_line":"        super(OVSTrunkConnectionTester, self)._setUp()"},{"line_number":398,"context_line":"        if self.bridge is None:"},{"line_number":399,"context_line":"            self.bridge \u003d self.useFixture("},{"line_number":400,"context_line":"                net_helpers.OVSBridgeFixture()).bridge"},{"line_number":401,"context_line":"        self._peer \u003d self.useFixture(machine_fixtures.FakeMachine("}],"source_content_type":"text/x-python","patch_set":10,"id":"9ad45d7e_91940545","line":398,"range":{"start_line":398,"start_character":11,"end_line":398,"end_character":30},"in_reply_to":"9ad45d7e_47b8e1e5","updated":"2016-08-12 16:20:20.000000000","message":"L354 is not executed...this class inherits from OVSBaseConnectionTester","commit_id":"d856c99bd854bf73b2540639fcd1e258276d3fb5"}],"neutron/tests/common/helpers.py":[{"author":{"_account_id":8655,"name":"Jakub Libosvar","email":"libosvar@redhat.com","username":"jlibosva"},"change_message_id":"cfeff869c2a22d35549e06e830c53fc634e8c621","unresolved":false,"context_lines":[{"line_number":215,"context_line":"    return testtools.skipUnless(six.PY3, \"requires python 3.x\")(testcase)"},{"line_number":216,"context_line":""},{"line_number":217,"context_line":""},{"line_number":218,"context_line":"def get_not_used_vlan(self):"},{"line_number":219,"context_line":"        port_vlans \u003d self.tester.bridge.ovsdb.db_find("},{"line_number":220,"context_line":"            \u0027Port\u0027, (\u0027tag\u0027, \u0027!\u003d\u0027, []), columns\u003d[\u0027tag\u0027]).execute()"},{"line_number":221,"context_line":"        used_vlan_tags \u003d {val[\u0027tag\u0027] for val in port_vlans}"}],"source_content_type":"text/x-python","patch_set":10,"id":"9ad45d7e_c7733114","line":218,"range":{"start_line":218,"start_character":22,"end_line":218,"end_character":26},"updated":"2016-08-09 13:46:06.000000000","message":"Bridge? :)","commit_id":"d856c99bd854bf73b2540639fcd1e258276d3fb5"},{"author":{"_account_id":7787,"name":"Kevin Benton","email":"kevin@benton.pub","username":"blak111"},"change_message_id":"6876446f1299c0ebb4552791c3723ed43068d56e","unresolved":false,"context_lines":[{"line_number":215,"context_line":"    return testtools.skipUnless(six.PY3, \"requires python 3.x\")(testcase)"},{"line_number":216,"context_line":""},{"line_number":217,"context_line":""},{"line_number":218,"context_line":"def get_not_used_vlan(self):"},{"line_number":219,"context_line":"        port_vlans \u003d self.tester.bridge.ovsdb.db_find("},{"line_number":220,"context_line":"            \u0027Port\u0027, (\u0027tag\u0027, \u0027!\u003d\u0027, []), columns\u003d[\u0027tag\u0027]).execute()"},{"line_number":221,"context_line":"        used_vlan_tags \u003d {val[\u0027tag\u0027] for val in port_vlans}"}],"source_content_type":"text/x-python","patch_set":10,"id":"9ad45d7e_bba61a51","line":218,"updated":"2016-08-09 12:44:54.000000000","message":"indentation","commit_id":"d856c99bd854bf73b2540639fcd1e258276d3fb5"},{"author":{"_account_id":8655,"name":"Jakub Libosvar","email":"libosvar@redhat.com","username":"jlibosva"},"change_message_id":"cfeff869c2a22d35549e06e830c53fc634e8c621","unresolved":false,"context_lines":[{"line_number":219,"context_line":"        port_vlans \u003d self.tester.bridge.ovsdb.db_find("},{"line_number":220,"context_line":"            \u0027Port\u0027, (\u0027tag\u0027, \u0027!\u003d\u0027, []), columns\u003d[\u0027tag\u0027]).execute()"},{"line_number":221,"context_line":"        used_vlan_tags \u003d {val[\u0027tag\u0027] for val in port_vlans}"},{"line_number":222,"context_line":"        available_vlans \u003d self.vlan_range - used_vlan_tags"},{"line_number":223,"context_line":"        return random.choice(list(available_vlans))"}],"source_content_type":"text/x-python","patch_set":10,"id":"9ad45d7e_475e2177","line":222,"range":{"start_line":222,"start_character":26,"end_line":222,"end_character":41},"updated":"2016-08-09 13:46:06.000000000","message":"This might become a parameter now.","commit_id":"d856c99bd854bf73b2540639fcd1e258276d3fb5"}],"neutron/tests/common/net_helpers.py":[{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"ce215eab6a612b7b1be8f782a555f11a81b101ce","unresolved":false,"context_lines":[{"line_number":686,"context_line":""},{"line_number":687,"context_line":""},{"line_number":688,"context_line":"class OVSTrunkBridgeFixture(OVSBridgeFixture):"},{"line_number":689,"context_line":"    \"\"\"This bridge doesn\u0027t generate the name\"\"\""},{"line_number":690,"context_line":"    def _setUp(self):"},{"line_number":691,"context_line":"        ovs \u003d ovs_lib.BaseOVS()"},{"line_number":692,"context_line":"        self.bridge \u003d ovs.add_bridge(self.prefix)"}],"source_content_type":"text/x-python","patch_set":22,"id":"1ac06dbe_0f5036d3","line":689,"updated":"2016-08-23 21:22:03.000000000","message":"trailing period.","commit_id":"64da69aabadb6303bf112eacd969f907fe6a4c44"},{"author":{"_account_id":8655,"name":"Jakub Libosvar","email":"libosvar@redhat.com","username":"jlibosva"},"change_message_id":"b896e03f9335e2436e7db16cc48fccfc4efd1a86","unresolved":false,"context_lines":[{"line_number":686,"context_line":""},{"line_number":687,"context_line":""},{"line_number":688,"context_line":"class OVSTrunkBridgeFixture(OVSBridgeFixture):"},{"line_number":689,"context_line":"    \"\"\"This bridge doesn\u0027t generate the name\"\"\""},{"line_number":690,"context_line":"    def _setUp(self):"},{"line_number":691,"context_line":"        ovs \u003d ovs_lib.BaseOVS()"},{"line_number":692,"context_line":"        self.bridge \u003d ovs.add_bridge(self.prefix)"}],"source_content_type":"text/x-python","patch_set":22,"id":"1ac06dbe_f28dad31","line":689,"in_reply_to":"1ac06dbe_0f5036d3","updated":"2016-08-24 06:51:57.000000000","message":"Done","commit_id":"64da69aabadb6303bf112eacd969f907fe6a4c44"},{"author":{"_account_id":7787,"name":"Kevin Benton","email":"kevin@benton.pub","username":"blak111"},"change_message_id":"a607a070564972fabbf11d4a0835618a47dd869a","unresolved":false,"context_lines":[{"line_number":687,"context_line":""},{"line_number":688,"context_line":"class OVSTrunkBridgeFixture(OVSBridgeFixture):"},{"line_number":689,"context_line":"    \"\"\"This bridge doesn\u0027t generate the name.\"\"\""},{"line_number":690,"context_line":"    def _setUp(self):"},{"line_number":691,"context_line":"        ovs \u003d ovs_lib.BaseOVS()"},{"line_number":692,"context_line":"        self.bridge \u003d ovs.add_bridge(self.prefix)"},{"line_number":693,"context_line":"        self.addCleanup(self.bridge.destroy)"}],"source_content_type":"text/x-python","patch_set":23,"id":"1ac06dbe_ea4bcd5d","line":690,"updated":"2016-08-24 17:09:51.000000000","message":"shouldn\u0027t this call super()._setUp()?","commit_id":"35ffbed6f748cc7f8f4dcba86dd90e193dd38dcc"},{"author":{"_account_id":8655,"name":"Jakub Libosvar","email":"libosvar@redhat.com","username":"jlibosva"},"change_message_id":"591d6dbd7e618d30bce5e206b8986edfbbaad2a3","unresolved":false,"context_lines":[{"line_number":687,"context_line":""},{"line_number":688,"context_line":"class OVSTrunkBridgeFixture(OVSBridgeFixture):"},{"line_number":689,"context_line":"    \"\"\"This bridge doesn\u0027t generate the name.\"\"\""},{"line_number":690,"context_line":"    def _setUp(self):"},{"line_number":691,"context_line":"        ovs \u003d ovs_lib.BaseOVS()"},{"line_number":692,"context_line":"        self.bridge \u003d ovs.add_bridge(self.prefix)"},{"line_number":693,"context_line":"        self.addCleanup(self.bridge.destroy)"}],"source_content_type":"text/x-python","patch_set":23,"id":"1ac06dbe_57d0c5c9","line":690,"in_reply_to":"1ac06dbe_61d0a3ca","updated":"2016-08-24 18:45:33.000000000","message":"Also calling super() would create random bridge in ovsdb.","commit_id":"35ffbed6f748cc7f8f4dcba86dd90e193dd38dcc"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"42559bd2431195202ba9e6a0d7e485aac4e406e9","unresolved":false,"context_lines":[{"line_number":687,"context_line":""},{"line_number":688,"context_line":"class OVSTrunkBridgeFixture(OVSBridgeFixture):"},{"line_number":689,"context_line":"    \"\"\"This bridge doesn\u0027t generate the name.\"\"\""},{"line_number":690,"context_line":"    def _setUp(self):"},{"line_number":691,"context_line":"        ovs \u003d ovs_lib.BaseOVS()"},{"line_number":692,"context_line":"        self.bridge \u003d ovs.add_bridge(self.prefix)"},{"line_number":693,"context_line":"        self.addCleanup(self.bridge.destroy)"}],"source_content_type":"text/x-python","patch_set":23,"id":"1ac06dbe_61d0a3ca","line":690,"in_reply_to":"1ac06dbe_deb8522d","updated":"2016-08-24 17:59:28.000000000","message":"Right, if we did, we\u0027d end up overwriting self.bridge anyway.","commit_id":"35ffbed6f748cc7f8f4dcba86dd90e193dd38dcc"},{"author":{"_account_id":16800,"name":"Rawlin Peters","email":"rawlin.peters@hpe.com","username":"rawlin"},"change_message_id":"495903eb0707065064950aa46851e8bc4ce93e09","unresolved":false,"context_lines":[{"line_number":687,"context_line":""},{"line_number":688,"context_line":"class OVSTrunkBridgeFixture(OVSBridgeFixture):"},{"line_number":689,"context_line":"    \"\"\"This bridge doesn\u0027t generate the name.\"\"\""},{"line_number":690,"context_line":"    def _setUp(self):"},{"line_number":691,"context_line":"        ovs \u003d ovs_lib.BaseOVS()"},{"line_number":692,"context_line":"        self.bridge \u003d ovs.add_bridge(self.prefix)"},{"line_number":693,"context_line":"        self.addCleanup(self.bridge.destroy)"}],"source_content_type":"text/x-python","patch_set":23,"id":"1ac06dbe_deb8522d","line":690,"in_reply_to":"1ac06dbe_ea4bcd5d","updated":"2016-08-24 17:42:57.000000000","message":"This is super\u0027s setup:\n\n \n def _setUp(self):\n     ovs \u003d ovs_lib.BaseOVS()\n     self.bridge \u003d common_base.create_resource(self.prefix, ovs.add_bridge)\n     self.addCleanup(self.bridge.destroy)\n\nJudging from that, this is a pure override to create a bridge named after self.prefix, rather than (self.prefix + \u003crandomly generated name\u003e).","commit_id":"35ffbed6f748cc7f8f4dcba86dd90e193dd38dcc"}],"neutron/tests/functional/agent/test_firewall.py":[{"author":{"_account_id":8655,"name":"Jakub Libosvar","email":"libosvar@redhat.com","username":"jlibosva"},"change_message_id":"cfeff869c2a22d35549e06e830c53fc634e8c621","unresolved":false,"context_lines":[{"line_number":139,"context_line":"        self.tester.set_vm_tag(vlan)"},{"line_number":140,"context_line":"        self.tester.set_peer_tag(vlan)"},{"line_number":141,"context_line":""},{"line_number":142,"context_line":"    def get_not_used_vlan(self):"},{"line_number":143,"context_line":"        port_vlans \u003d self.firewall.int_br.br.ovsdb.db_find("},{"line_number":144,"context_line":"            \u0027Port\u0027, (\u0027tag\u0027, \u0027!\u003d\u0027, []), columns\u003d[\u0027tag\u0027]).execute()"},{"line_number":145,"context_line":"        used_vlan_tags \u003d {val[\u0027tag\u0027] for val in port_vlans}"},{"line_number":146,"context_line":"        available_vlans \u003d self.vlan_range - used_vlan_tags"},{"line_number":147,"context_line":"        return random.choice(list(available_vlans))"},{"line_number":148,"context_line":""},{"line_number":149,"context_line":"    @staticmethod"},{"line_number":150,"context_line":"    def _create_port_description(port_id, ip_addresses, mac_address, sg_ids):"}],"source_content_type":"text/x-python","patch_set":10,"id":"9ad45d7e_277a0df2","line":147,"range":{"start_line":142,"start_character":0,"end_line":147,"end_character":51},"updated":"2016-08-09 13:46:06.000000000","message":"We should remove this and reuse the one from helpers","commit_id":"d856c99bd854bf73b2540639fcd1e258276d3fb5"},{"author":{"_account_id":6788,"name":"Rossella Sblendido","email":"rsblendido@suse.com","username":"rossella-o"},"change_message_id":"bdec56ebfc66ec88f6375820188b208df096d78c","unresolved":false,"context_lines":[{"line_number":139,"context_line":"        self.tester.set_vm_tag(vlan)"},{"line_number":140,"context_line":"        self.tester.set_peer_tag(vlan)"},{"line_number":141,"context_line":""},{"line_number":142,"context_line":"    def get_not_used_vlan(self):"},{"line_number":143,"context_line":"        port_vlans \u003d self.firewall.int_br.br.ovsdb.db_find("},{"line_number":144,"context_line":"            \u0027Port\u0027, (\u0027tag\u0027, \u0027!\u003d\u0027, []), columns\u003d[\u0027tag\u0027]).execute()"},{"line_number":145,"context_line":"        used_vlan_tags \u003d {val[\u0027tag\u0027] for val in port_vlans}"},{"line_number":146,"context_line":"        available_vlans \u003d self.vlan_range - used_vlan_tags"},{"line_number":147,"context_line":"        return random.choice(list(available_vlans))"},{"line_number":148,"context_line":""},{"line_number":149,"context_line":"    @staticmethod"},{"line_number":150,"context_line":"    def _create_port_description(port_id, ip_addresses, mac_address, sg_ids):"}],"source_content_type":"text/x-python","patch_set":10,"id":"9ad45d7e_bbee48b2","line":147,"range":{"start_line":142,"start_character":0,"end_line":147,"end_character":51},"in_reply_to":"9ad45d7e_277a0df2","updated":"2016-08-12 16:20:20.000000000","message":"Done","commit_id":"d856c99bd854bf73b2540639fcd1e258276d3fb5"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"change_message_id":"08e61f4aa3fba92908a179a7c1a3cd03a5ce51f1","unresolved":false,"context_lines":[{"line_number":36,"context_line":"from neutron.tests.functional.agent.linux import base as linux_base"},{"line_number":37,"context_line":"from neutron.tests.functional import base"},{"line_number":38,"context_line":"from neutron.tests.functional import constants as test_constants"},{"line_number":39,"context_line":""},{"line_number":40,"context_line":""},{"line_number":41,"context_line":"LOG \u003d logging.getLogger(__name__)"},{"line_number":42,"context_line":""}],"source_content_type":"text/x-python","patch_set":11,"id":"3ac371cc_6bbb720f","line":39,"updated":"2016-08-14 11:30:03.000000000","message":"no need for the extra new line","commit_id":"66dccca9c05c9472a2931b88704800fa55a70327"},{"author":{"_account_id":6788,"name":"Rossella Sblendido","email":"rsblendido@suse.com","username":"rossella-o"},"change_message_id":"e0c54394bacec4213617fb3dd361bf65aee4fdf3","unresolved":false,"context_lines":[{"line_number":36,"context_line":"from neutron.tests.functional.agent.linux import base as linux_base"},{"line_number":37,"context_line":"from neutron.tests.functional import base"},{"line_number":38,"context_line":"from neutron.tests.functional import constants as test_constants"},{"line_number":39,"context_line":""},{"line_number":40,"context_line":""},{"line_number":41,"context_line":"LOG \u003d logging.getLogger(__name__)"},{"line_number":42,"context_line":""}],"source_content_type":"text/x-python","patch_set":11,"id":"3ac371cc_8e499cd3","line":39,"in_reply_to":"3ac371cc_6bbb720f","updated":"2016-08-14 14:11:37.000000000","message":"Done","commit_id":"66dccca9c05c9472a2931b88704800fa55a70327"}],"neutron/tests/functional/services/trunk/drivers/openvswitch/agent/test_trunk_manager.py":[{"author":{"_account_id":8655,"name":"Jakub Libosvar","email":"libosvar@redhat.com","username":"jlibosva"},"change_message_id":"ed2ae2e94d593de6c57e694500c971e34269f4c0","unresolved":false,"context_lines":[{"line_number":29,"context_line":"LOG \u003d logging.getLogger(__name__)"},{"line_number":30,"context_line":""},{"line_number":31,"context_line":""},{"line_number":32,"context_line":"VLAN_COUNT \u003d 4096"},{"line_number":33,"context_line":""},{"line_number":34,"context_line":""},{"line_number":35,"context_line":"class TrunkManagerTestCase(base.BaseSudoTestCase):"}],"source_content_type":"text/x-python","patch_set":7,"id":"bacf61ea_e75e0e44","line":32,"range":{"start_line":32,"start_character":0,"end_line":32,"end_character":17},"updated":"2016-08-04 09:02:30.000000000","message":"This is already used in test_firewall - it makes sense to move it to a common constants place now.","commit_id":"2a853ddbcddc9c9f5058ff6dfc380d8611f64fba"},{"author":{"_account_id":6788,"name":"Rossella Sblendido","email":"rsblendido@suse.com","username":"rossella-o"},"change_message_id":"ab4213e14eef1035ec0ef01d0ca52b43aa89ef6f","unresolved":false,"context_lines":[{"line_number":29,"context_line":"LOG \u003d logging.getLogger(__name__)"},{"line_number":30,"context_line":""},{"line_number":31,"context_line":""},{"line_number":32,"context_line":"VLAN_COUNT \u003d 4096"},{"line_number":33,"context_line":""},{"line_number":34,"context_line":""},{"line_number":35,"context_line":"class TrunkManagerTestCase(base.BaseSudoTestCase):"}],"source_content_type":"text/x-python","patch_set":7,"id":"bacf61ea_33b4c833","line":32,"range":{"start_line":32,"start_character":0,"end_line":32,"end_character":17},"in_reply_to":"bacf61ea_e75e0e44","updated":"2016-08-04 17:59:33.000000000","message":"Done","commit_id":"2a853ddbcddc9c9f5058ff6dfc380d8611f64fba"},{"author":{"_account_id":8655,"name":"Jakub Libosvar","email":"libosvar@redhat.com","username":"jlibosva"},"change_message_id":"ed2ae2e94d593de6c57e694500c971e34269f4c0","unresolved":false,"context_lines":[{"line_number":40,"context_line":"    def setUp(self):"},{"line_number":41,"context_line":"        super(TrunkManagerTestCase, self).setUp()"},{"line_number":42,"context_line":"        trunk_id \u003d uuidutils.generate_uuid()"},{"line_number":43,"context_line":"        self.trunk_br \u003d ovs_lib.BaseOVS().add_bridge("},{"line_number":44,"context_line":"            utils.gen_trunk_br_name(trunk_id))"},{"line_number":45,"context_line":"        self.addCleanup(self.trunk_br.destroy)"},{"line_number":46,"context_line":"        self.tester \u003d self.useFixture("}],"source_content_type":"text/x-python","patch_set":7,"id":"bacf61ea_c7ab0a1d","line":43,"range":{"start_line":43,"start_character":24,"end_line":43,"end_character":52},"updated":"2016-08-04 09:02:30.000000000","message":"You can use OVSBridgeFixture here instead","commit_id":"2a853ddbcddc9c9f5058ff6dfc380d8611f64fba"},{"author":{"_account_id":6788,"name":"Rossella Sblendido","email":"rsblendido@suse.com","username":"rossella-o"},"change_message_id":"ab4213e14eef1035ec0ef01d0ca52b43aa89ef6f","unresolved":false,"context_lines":[{"line_number":40,"context_line":"    def setUp(self):"},{"line_number":41,"context_line":"        super(TrunkManagerTestCase, self).setUp()"},{"line_number":42,"context_line":"        trunk_id \u003d uuidutils.generate_uuid()"},{"line_number":43,"context_line":"        self.trunk_br \u003d ovs_lib.BaseOVS().add_bridge("},{"line_number":44,"context_line":"            utils.gen_trunk_br_name(trunk_id))"},{"line_number":45,"context_line":"        self.addCleanup(self.trunk_br.destroy)"},{"line_number":46,"context_line":"        self.tester \u003d self.useFixture("}],"source_content_type":"text/x-python","patch_set":7,"id":"bacf61ea_933814a2","line":43,"range":{"start_line":43,"start_character":24,"end_line":43,"end_character":52},"in_reply_to":"bacf61ea_c7ab0a1d","updated":"2016-08-04 17:59:33.000000000","message":"I need to have a specific name for the trunk bridge","commit_id":"2a853ddbcddc9c9f5058ff6dfc380d8611f64fba"},{"author":{"_account_id":8655,"name":"Jakub Libosvar","email":"libosvar@redhat.com","username":"jlibosva"},"change_message_id":"cfeff869c2a22d35549e06e830c53fc634e8c621","unresolved":false,"context_lines":[{"line_number":38,"context_line":"    def setUp(self):"},{"line_number":39,"context_line":"        super(TrunkManagerTestCase, self).setUp()"},{"line_number":40,"context_line":"        trunk_id \u003d uuidutils.generate_uuid()"},{"line_number":41,"context_line":"        self.trunk_br \u003d ovs_lib.BaseOVS().add_bridge("},{"line_number":42,"context_line":"            utils.gen_trunk_br_name(trunk_id))"},{"line_number":43,"context_line":"        self.addCleanup(self.trunk_br.destroy)"},{"line_number":44,"context_line":"        self.tester \u003d self.useFixture("},{"line_number":45,"context_line":"            conn_testers.OVSTrunkConnectionTester("},{"line_number":46,"context_line":"                self.net1_cidr, self.trunk_br))"}],"source_content_type":"text/x-python","patch_set":10,"id":"9ad45d7e_473f41d6","line":43,"range":{"start_line":41,"start_character":0,"end_line":43,"end_character":46},"updated":"2016-08-09 13:46:06.000000000","message":"I still think we should have a fixture here, ideally let it be created by OVSTrunkConnectionTester. The bridge name can be passed to fixture when you need a specific name.","commit_id":"d856c99bd854bf73b2540639fcd1e258276d3fb5"},{"author":{"_account_id":6788,"name":"Rossella Sblendido","email":"rsblendido@suse.com","username":"rossella-o"},"change_message_id":"bdec56ebfc66ec88f6375820188b208df096d78c","unresolved":false,"context_lines":[{"line_number":38,"context_line":"    def setUp(self):"},{"line_number":39,"context_line":"        super(TrunkManagerTestCase, self).setUp()"},{"line_number":40,"context_line":"        trunk_id \u003d uuidutils.generate_uuid()"},{"line_number":41,"context_line":"        self.trunk_br \u003d ovs_lib.BaseOVS().add_bridge("},{"line_number":42,"context_line":"            utils.gen_trunk_br_name(trunk_id))"},{"line_number":43,"context_line":"        self.addCleanup(self.trunk_br.destroy)"},{"line_number":44,"context_line":"        self.tester \u003d self.useFixture("},{"line_number":45,"context_line":"            conn_testers.OVSTrunkConnectionTester("},{"line_number":46,"context_line":"                self.net1_cidr, self.trunk_br))"}],"source_content_type":"text/x-python","patch_set":10,"id":"9ad45d7e_d11f9db5","line":43,"range":{"start_line":41,"start_character":0,"end_line":43,"end_character":46},"in_reply_to":"9ad45d7e_473f41d6","updated":"2016-08-12 16:20:20.000000000","message":"I see only the prefix as arg...anyway I will leave it to you, I am running out of time and I am sure this test needs some more cleanup","commit_id":"d856c99bd854bf73b2540639fcd1e258276d3fb5"},{"author":{"_account_id":6788,"name":"Rossella Sblendido","email":"rsblendido@suse.com","username":"rossella-o"},"change_message_id":"cb5e5ecd21482798ec0242e9ddd55b1a34a4c395","unresolved":false,"context_lines":[{"line_number":38,"context_line":"    def setUp(self):"},{"line_number":39,"context_line":"        super(TrunkManagerTestCase, self).setUp()"},{"line_number":40,"context_line":"        trunk_id \u003d uuidutils.generate_uuid()"},{"line_number":41,"context_line":"        self.trunk_br \u003d ovs_lib.BaseOVS().add_bridge("},{"line_number":42,"context_line":"            utils.gen_trunk_br_name(trunk_id))"},{"line_number":43,"context_line":"        self.addCleanup(self.trunk_br.destroy)"},{"line_number":44,"context_line":"        self.tester \u003d self.useFixture("},{"line_number":45,"context_line":"            conn_testers.OVSTrunkConnectionTester("},{"line_number":46,"context_line":"                self.net1_cidr, self.trunk_br))"}],"source_content_type":"text/x-python","patch_set":10,"id":"3ac371cc_4e3fa425","line":43,"range":{"start_line":41,"start_character":0,"end_line":43,"end_character":46},"in_reply_to":"9ad45d7e_d11f9db5","updated":"2016-08-14 14:10:55.000000000","message":"I fixed this :)!","commit_id":"d856c99bd854bf73b2540639fcd1e258276d3fb5"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"change_message_id":"08e61f4aa3fba92908a179a7c1a3cd03a5ce51f1","unresolved":false,"context_lines":[{"line_number":24,"context_line":"from neutron.tests.common import helpers"},{"line_number":25,"context_line":"from neutron.tests.functional import base"},{"line_number":26,"context_line":"from neutron.tests.functional import constants as test_constants"},{"line_number":27,"context_line":""},{"line_number":28,"context_line":""},{"line_number":29,"context_line":"LOG \u003d logging.getLogger(__name__)"},{"line_number":30,"context_line":""}],"source_content_type":"text/x-python","patch_set":11,"id":"3ac371cc_ab3baa9b","line":27,"updated":"2016-08-14 11:30:03.000000000","message":"no need for extra new line","commit_id":"66dccca9c05c9472a2931b88704800fa55a70327"},{"author":{"_account_id":6788,"name":"Rossella Sblendido","email":"rsblendido@suse.com","username":"rossella-o"},"change_message_id":"e0c54394bacec4213617fb3dd361bf65aee4fdf3","unresolved":false,"context_lines":[{"line_number":24,"context_line":"from neutron.tests.common import helpers"},{"line_number":25,"context_line":"from neutron.tests.functional import base"},{"line_number":26,"context_line":"from neutron.tests.functional import constants as test_constants"},{"line_number":27,"context_line":""},{"line_number":28,"context_line":""},{"line_number":29,"context_line":"LOG \u003d logging.getLogger(__name__)"},{"line_number":30,"context_line":""}],"source_content_type":"text/x-python","patch_set":11,"id":"3ac371cc_6e46e0c0","line":27,"in_reply_to":"3ac371cc_ab3baa9b","updated":"2016-08-14 14:11:37.000000000","message":"Done","commit_id":"66dccca9c05c9472a2931b88704800fa55a70327"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"5de68fbb3912d02e4b8f29d2558a84e43b24382b","unresolved":false,"context_lines":[{"line_number":47,"context_line":""},{"line_number":48,"context_line":"        In this test we create a vm that has a trunk on net1 and a vm peer on"},{"line_number":49,"context_line":"        the same network. We check connectivity between the peer and the vm."},{"line_number":50,"context_line":"        We create a sub port on net2 and a peer, check connectivity again."},{"line_number":51,"context_line":""},{"line_number":52,"context_line":"        \"\"\""},{"line_number":53,"context_line":"        vlan_net1 \u003d helpers.get_not_used_vlan(self.tester.bridge,"}],"source_content_type":"text/x-python","patch_set":13,"id":"3ac371cc_e191dd53","line":50,"updated":"2016-08-16 16:13:34.000000000","message":"cannot spot race conditions here, but I\u0027d like to give this a harder look.","commit_id":"b4b90ac4ae8d259f503515456f91202ef25c60bb"},{"author":{"_account_id":16800,"name":"Rawlin Peters","email":"rawlin.peters@hpe.com","username":"rawlin"},"change_message_id":"e17e94d81592fd4eb35c671d154964f1e7f3ed4d","unresolved":false,"context_lines":[{"line_number":111,"context_line":"        self.assertIn(self.subport.patch_port_trunk_name,"},{"line_number":112,"context_line":"                      self.subport.bridge.get_port_name_list())"},{"line_number":113,"context_line":"        self.assertIn(self.subport.patch_port_int_name,"},{"line_number":114,"context_line":"                      self.br_int.get_port_name_list())"},{"line_number":115,"context_line":""},{"line_number":116,"context_line":"    def test_create_patch_port_to_bridge_failure_doesnt_create_ports(self):"},{"line_number":117,"context_line":"        with mock.patch.object("}],"source_content_type":"text/x-python","patch_set":16,"id":"1ac06dbe_c8db741a","line":114,"updated":"2016-08-19 18:16:15.000000000","message":"I think we should also assert that the segmentation_id was set as well.","commit_id":"f231bad31b0c9867e50f5fe9836aaf9ef523b783"},{"author":{"_account_id":8655,"name":"Jakub Libosvar","email":"libosvar@redhat.com","username":"jlibosva"},"change_message_id":"0da71fd592d110ed9d4425e91fee2db7c707473a","unresolved":false,"context_lines":[{"line_number":111,"context_line":"        self.assertIn(self.subport.patch_port_trunk_name,"},{"line_number":112,"context_line":"                      self.subport.bridge.get_port_name_list())"},{"line_number":113,"context_line":"        self.assertIn(self.subport.patch_port_int_name,"},{"line_number":114,"context_line":"                      self.br_int.get_port_name_list())"},{"line_number":115,"context_line":""},{"line_number":116,"context_line":"    def test_create_patch_port_to_bridge_failure_doesnt_create_ports(self):"},{"line_number":117,"context_line":"        with mock.patch.object("}],"source_content_type":"text/x-python","patch_set":16,"id":"1ac06dbe_e9ff1aff","line":114,"in_reply_to":"1ac06dbe_c8db741a","updated":"2016-08-22 09:13:32.000000000","message":"Done","commit_id":"f231bad31b0c9867e50f5fe9836aaf9ef523b783"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"8e1dac1f98e90be9e26ce8297d5c12f9c3a645d4","unresolved":false,"context_lines":[{"line_number":50,"context_line":"        self.br_int \u003d self.useFixture(net_helpers.OVSBridgeFixture()).bridge"},{"line_number":51,"context_line":""},{"line_number":52,"context_line":"    def test_plug(self):"},{"line_number":53,"context_line":"        self.trunk.plug(self.br_int)"},{"line_number":54,"context_line":"        self.assertIn(self.trunk.patch_port_trunk_name,"},{"line_number":55,"context_line":"                      self.trunk.bridge.get_port_name_list())"},{"line_number":56,"context_line":"        self.assertIn(self.trunk.patch_port_int_name,"}],"source_content_type":"text/x-python","patch_set":18,"id":"1ac06dbe_6432c8a8","line":53,"updated":"2016-08-23 15:24:53.000000000","message":"This operation is synchronous and blocking is it not? Just wondering if there\u0027s a window where the assert may operate on a list that is not exactly reflecting the state change.","commit_id":"c0517671c69b7f565477ba303e3864504b54e80d"},{"author":{"_account_id":8655,"name":"Jakub Libosvar","email":"libosvar@redhat.com","username":"jlibosva"},"change_message_id":"7389e9aeab2ff6dbb6cac1662b293c0fe79c1051","unresolved":false,"context_lines":[{"line_number":50,"context_line":"        self.br_int \u003d self.useFixture(net_helpers.OVSBridgeFixture()).bridge"},{"line_number":51,"context_line":""},{"line_number":52,"context_line":"    def test_plug(self):"},{"line_number":53,"context_line":"        self.trunk.plug(self.br_int)"},{"line_number":54,"context_line":"        self.assertIn(self.trunk.patch_port_trunk_name,"},{"line_number":55,"context_line":"                      self.trunk.bridge.get_port_name_list())"},{"line_number":56,"context_line":"        self.assertIn(self.trunk.patch_port_int_name,"}],"source_content_type":"text/x-python","patch_set":18,"id":"1ac06dbe_4a9fd35e","line":53,"in_reply_to":"1ac06dbe_6432c8a8","updated":"2016-08-23 15:47:07.000000000","message":"If I remember correctly the ovs lib is single threaded and synchronous, we also use a unique bridge in the system, so it should be fine in terms that no other testing process can inject new port or something into our bridge.","commit_id":"c0517671c69b7f565477ba303e3864504b54e80d"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"8e1dac1f98e90be9e26ce8297d5c12f9c3a645d4","unresolved":false,"context_lines":[{"line_number":190,"context_line":"        # tag the patch port, this should be done by the ovs agent but we mock"},{"line_number":191,"context_line":"        # it for this test"},{"line_number":192,"context_line":"        conn_testers.OVSBaseConnectionTester.set_tag("},{"line_number":193,"context_line":"            self.trunk.patch_port_int_name, self.tester.bridge, vlan_net1)"},{"line_number":194,"context_line":""},{"line_number":195,"context_line":"        self.tester.assert_connection(protocol\u003dself.tester.ICMP,"},{"line_number":196,"context_line":"                                      direction\u003dself.tester.INGRESS)"}],"source_content_type":"text/x-python","patch_set":18,"id":"1ac06dbe_64f4885a","line":193,"updated":"2016-08-23 15:24:53.000000000","message":"these helper are already race proof, are they not? :)","commit_id":"c0517671c69b7f565477ba303e3864504b54e80d"},{"author":{"_account_id":8655,"name":"Jakub Libosvar","email":"libosvar@redhat.com","username":"jlibosva"},"change_message_id":"7389e9aeab2ff6dbb6cac1662b293c0fe79c1051","unresolved":false,"context_lines":[{"line_number":190,"context_line":"        # tag the patch port, this should be done by the ovs agent but we mock"},{"line_number":191,"context_line":"        # it for this test"},{"line_number":192,"context_line":"        conn_testers.OVSBaseConnectionTester.set_tag("},{"line_number":193,"context_line":"            self.trunk.patch_port_int_name, self.tester.bridge, vlan_net1)"},{"line_number":194,"context_line":""},{"line_number":195,"context_line":"        self.tester.assert_connection(protocol\u003dself.tester.ICMP,"},{"line_number":196,"context_line":"                                      direction\u003dself.tester.INGRESS)"}],"source_content_type":"text/x-python","patch_set":18,"id":"1ac06dbe_eaf67f8d","line":193,"in_reply_to":"1ac06dbe_64f4885a","updated":"2016-08-23 15:47:07.000000000","message":"They are isolated by using unique names of bridges in the tests.","commit_id":"c0517671c69b7f565477ba303e3864504b54e80d"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"ce215eab6a612b7b1be8f782a555f11a81b101ce","unresolved":false,"context_lines":[{"line_number":75,"context_line":"        self.assertNotIn(self.trunk.patch_port_int_name,"},{"line_number":76,"context_line":"                         self.br_int.get_port_name_list())"},{"line_number":77,"context_line":""},{"line_number":78,"context_line":"    def test_delete_failure_doesnt_delete_bridge(self):"},{"line_number":79,"context_line":"        self.trunk.plug(self.br_int)"},{"line_number":80,"context_line":"        with mock.patch.object("},{"line_number":81,"context_line":"                self.trunk.bridge.ovsdb, \u0027del_port\u0027,"}],"source_content_type":"text/x-python","patch_set":22,"id":"1ac06dbe_effcbab9","line":78,"updated":"2016-08-23 21:22:03.000000000","message":"unplug","commit_id":"64da69aabadb6303bf112eacd969f907fe6a4c44"},{"author":{"_account_id":8655,"name":"Jakub Libosvar","email":"libosvar@redhat.com","username":"jlibosva"},"change_message_id":"b896e03f9335e2436e7db16cc48fccfc4efd1a86","unresolved":false,"context_lines":[{"line_number":75,"context_line":"        self.assertNotIn(self.trunk.patch_port_int_name,"},{"line_number":76,"context_line":"                         self.br_int.get_port_name_list())"},{"line_number":77,"context_line":""},{"line_number":78,"context_line":"    def test_delete_failure_doesnt_delete_bridge(self):"},{"line_number":79,"context_line":"        self.trunk.plug(self.br_int)"},{"line_number":80,"context_line":"        with mock.patch.object("},{"line_number":81,"context_line":"                self.trunk.bridge.ovsdb, \u0027del_port\u0027,"}],"source_content_type":"text/x-python","patch_set":22,"id":"1ac06dbe_b2705541","line":78,"in_reply_to":"1ac06dbe_effcbab9","updated":"2016-08-24 06:51:57.000000000","message":"Done","commit_id":"64da69aabadb6303bf112eacd969f907fe6a4c44"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"ce215eab6a612b7b1be8f782a555f11a81b101ce","unresolved":false,"context_lines":[{"line_number":136,"context_line":"        self.assertNotIn(self.subport.patch_port_int_name,"},{"line_number":137,"context_line":"                         self.br_int.get_port_name_list())"},{"line_number":138,"context_line":""},{"line_number":139,"context_line":"    def test_delete_failure(self):"},{"line_number":140,"context_line":"        self.subport.plug(self.br_int)"},{"line_number":141,"context_line":"        with mock.patch.object("},{"line_number":142,"context_line":"                self.subport.bridge.ovsdb, \u0027del_port\u0027,"}],"source_content_type":"text/x-python","patch_set":22,"id":"1ac06dbe_2f0372b9","line":139,"updated":"2016-08-23 21:22:03.000000000","message":"unplug","commit_id":"64da69aabadb6303bf112eacd969f907fe6a4c44"},{"author":{"_account_id":8655,"name":"Jakub Libosvar","email":"libosvar@redhat.com","username":"jlibosva"},"change_message_id":"b896e03f9335e2436e7db16cc48fccfc4efd1a86","unresolved":false,"context_lines":[{"line_number":136,"context_line":"        self.assertNotIn(self.subport.patch_port_int_name,"},{"line_number":137,"context_line":"                         self.br_int.get_port_name_list())"},{"line_number":138,"context_line":""},{"line_number":139,"context_line":"    def test_delete_failure(self):"},{"line_number":140,"context_line":"        self.subport.plug(self.br_int)"},{"line_number":141,"context_line":"        with mock.patch.object("},{"line_number":142,"context_line":"                self.subport.bridge.ovsdb, \u0027del_port\u0027,"}],"source_content_type":"text/x-python","patch_set":22,"id":"1ac06dbe_1292094c","line":139,"in_reply_to":"1ac06dbe_2f0372b9","updated":"2016-08-24 06:51:57.000000000","message":"Done","commit_id":"64da69aabadb6303bf112eacd969f907fe6a4c44"}]}
