)]}'
{"neutron/extensions/portbindings.py":[{"author":{"_account_id":6854,"name":"YAMAMOTO Takashi","email":"yamamoto@midokura.com","username":"yamamoto"},"change_message_id":"11165d8f1865c4ab53fd13e64769089cba384b6d","unresolved":false,"context_lines":[{"line_number":49,"context_line":""},{"line_number":50,"context_line":"VIF_TYPE_UNBOUND \u003d \u0027unbound\u0027"},{"line_number":51,"context_line":"VIF_TYPE_BINDING_FAILED \u003d \u0027binding_failed\u0027"},{"line_number":52,"context_line":"VIF_TYPE_DISTRIBUTED \u003d \u0027distributed\u0027"},{"line_number":53,"context_line":"VIF_TYPE_IOVISOR \u003d \u0027iovisor\u0027"},{"line_number":54,"context_line":"VIF_TYPE_OVS \u003d \u0027ovs\u0027"},{"line_number":55,"context_line":"VIF_TYPE_IVS \u003d \u0027ivs\u0027"}],"source_content_type":"text/x-python","patch_set":46,"id":"baada198_4b0aec20","line":52,"updated":"2014-07-25 07:19:15.000000000","message":"can you coordinate with https://review.openstack.org/#/c/109461/ to have a consistent naming?","commit_id":"21673f13e29abf3cee58a387d491e16a090d912c"},{"author":{"_account_id":261,"name":"Salvatore Orlando","email":"salv.orlando@gmail.com","username":"salvatore-orlando"},"change_message_id":"4101b2490881ad5c999f340ed4cc672fe6cedce4","unresolved":false,"context_lines":[{"line_number":49,"context_line":""},{"line_number":50,"context_line":"VIF_TYPE_UNBOUND \u003d \u0027unbound\u0027"},{"line_number":51,"context_line":"VIF_TYPE_BINDING_FAILED \u003d \u0027binding_failed\u0027"},{"line_number":52,"context_line":"VIF_TYPE_DISTRIBUTED \u003d \u0027distributed\u0027"},{"line_number":53,"context_line":"VIF_TYPE_IOVISOR \u003d \u0027iovisor\u0027"},{"line_number":54,"context_line":"VIF_TYPE_OVS \u003d \u0027ovs\u0027"},{"line_number":55,"context_line":"VIF_TYPE_IVS \u003d \u0027ivs\u0027"}],"source_content_type":"text/x-python","patch_set":46,"id":"baada198_fe71b50d","line":52,"in_reply_to":"baada198_4b0aec20","updated":"2014-07-25 12:19:51.000000000","message":"This seems consistent to me.\nThe other patch is adding another vif type for a different purpose.\nI might be missing something but no coordination is needed.","commit_id":"21673f13e29abf3cee58a387d491e16a090d912c"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"f122c84ee37f45b364e6918612fe60a793b0efd8","unresolved":false,"context_lines":[{"line_number":49,"context_line":""},{"line_number":50,"context_line":"VIF_TYPE_UNBOUND \u003d \u0027unbound\u0027"},{"line_number":51,"context_line":"VIF_TYPE_BINDING_FAILED \u003d \u0027binding_failed\u0027"},{"line_number":52,"context_line":"VIF_TYPE_DISTRIBUTED \u003d \u0027distributed\u0027"},{"line_number":53,"context_line":"VIF_TYPE_IOVISOR \u003d \u0027iovisor\u0027"},{"line_number":54,"context_line":"VIF_TYPE_OVS \u003d \u0027ovs\u0027"},{"line_number":55,"context_line":"VIF_TYPE_IVS \u003d \u0027ivs\u0027"}],"source_content_type":"text/x-python","patch_set":46,"id":"baada198_241cfb76","line":52,"in_reply_to":"baada198_fe71b50d","updated":"2014-07-25 14:05:27.000000000","message":"Indeed. I see no clash here...whoever knows DVS is is not going to confuse the two vif types.","commit_id":"21673f13e29abf3cee58a387d491e16a090d912c"}],"neutron/plugins/ml2/db.py":[{"author":{"_account_id":9361,"name":"Vivekanandan Narasimhan","email":"n.vivekanandan@ericsson.com","username":"viveknarasimhan"},"change_message_id":"293403b4f3ea8c5af3b5b124eed63e0af58091df","unresolved":false,"context_lines":[{"line_number":125,"context_line":"            LOG.debug(\"DVR: Deleting binding %s\", binding)"},{"line_number":126,"context_line":"            session.delete(binding)"},{"line_number":127,"context_line":""},{"line_number":128,"context_line":""},{"line_number":129,"context_line":"def get_port(session, port_id):"},{"line_number":130,"context_line":"    \"\"\"Get port record for update within transcation.\"\"\""},{"line_number":131,"context_line":""}],"source_content_type":"text/x-python","patch_set":43,"id":"baada198_7e240c60","line":128,"updated":"2014-07-23 18:56:03.000000000","message":"Not related to this (but indirectly):\r\n\r\ncap_port_filter column got removed from original portbindings table.  We need to remove that from ml2_dvr_port_bindings table and also remove any code that might refer that field.","commit_id":"d2f3c9dae3816a561550358b1ceeb7af91a71910"},{"author":{"_account_id":9361,"name":"Vivekanandan Narasimhan","email":"n.vivekanandan@ericsson.com","username":"viveknarasimhan"},"change_message_id":"f70f8c52ff0078af5d4dc072da4d6b6724c665ed","unresolved":false,"context_lines":[{"line_number":125,"context_line":"            LOG.debug(\"DVR: Deleting binding %s\", binding)"},{"line_number":126,"context_line":"            session.delete(binding)"},{"line_number":127,"context_line":""},{"line_number":128,"context_line":""},{"line_number":129,"context_line":"def get_port(session, port_id):"},{"line_number":130,"context_line":"    \"\"\"Get port record for update within transcation.\"\"\""},{"line_number":131,"context_line":""}],"source_content_type":"text/x-python","patch_set":43,"id":"baada198_55fb8d47","line":128,"in_reply_to":"baada198_0e0e71e5","updated":"2014-07-24 11:16:40.000000000","message":"Needs migration script updates.\r\n\r\nSo not pursuing for now.","commit_id":"d2f3c9dae3816a561550358b1ceeb7af91a71910"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"00ae61d718f2b1da2aad9c38b888394a8bd8e80a","unresolved":false,"context_lines":[{"line_number":125,"context_line":"            LOG.debug(\"DVR: Deleting binding %s\", binding)"},{"line_number":126,"context_line":"            session.delete(binding)"},{"line_number":127,"context_line":""},{"line_number":128,"context_line":""},{"line_number":129,"context_line":"def get_port(session, port_id):"},{"line_number":130,"context_line":"    \"\"\"Get port record for update within transcation.\"\"\""},{"line_number":131,"context_line":""}],"source_content_type":"text/x-python","patch_set":43,"id":"baada198_0e0e71e5","line":128,"in_reply_to":"baada198_7e240c60","updated":"2014-07-24 07:05:16.000000000","message":"agreed, I noticed that myself and I was going to take care of this in the context of:\n\nhttps://review.openstack.org/#/c/109046/","commit_id":"d2f3c9dae3816a561550358b1ceeb7af91a71910"},{"author":{"_account_id":261,"name":"Salvatore Orlando","email":"salv.orlando@gmail.com","username":"salvatore-orlando"},"change_message_id":"4101b2490881ad5c999f340ed4cc672fe6cedce4","unresolved":false,"context_lines":[{"line_number":120,"context_line":""},{"line_number":121,"context_line":""},{"line_number":122,"context_line":"def delete_dvr_port_binding_if_stale(session, binding, router_id, status):"},{"line_number":123,"context_line":"    if not router_id and status \u003d\u003d n_const.PORT_STATUS_DOWN:"},{"line_number":124,"context_line":"        with session.begin(subtransactions\u003dTrue):"},{"line_number":125,"context_line":"            LOG.debug(\"DVR: Deleting binding %s\", binding)"},{"line_number":126,"context_line":"            session.delete(binding)"}],"source_content_type":"text/x-python","patch_set":46,"id":"baada198_d90ecb31","line":123,"updated":"2014-07-25 12:19:51.000000000","message":"I find the first part of the condition a bit strange. We pass router_id to this function just to ensure it\u0027s none... I tend to think the check on router_id should be done on the caller side and if it\u0027s not set then this method should be called.\n\nHowever, this is not important as well.","commit_id":"21673f13e29abf3cee58a387d491e16a090d912c"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"f122c84ee37f45b364e6918612fe60a793b0efd8","unresolved":false,"context_lines":[{"line_number":120,"context_line":""},{"line_number":121,"context_line":""},{"line_number":122,"context_line":"def delete_dvr_port_binding_if_stale(session, binding, router_id, status):"},{"line_number":123,"context_line":"    if not router_id and status \u003d\u003d n_const.PORT_STATUS_DOWN:"},{"line_number":124,"context_line":"        with session.begin(subtransactions\u003dTrue):"},{"line_number":125,"context_line":"            LOG.debug(\"DVR: Deleting binding %s\", binding)"},{"line_number":126,"context_line":"            session.delete(binding)"}],"source_content_type":"text/x-python","patch_set":46,"id":"baada198_c4009f05","line":123,"in_reply_to":"baada198_d90ecb31","updated":"2014-07-25 14:05:27.000000000","message":"I did it just to make the caller code more compact","commit_id":"21673f13e29abf3cee58a387d491e16a090d912c"},{"author":{"_account_id":261,"name":"Salvatore Orlando","email":"salv.orlando@gmail.com","username":"salvatore-orlando"},"change_message_id":"4101b2490881ad5c999f340ed4cc672fe6cedce4","unresolved":false,"context_lines":[{"line_number":123,"context_line":"    if not router_id and status \u003d\u003d n_const.PORT_STATUS_DOWN:"},{"line_number":124,"context_line":"        with session.begin(subtransactions\u003dTrue):"},{"line_number":125,"context_line":"            LOG.debug(\"DVR: Deleting binding %s\", binding)"},{"line_number":126,"context_line":"            session.delete(binding)"},{"line_number":127,"context_line":""},{"line_number":128,"context_line":""},{"line_number":129,"context_line":"def get_port(session, port_id):"}],"source_content_type":"text/x-python","patch_set":46,"id":"baada198_5e1c6177","line":126,"updated":"2014-07-25 12:19:51.000000000","message":"as usual if you can do synchronize_session\u003dfalse this will result in a faster operation. But that\u0027s not important.","commit_id":"21673f13e29abf3cee58a387d491e16a090d912c"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"f122c84ee37f45b364e6918612fe60a793b0efd8","unresolved":false,"context_lines":[{"line_number":123,"context_line":"    if not router_id and status \u003d\u003d n_const.PORT_STATUS_DOWN:"},{"line_number":124,"context_line":"        with session.begin(subtransactions\u003dTrue):"},{"line_number":125,"context_line":"            LOG.debug(\"DVR: Deleting binding %s\", binding)"},{"line_number":126,"context_line":"            session.delete(binding)"},{"line_number":127,"context_line":""},{"line_number":128,"context_line":""},{"line_number":129,"context_line":"def get_port(session, port_id):"}],"source_content_type":"text/x-python","patch_set":46,"id":"baada198_df178844","line":126,"in_reply_to":"baada198_5e1c6177","updated":"2014-07-25 14:05:27.000000000","message":"good point, I forgot to do that, thanks for keeping me honest.","commit_id":"21673f13e29abf3cee58a387d491e16a090d912c"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"e86ff7c7cc141ddb77551264894eff4544bdf09a","unresolved":false,"context_lines":[{"line_number":123,"context_line":"    if not router_id and status \u003d\u003d n_const.PORT_STATUS_DOWN:"},{"line_number":124,"context_line":"        with session.begin(subtransactions\u003dTrue):"},{"line_number":125,"context_line":"            LOG.debug(\"DVR: Deleting binding %s\", binding)"},{"line_number":126,"context_line":"            session.delete(binding)"},{"line_number":127,"context_line":""},{"line_number":128,"context_line":""},{"line_number":129,"context_line":"def get_port(session, port_id):"}],"source_content_type":"text/x-python","patch_set":46,"id":"baada198_fabffac7","line":126,"in_reply_to":"baada198_df178844","updated":"2014-07-25 14:26:35.000000000","message":"actually now that I think about it, synchronize_session can be passed on delete of a query object. Can you do the same on the session?","commit_id":"21673f13e29abf3cee58a387d491e16a090d912c"},{"author":{"_account_id":261,"name":"Salvatore Orlando","email":"salv.orlando@gmail.com","username":"salvatore-orlando"},"change_message_id":"c073e24679b2943a3a7dd3e3c0af5bae7212d557","unresolved":false,"context_lines":[{"line_number":123,"context_line":"    if not router_id and status \u003d\u003d n_const.PORT_STATUS_DOWN:"},{"line_number":124,"context_line":"        with session.begin(subtransactions\u003dTrue):"},{"line_number":125,"context_line":"            LOG.debug(\"DVR: Deleting binding %s\", binding)"},{"line_number":126,"context_line":"            session.delete(binding)"},{"line_number":127,"context_line":""},{"line_number":128,"context_line":""},{"line_number":129,"context_line":"def get_port(session, port_id):"}],"source_content_type":"text/x-python","patch_set":46,"id":"baada198_90c89d57","line":126,"in_reply_to":"baada198_fabffac7","updated":"2014-07-25 15:15:46.000000000","message":"I did not notice you call deleted on a session object.\nMy face under you feet and you can dance on it wearing high heels.","commit_id":"21673f13e29abf3cee58a387d491e16a090d912c"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"2adbc14b46668c2583dfa619bd5b4c9770375752","unresolved":false,"context_lines":[{"line_number":112,"context_line":"        return record"},{"line_number":113,"context_line":""},{"line_number":114,"context_line":""},{"line_number":115,"context_line":"def delete_dvr_port_binding(session, port_id, host):"},{"line_number":116,"context_line":"    with session.begin(subtransactions\u003dTrue):"},{"line_number":117,"context_line":"        (session.query(models.DVRPortBinding)."},{"line_number":118,"context_line":"         filter_by(port_id\u003dport_id, host\u003dhost)."}],"source_content_type":"text/x-python","patch_set":48,"id":"baada198_13b48d34","line":115,"updated":"2014-07-25 22:16:07.000000000","message":"I just found that this method is never called from anywhere except test_ml2_dvr_db.py.  Is this method related to the _if_stale version that this patch adds?","commit_id":"91fa0d64637b08f410f311918c0bef446bf6bc36"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"65d0a788e00f30436e266206d46b69409352c33d","unresolved":false,"context_lines":[{"line_number":112,"context_line":"        return record"},{"line_number":113,"context_line":""},{"line_number":114,"context_line":""},{"line_number":115,"context_line":"def delete_dvr_port_binding(session, port_id, host):"},{"line_number":116,"context_line":"    with session.begin(subtransactions\u003dTrue):"},{"line_number":117,"context_line":"        (session.query(models.DVRPortBinding)."},{"line_number":118,"context_line":"         filter_by(port_id\u003dport_id, host\u003dhost)."}],"source_content_type":"text/x-python","patch_set":48,"id":"baada198_f02f083c","line":115,"in_reply_to":"baada198_13b48d34","updated":"2014-07-25 23:12:27.000000000","message":"true, this has been added in a precedent patch and it\u0027s going to be used in the context of future work that will improve the life cycle management of port bindings.","commit_id":"91fa0d64637b08f410f311918c0bef446bf6bc36"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"2adbc14b46668c2583dfa619bd5b4c9770375752","unresolved":false,"context_lines":[{"line_number":120,"context_line":""},{"line_number":121,"context_line":""},{"line_number":122,"context_line":"def delete_dvr_port_binding_if_stale(session, binding):"},{"line_number":123,"context_line":"    if not binding.router_id and binding.status \u003d\u003d n_const.PORT_STATUS_DOWN:"},{"line_number":124,"context_line":"        with session.begin(subtransactions\u003dTrue):"},{"line_number":125,"context_line":"            LOG.debug(\"DVR: Deleting binding %s\", binding)"},{"line_number":126,"context_line":"            session.delete(binding)"}],"source_content_type":"text/x-python","patch_set":48,"id":"baada198_93a09df4","line":123,"updated":"2014-07-25 22:16:07.000000000","message":"I\u0027m not sure why router_id would evaluate to False here.  In the calling context (neutron/plugins/ml2/plugin.py:1115) binding.router_id is passed here.  I can\u0027t see why that would ever be False.","commit_id":"91fa0d64637b08f410f311918c0bef446bf6bc36"},{"author":{"_account_id":9361,"name":"Vivekanandan Narasimhan","email":"n.vivekanandan@ericsson.com","username":"viveknarasimhan"},"change_message_id":"f5a4d8ec1b18f83a240edb28334d8f2bcca16ab5","unresolved":false,"context_lines":[{"line_number":120,"context_line":""},{"line_number":121,"context_line":""},{"line_number":122,"context_line":"def delete_dvr_port_binding_if_stale(session, binding):"},{"line_number":123,"context_line":"    if not binding.router_id and binding.status \u003d\u003d n_const.PORT_STATUS_DOWN:"},{"line_number":124,"context_line":"        with session.begin(subtransactions\u003dTrue):"},{"line_number":125,"context_line":"            LOG.debug(\"DVR: Deleting binding %s\", binding)"},{"line_number":126,"context_line":"            session.delete(binding)"}],"source_content_type":"text/x-python","patch_set":48,"id":"baada198_84212efe","line":123,"in_reply_to":"baada198_7090584e","updated":"2014-07-26 06:50:42.000000000","message":"The router_id in binding will be set to None as part of DVR Scheduler patch set available  here https://review.openstack.org/#/c/89694/68/neutron/plugins/ml2/plugin.py\r\n\r\ndvr_delete_ns_if_no_vm() method.\r\n\r\nThe router_id inside the binding will be set to None for the replicated port from a compute node when OVS on that node dials update_port_down().   \r\n\r\nRemoval of the binding row from the ml2_dvr_port_bindings is is done here.","commit_id":"91fa0d64637b08f410f311918c0bef446bf6bc36"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"65d0a788e00f30436e266206d46b69409352c33d","unresolved":false,"context_lines":[{"line_number":120,"context_line":""},{"line_number":121,"context_line":""},{"line_number":122,"context_line":"def delete_dvr_port_binding_if_stale(session, binding):"},{"line_number":123,"context_line":"    if not binding.router_id and binding.status \u003d\u003d n_const.PORT_STATUS_DOWN:"},{"line_number":124,"context_line":"        with session.begin(subtransactions\u003dTrue):"},{"line_number":125,"context_line":"            LOG.debug(\"DVR: Deleting binding %s\", binding)"},{"line_number":126,"context_line":"            session.delete(binding)"}],"source_content_type":"text/x-python","patch_set":48,"id":"baada198_7090584e","line":123,"in_reply_to":"baada198_93a09df4","updated":"2014-07-25 23:12:27.000000000","message":"bindings can be set with router_id\u003dNone, see line 92. This only answers your question partially though. I\u0027d need to dig deeper in order to justify the workflow behind. I\u0027ll get back to you on that, unless Vivek beats me to it.","commit_id":"91fa0d64637b08f410f311918c0bef446bf6bc36"}],"neutron/plugins/ml2/driver_api.py":[{"author":{"_account_id":1689,"name":"Robert Kukura","email":"rk@theep.net","username":"rkukura"},"change_message_id":"0b2a788eb0e063fad091cf3bf814076424fdfd9e","unresolved":false,"context_lines":[{"line_number":208,"context_line":"    @abc.abstractproperty"},{"line_number":209,"context_line":"    def binding(self):"},{"line_number":210,"context_line":"        \"\"\"Return the current state of binding for this port.\"\"\""},{"line_number":211,"context_line":"        pass"},{"line_number":212,"context_line":""},{"line_number":213,"context_line":"    @abc.abstractproperty"},{"line_number":214,"context_line":"    def current(self):"}],"source_content_type":"text/x-python","patch_set":33,"id":"baada198_eb705942","line":211,"updated":"2014-07-17 16:20:07.000000000","message":"We really don\u0027t want to expose the binding DB model directly to mechanism drivers. Its an internal detail of the plugin that changes frequently, and is not part of the driver API. Some of the binding details are already visible via attributes in the current property. Others, a made available via separate properties such as bound_driver and bound_segment. If new details need to be exposed, please use one of these approaches.","commit_id":"bd6fdc71e7c4845405afc2391798aae3761da9d9"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"fd19816b4d2027d1a84b7ad7af4522a9065b61cf","unresolved":false,"context_lines":[{"line_number":208,"context_line":"    @abc.abstractproperty"},{"line_number":209,"context_line":"    def binding(self):"},{"line_number":210,"context_line":"        \"\"\"Return the current state of binding for this port.\"\"\""},{"line_number":211,"context_line":"        pass"},{"line_number":212,"context_line":""},{"line_number":213,"context_line":"    @abc.abstractproperty"},{"line_number":214,"context_line":"    def current(self):"}],"source_content_type":"text/x-python","patch_set":33,"id":"baada198_238355cd","line":211,"in_reply_to":"baada198_eb705942","updated":"2014-07-17 19:18:28.000000000","message":"fair point, I\u0027ll revise how this property is used. I\u0027ll strive for better encapsulation and information hiding.","commit_id":"bd6fdc71e7c4845405afc2391798aae3761da9d9"}],"neutron/plugins/ml2/driver_context.py":[{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"fd19816b4d2027d1a84b7ad7af4522a9065b61cf","unresolved":false,"context_lines":[{"line_number":86,"context_line":"        self._new_port_status \u003d None"},{"line_number":87,"context_line":""},{"line_number":88,"context_line":"    @property"},{"line_number":89,"context_line":"    def binding(self):"},{"line_number":90,"context_line":"        return self._binding"},{"line_number":91,"context_line":""},{"line_number":92,"context_line":"    @property"}],"source_content_type":"text/x-python","patch_set":33,"id":"baada198_8367c150","line":89,"updated":"2014-07-17 19:18:28.000000000","message":"remove?","commit_id":"bd6fdc71e7c4845405afc2391798aae3761da9d9"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"2adbc14b46668c2583dfa619bd5b4c9770375752","unresolved":false,"context_lines":[{"line_number":163,"context_line":"    @property"},{"line_number":164,"context_line":"    def bound_host(self):"},{"line_number":165,"context_line":"        if self._port[\u0027device_owner\u0027] \u003d\u003d constants.DEVICE_OWNER_DVR_INTERFACE:"},{"line_number":166,"context_line":"            agent_host \u003d self._binding.host"},{"line_number":167,"context_line":"        else:"},{"line_number":168,"context_line":"            agent_host \u003d self._port[\u0027binding:host_id\u0027]"},{"line_number":169,"context_line":"        return agent_host"}],"source_content_type":"text/x-python","patch_set":48,"id":"baada198_13b9ed15","line":166,"updated":"2014-07-25 22:16:07.000000000","message":"nit:  Why bother with a temporary variable?  Why not just return.  Just a style thing and others may disagree.","commit_id":"91fa0d64637b08f410f311918c0bef446bf6bc36"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"65d0a788e00f30436e266206d46b69409352c33d","unresolved":false,"context_lines":[{"line_number":163,"context_line":"    @property"},{"line_number":164,"context_line":"    def bound_host(self):"},{"line_number":165,"context_line":"        if self._port[\u0027device_owner\u0027] \u003d\u003d constants.DEVICE_OWNER_DVR_INTERFACE:"},{"line_number":166,"context_line":"            agent_host \u003d self._binding.host"},{"line_number":167,"context_line":"        else:"},{"line_number":168,"context_line":"            agent_host \u003d self._port[\u0027binding:host_id\u0027]"},{"line_number":169,"context_line":"        return agent_host"}],"source_content_type":"text/x-python","patch_set":48,"id":"baada198_901c0cc4","line":166,"in_reply_to":"baada198_13b9ed15","updated":"2014-07-25 23:12:27.000000000","message":"fair enough; even though I think I\u0027ll touch the code in the context of:\n\nhttps://review.openstack.org/#/c/109046/\n\nso not sure it\u0027s worth spinning another one, unless we absolutely have to","commit_id":"91fa0d64637b08f410f311918c0bef446bf6bc36"},{"author":{"_account_id":841,"name":"Akihiro Motoki","email":"amotoki@gmail.com","username":"amotoki"},"change_message_id":"bfa43a95c8d2184fa8302b02380711b93e7b9c76","unresolved":false,"context_lines":[{"line_number":158,"context_line":"                 original_port\u003dNone):"},{"line_number":159,"context_line":"        super(DvrPortContext, self).__init__("},{"line_number":160,"context_line":"            plugin, plugin_context, port, network, binding,"},{"line_number":161,"context_line":"            original_port\u003doriginal_port)"},{"line_number":162,"context_line":""},{"line_number":163,"context_line":"    @property"},{"line_number":164,"context_line":"    def bound_host(self):"}],"source_content_type":"text/x-python","patch_set":49,"id":"baada198_d6374afc","line":161,"updated":"2014-07-28 05:49:55.000000000","message":"Why does __init__ need to be redefined? __init__ does the exactly same as the parent class.","commit_id":"cd35b1904e1da5e3da0a63b37af34d426e72e933"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"823822388f67e1cdafb463ff1ed494d679b7024b","unresolved":false,"context_lines":[{"line_number":158,"context_line":"                 original_port\u003dNone):"},{"line_number":159,"context_line":"        super(DvrPortContext, self).__init__("},{"line_number":160,"context_line":"            plugin, plugin_context, port, network, binding,"},{"line_number":161,"context_line":"            original_port\u003doriginal_port)"},{"line_number":162,"context_line":""},{"line_number":163,"context_line":"    @property"},{"line_number":164,"context_line":"    def bound_host(self):"}],"source_content_type":"text/x-python","patch_set":49,"id":"baada198_5d2c204a","line":161,"in_reply_to":"baada198_d6374afc","updated":"2014-07-28 17:33:53.000000000","message":"agreed, this does not harm though","commit_id":"cd35b1904e1da5e3da0a63b37af34d426e72e933"},{"author":{"_account_id":841,"name":"Akihiro Motoki","email":"amotoki@gmail.com","username":"amotoki"},"change_message_id":"bfa43a95c8d2184fa8302b02380711b93e7b9c76","unresolved":false,"context_lines":[{"line_number":165,"context_line":"        if self._port[\u0027device_owner\u0027] \u003d\u003d constants.DEVICE_OWNER_DVR_INTERFACE:"},{"line_number":166,"context_line":"            agent_host \u003d self._binding.host"},{"line_number":167,"context_line":"        else:"},{"line_number":168,"context_line":"            agent_host \u003d self._port[\u0027binding:host_id\u0027]"},{"line_number":169,"context_line":"        return agent_host"}],"source_content_type":"text/x-python","patch_set":49,"id":"baada198_91607c36","line":168,"updated":"2014-07-28 05:49:55.000000000","message":"Isn\u0027t it better to use the same logic as host() in PortContext?\n\n  self._port.get(portbindings.HOST_ID)","commit_id":"cd35b1904e1da5e3da0a63b37af34d426e72e933"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"823822388f67e1cdafb463ff1ed494d679b7024b","unresolved":false,"context_lines":[{"line_number":165,"context_line":"        if self._port[\u0027device_owner\u0027] \u003d\u003d constants.DEVICE_OWNER_DVR_INTERFACE:"},{"line_number":166,"context_line":"            agent_host \u003d self._binding.host"},{"line_number":167,"context_line":"        else:"},{"line_number":168,"context_line":"            agent_host \u003d self._port[\u0027binding:host_id\u0027]"},{"line_number":169,"context_line":"        return agent_host"}],"source_content_type":"text/x-python","patch_set":49,"id":"baada198_3de84cde","line":168,"in_reply_to":"baada198_91607c36","updated":"2014-07-28 17:33:53.000000000","message":"No, there is a slight difference between non- and distributed bindings, hence the DvrPortContext; I am trying to combine the two logics together in:\n\nhttps://review.openstack.org/#/c/109046/\n\non which I am actively working on.","commit_id":"cd35b1904e1da5e3da0a63b37af34d426e72e933"}],"neutron/plugins/ml2/drivers/l2pop/mech_driver.py":[{"author":{"_account_id":6876,"name":"stephen-ma","email":"stephenbma43@gmail.com","username":"stephen-ma"},"change_message_id":"c4f99a74a36b7af40a71b9436bc8ad10602b5c0f","unresolved":false,"context_lines":[{"line_number":126,"context_line":"        diff_ips \u003d self._get_diff_ips(orig, port)"},{"line_number":127,"context_line":"        if diff_ips:"},{"line_number":128,"context_line":"            self._fixed_ips_changed(context, orig, port, diff_ips)"},{"line_number":129,"context_line":"        if (port[\u0027binding:host_id\u0027] !\u003d orig[\u0027binding:host_id\u0027]"},{"line_number":130,"context_line":"            and port[\u0027status\u0027] \u003d\u003d const.PORT_STATUS_ACTIVE"},{"line_number":131,"context_line":"            and not self.migrated_ports.get(orig[\u0027id\u0027])):"},{"line_number":132,"context_line":"            # The port has been migrated. We have to store the original"}],"source_content_type":"text/x-python","patch_set":12,"id":"baada198_46109001","line":129,"updated":"2014-07-01 15:25:06.000000000","message":"To get the host info, should self._get_agent_host(context, port) be called?  I am getting a KeyError here when referencing port[\u0027binding:host_id\u0027].\n\n Traceback (most recent call last):\n    File \"/opt/stack/neutron/neutron/plugins/ml2/managers.py\", line 168, in _call_on_drivers\n      getattr(driver.obj, method_name)(context)^M\n    File \"/opt/stack/neutron/neutron/plugins/ml2/drivers/l2pop/mech_driver.py\", line 131, in update_port_postcommit\n      if (port[\u0027binding:host_id\u0027] !\u003d orig[\u0027binding:host_id\u0027]\n KeyError: \u0027binding:host_id\n TRACE neutron.plugins.ml2.managers\n [req-05f60831-fb97-4e83-96ff-f11dc81ccb86 ] Exception during message handling: update_port_postcommit failed.\n Traceback (most recent call last):\n    File \"/usr/local/lib/python2.7/dist-packages/oslo/messaging/rpc/dispatcher.py\", line 134, in _dispatch_and_reply\n     incoming.message))\n    File \"/usr/local/lib/python2.7/dist-packages/oslo/messaging/rpc/dispatcher.py\", line 177, in _dispatch\n       return self._do_dispatch(endpoint, method, ctxt, args)\n    File \"/usr/local/lib/python2.7/dist-packages/oslo/messaging/rpc/dispatcher.py\", line 123, in _do_dispatch\n       result \u003d getattr(endpoint, method)(ctxt, **new_args)\n    File \"/opt/stack/neutron/neutron/plugins/ml2/rpc.py\", line 217, in update_device_up\n       host)\n    File \"/opt/stack/neutron/neutron/plugins/ml2/plugin.py\", line 921, in update_port_status\n      self.mechanism_manager.update_port_postcommit(mech_context)\n    File \"/opt/stack/neutron/neutron/plugins/ml2/managers.py\", line 404, in update_port_postcommit\n      continue_on_failure\u003dTrue)\n    File \"/opt/stack/neutron/neutron/plugins/ml2/managers.py\", line 179, in _call_on_drivers\n method\u003dmethod_name\n : update_port_postcommit failed.","commit_id":"1b0e3a61a6cbe50a95686cc313f15f5ac8871a53"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"0aea6004558e329e5017a1152a988e21fd766ebc","unresolved":false,"context_lines":[{"line_number":126,"context_line":"        diff_ips \u003d self._get_diff_ips(orig, port)"},{"line_number":127,"context_line":"        if diff_ips:"},{"line_number":128,"context_line":"            self._fixed_ips_changed(context, orig, port, diff_ips)"},{"line_number":129,"context_line":"        if (port[\u0027binding:host_id\u0027] !\u003d orig[\u0027binding:host_id\u0027]"},{"line_number":130,"context_line":"            and port[\u0027status\u0027] \u003d\u003d const.PORT_STATUS_ACTIVE"},{"line_number":131,"context_line":"            and not self.migrated_ports.get(orig[\u0027id\u0027])):"},{"line_number":132,"context_line":"            # The port has been migrated. We have to store the original"}],"source_content_type":"text/x-python","patch_set":14,"id":"baada198_57ce6d84","line":129,"updated":"2014-07-01 21:58:30.000000000","message":"port[\u0027binding:host_id\u0027].\n Traceback (most recent call last):\n    File \"/opt/stack/neutron/neutron/plugins/ml2/managers.py\", line 168, in _call_on_drivers\n      getattr(driver.obj, method_name)(context)^M\n    File \"/opt/stack/neutron/neutron/plugins/ml2/drivers/l2pop/mech_driver.py\", line 131, in update_port_postcommit\n      if (port[\u0027binding:host_id\u0027] !\u003d orig[\u0027binding:host_id\u0027]\n KeyError: \u0027binding:host_id\n TRACE neutron.plugins.ml2.managers\n [req-05f60831-fb97-4e83-96ff-f11dc81ccb86 ] Exception during message handling: update_port_postcommit failed.\n Traceback (most recent call last):\n    File \"/usr/local/lib/python2.7/dist-packages/oslo/messaging/rpc/dispatcher.py\", line 134, in _dispatch_and_reply\n     incoming.message))\n    File \"/usr/local/lib/python2.7/dist-packages/oslo/messaging/rpc/dispatcher.py\", line 177, in _dispatch\n       return self._do_dispatch(endpoint, method, ctxt, args)\n    File \"/usr/local/lib/python2.7/dist-packages/oslo/messaging/rpc/dispatcher.py\", line 123, in _do_dispatch\n       result \u003d getattr(endpoint, method)(ctxt, **new_args)\n    File \"/opt/stack/neutron/neutron/plugins/ml2/rpc.py\", line 217, in update_device_up\n       host)\n    File \"/opt/stack/neutron/neutron/plugins/ml2/plugin.py\", line 921, in update_port_status\n      self.mechanism_manager.update_port_postcommit(mech_context)\n    File \"/opt/stack/neutron/neutron/plugins/ml2/managers.py\", line 404, in update_port_postcommit\n      continue_on_failure\u003dTrue)\n    File \"/opt/stack/neutron/neutron/plugins/ml2/managers.py\", line 179, in _call_on_drivers\n method\u003dmethod_name\n : update_port_postcommit failed.","commit_id":"7fb7ae203e1d75e7552e6967ecd97c90e347dfe4"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"96f2fb64e186ad7e0fd810ddf627728f4589cb06","unresolved":false,"context_lines":[{"line_number":126,"context_line":"        diff_ips \u003d self._get_diff_ips(orig, port)"},{"line_number":127,"context_line":"        if diff_ips:"},{"line_number":128,"context_line":"            self._fixed_ips_changed(context, orig, port, diff_ips)"},{"line_number":129,"context_line":"        if (port[\u0027binding:host_id\u0027] !\u003d orig[\u0027binding:host_id\u0027]"},{"line_number":130,"context_line":"            and port[\u0027status\u0027] \u003d\u003d const.PORT_STATUS_ACTIVE"},{"line_number":131,"context_line":"            and not self.migrated_ports.get(orig[\u0027id\u0027])):"},{"line_number":132,"context_line":"            # The port has been migrated. We have to store the original"}],"source_content_type":"text/x-python","patch_set":14,"id":"baada198_d47a46f0","line":129,"in_reply_to":"baada198_328559d0","updated":"2014-07-03 01:54:33.000000000","message":"I am gonna follow stephen\u0027s suggestion and choose self._get_agent_host(context, port) instead.","commit_id":"7fb7ae203e1d75e7552e6967ecd97c90e347dfe4"},{"author":{"_account_id":9361,"name":"Vivekanandan Narasimhan","email":"n.vivekanandan@ericsson.com","username":"viveknarasimhan"},"change_message_id":"9d93d616f783ccd3c243eac413cc8ef487ff6659","unresolved":false,"context_lines":[{"line_number":126,"context_line":"        diff_ips \u003d self._get_diff_ips(orig, port)"},{"line_number":127,"context_line":"        if diff_ips:"},{"line_number":128,"context_line":"            self._fixed_ips_changed(context, orig, port, diff_ips)"},{"line_number":129,"context_line":"        if (port[\u0027binding:host_id\u0027] !\u003d orig[\u0027binding:host_id\u0027]"},{"line_number":130,"context_line":"            and port[\u0027status\u0027] \u003d\u003d const.PORT_STATUS_ACTIVE"},{"line_number":131,"context_line":"            and not self.migrated_ports.get(orig[\u0027id\u0027])):"},{"line_number":132,"context_line":"            # The port has been migrated. We have to store the original"}],"source_content_type":"text/x-python","patch_set":14,"id":"baada198_8277b039","line":129,"in_reply_to":"baada198_57971890","updated":"2014-07-03 03:29:53.000000000","message":"Carl,\r\nCan you please let me know how this exception is triggered in your code?Was update port triggered for DVR router interface?  Or was the update port triggered for a centralized router interface?","commit_id":"7fb7ae203e1d75e7552e6967ecd97c90e347dfe4"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"aa3ca534131915d86087c47e1e16b35ec7d6eb7b","unresolved":false,"context_lines":[{"line_number":126,"context_line":"        diff_ips \u003d self._get_diff_ips(orig, port)"},{"line_number":127,"context_line":"        if diff_ips:"},{"line_number":128,"context_line":"            self._fixed_ips_changed(context, orig, port, diff_ips)"},{"line_number":129,"context_line":"        if (port[\u0027binding:host_id\u0027] !\u003d orig[\u0027binding:host_id\u0027]"},{"line_number":130,"context_line":"            and port[\u0027status\u0027] \u003d\u003d const.PORT_STATUS_ACTIVE"},{"line_number":131,"context_line":"            and not self.migrated_ports.get(orig[\u0027id\u0027])):"},{"line_number":132,"context_line":"            # The port has been migrated. We have to store the original"}],"source_content_type":"text/x-python","patch_set":14,"id":"baada198_d92c4805","line":129,"in_reply_to":"baada198_57ce6d84","updated":"2014-07-02 20:37:40.000000000","message":"+1 I\u0027ve hit this exception now as well.  I\u0027ll get this in the debugger to see if I can get some more insight...\n\nThe port is the router interface port (10.0.0.1).  There is no host binding.  This is probably something that should be expected given the nature of DVR router interfaces.","commit_id":"7fb7ae203e1d75e7552e6967ecd97c90e347dfe4"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"4d77f845ec0388ae0d108f629ce01286d2884e9a","unresolved":false,"context_lines":[{"line_number":126,"context_line":"        diff_ips \u003d self._get_diff_ips(orig, port)"},{"line_number":127,"context_line":"        if diff_ips:"},{"line_number":128,"context_line":"            self._fixed_ips_changed(context, orig, port, diff_ips)"},{"line_number":129,"context_line":"        if (port[\u0027binding:host_id\u0027] !\u003d orig[\u0027binding:host_id\u0027]"},{"line_number":130,"context_line":"            and port[\u0027status\u0027] \u003d\u003d const.PORT_STATUS_ACTIVE"},{"line_number":131,"context_line":"            and not self.migrated_ports.get(orig[\u0027id\u0027])):"},{"line_number":132,"context_line":"            # The port has been migrated. We have to store the original"}],"source_content_type":"text/x-python","patch_set":14,"id":"baada198_57971890","line":129,"in_reply_to":"baada198_d47a46f0","updated":"2014-07-03 02:22:03.000000000","message":"I that using the method won\u0027t work as get_agent_host picks up context.binding.host whereas here we testing context.current vs context.original....\n\nI\u0027ll add a todo for now...need more clarity around this.","commit_id":"7fb7ae203e1d75e7552e6967ecd97c90e347dfe4"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"25cb0b0d8dd5243dd3f21a696c2f733845451f38","unresolved":false,"context_lines":[{"line_number":126,"context_line":"        diff_ips \u003d self._get_diff_ips(orig, port)"},{"line_number":127,"context_line":"        if diff_ips:"},{"line_number":128,"context_line":"            self._fixed_ips_changed(context, orig, port, diff_ips)"},{"line_number":129,"context_line":"        if (port[\u0027binding:host_id\u0027] !\u003d orig[\u0027binding:host_id\u0027]"},{"line_number":130,"context_line":"            and port[\u0027status\u0027] \u003d\u003d const.PORT_STATUS_ACTIVE"},{"line_number":131,"context_line":"            and not self.migrated_ports.get(orig[\u0027id\u0027])):"},{"line_number":132,"context_line":"            # The port has been migrated. We have to store the original"}],"source_content_type":"text/x-python","patch_set":14,"id":"baada198_328559d0","line":129,"in_reply_to":"baada198_d92c4805","updated":"2014-07-02 22:09:35.000000000","message":"In the short term, I\u0027ve changed my local copy to:\n\nif (port.get(\u0027binding:host_id\u0027) !\u003d orig.get(\u0027binding:host_id\u0027):\n\nI\u0027m not sure if this is the right fix now although it can\u0027t hurt.  I want to understand if it is appropriate for the port to not have host binding in this context.","commit_id":"7fb7ae203e1d75e7552e6967ecd97c90e347dfe4"},{"author":{"_account_id":7183,"name":"Xu Han Peng","email":"xuhanp@linux.vnet.ibm.com","username":"xuhanp"},"change_message_id":"28639e7a39ca6b8b128506661bc6f591c4d826fe","unresolved":false,"context_lines":[{"line_number":136,"context_line":"            self.migrated_ports[orig[\u0027id\u0027]] \u003d orig"},{"line_number":137,"context_line":"        elif port[\u0027device_owner\u0027] \u003d\u003d const.DEVICE_OWNER_DVR_INTERFACE:"},{"line_number":138,"context_line":"            binding \u003d context.binding"},{"line_number":139,"context_line":"            if binding.status \u003d\u003d const.PORT_STATUS_ACTIVE:"},{"line_number":140,"context_line":"                self._update_port_up(context)"},{"line_number":141,"context_line":"            if binding.status \u003d\u003d const.PORT_STATUS_DOWN:"},{"line_number":142,"context_line":"                agent_host \u003d binding.host"}],"source_content_type":"text/x-python","patch_set":15,"id":"baada198_4b6b971d","line":139,"updated":"2014-07-07 09:57:34.000000000","message":"During my test today, the following error is prompted because PortBinding doesn\u0027t have status attribute:\n\nAttributeError: \"\u0027PortBinding\u0027 object has no attribute \u0027status\u0027\"","commit_id":"8b05e6018964f0590645beb8545d17092cf6f059"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"7113e94a7af90c8e714ec5ecb49dcbd5d886cd00","unresolved":false,"context_lines":[{"line_number":136,"context_line":"            self.migrated_ports[orig[\u0027id\u0027]] \u003d orig"},{"line_number":137,"context_line":"        elif port[\u0027device_owner\u0027] \u003d\u003d const.DEVICE_OWNER_DVR_INTERFACE:"},{"line_number":138,"context_line":"            binding \u003d context.binding"},{"line_number":139,"context_line":"            if binding.status \u003d\u003d const.PORT_STATUS_ACTIVE:"},{"line_number":140,"context_line":"                self._update_port_up(context)"},{"line_number":141,"context_line":"            if binding.status \u003d\u003d const.PORT_STATUS_DOWN:"},{"line_number":142,"context_line":"                agent_host \u003d binding.host"}],"source_content_type":"text/x-python","patch_set":15,"id":"baada198_24e1142a","line":139,"in_reply_to":"baada198_217bc6be","updated":"2014-07-08 01:05:50.000000000","message":"I think I root-caused it to an issue with: https://review.openstack.org/#/c/102332/\n\nRebase coming shortly","commit_id":"8b05e6018964f0590645beb8545d17092cf6f059"},{"author":{"_account_id":9361,"name":"Vivekanandan Narasimhan","email":"n.vivekanandan@ericsson.com","username":"viveknarasimhan"},"change_message_id":"1590244f10c0a1cb5c11faed189ae645069934cb","unresolved":false,"context_lines":[{"line_number":136,"context_line":"            self.migrated_ports[orig[\u0027id\u0027]] \u003d orig"},{"line_number":137,"context_line":"        elif port[\u0027device_owner\u0027] \u003d\u003d const.DEVICE_OWNER_DVR_INTERFACE:"},{"line_number":138,"context_line":"            binding \u003d context.binding"},{"line_number":139,"context_line":"            if binding.status \u003d\u003d const.PORT_STATUS_ACTIVE:"},{"line_number":140,"context_line":"                self._update_port_up(context)"},{"line_number":141,"context_line":"            if binding.status \u003d\u003d const.PORT_STATUS_DOWN:"},{"line_number":142,"context_line":"                agent_host \u003d binding.host"}],"source_content_type":"text/x-python","patch_set":15,"id":"baada198_5f526a67","line":139,"in_reply_to":"baada198_4b6b971d","updated":"2014-07-07 13:12:17.000000000","message":"All DVR Interface ports will have DVRPortBinding as the referral table.  \r\nIf you see DVRPortBinding table it has a status field which is not required in the original PortBinding table.\r\n\r\nWhen you try this patch, you need to first patch #102101 which will make this error go away.","commit_id":"8b05e6018964f0590645beb8545d17092cf6f059"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"b85a9d317c80cc2bf6542fe44c7186fc6faff3a5","unresolved":false,"context_lines":[{"line_number":136,"context_line":"            self.migrated_ports[orig[\u0027id\u0027]] \u003d orig"},{"line_number":137,"context_line":"        elif port[\u0027device_owner\u0027] \u003d\u003d const.DEVICE_OWNER_DVR_INTERFACE:"},{"line_number":138,"context_line":"            binding \u003d context.binding"},{"line_number":139,"context_line":"            if binding.status \u003d\u003d const.PORT_STATUS_ACTIVE:"},{"line_number":140,"context_line":"                self._update_port_up(context)"},{"line_number":141,"context_line":"            if binding.status \u003d\u003d const.PORT_STATUS_DOWN:"},{"line_number":142,"context_line":"                agent_host \u003d binding.host"}],"source_content_type":"text/x-python","patch_set":15,"id":"baada198_217bc6be","line":139,"in_reply_to":"baada198_4e7aba24","updated":"2014-07-08 00:51:44.000000000","message":"I am afraid I am seeing this error too and I am pretty sure I am running all the required patches. I managed to reproduce the fault when I run the tempest security groups tests, and it happens when the L3 agent is syncing the routers. I\u0027ll try to find out more.","commit_id":"8b05e6018964f0590645beb8545d17092cf6f059"},{"author":{"_account_id":7183,"name":"Xu Han Peng","email":"xuhanp@linux.vnet.ibm.com","username":"xuhanp"},"change_message_id":"a13b31965b652195746ee67e9e56e5bd898f82fa","unresolved":false,"context_lines":[{"line_number":136,"context_line":"            self.migrated_ports[orig[\u0027id\u0027]] \u003d orig"},{"line_number":137,"context_line":"        elif port[\u0027device_owner\u0027] \u003d\u003d const.DEVICE_OWNER_DVR_INTERFACE:"},{"line_number":138,"context_line":"            binding \u003d context.binding"},{"line_number":139,"context_line":"            if binding.status \u003d\u003d const.PORT_STATUS_ACTIVE:"},{"line_number":140,"context_line":"                self._update_port_up(context)"},{"line_number":141,"context_line":"            if binding.status \u003d\u003d const.PORT_STATUS_DOWN:"},{"line_number":142,"context_line":"                agent_host \u003d binding.host"}],"source_content_type":"text/x-python","patch_set":15,"id":"baada198_f857d4c7","line":139,"in_reply_to":"baada198_5f526a67","updated":"2014-07-07 14:21:50.000000000","message":"Vivek, I already got #102101 patched in my test env. Should this be port[\u0027status\u0027] like line 110?","commit_id":"8b05e6018964f0590645beb8545d17092cf6f059"},{"author":{"_account_id":9361,"name":"Vivekanandan Narasimhan","email":"n.vivekanandan@ericsson.com","username":"viveknarasimhan"},"change_message_id":"65dc5ab149178967dfef430fe5f2e5f55fc0bbba","unresolved":false,"context_lines":[{"line_number":136,"context_line":"            self.migrated_ports[orig[\u0027id\u0027]] \u003d orig"},{"line_number":137,"context_line":"        elif port[\u0027device_owner\u0027] \u003d\u003d const.DEVICE_OWNER_DVR_INTERFACE:"},{"line_number":138,"context_line":"            binding \u003d context.binding"},{"line_number":139,"context_line":"            if binding.status \u003d\u003d const.PORT_STATUS_ACTIVE:"},{"line_number":140,"context_line":"                self._update_port_up(context)"},{"line_number":141,"context_line":"            if binding.status \u003d\u003d const.PORT_STATUS_DOWN:"},{"line_number":142,"context_line":"                agent_host \u003d binding.host"}],"source_content_type":"text/x-python","patch_set":15,"id":"baada198_4e7aba24","line":139,"in_reply_to":"baada198_f857d4c7","updated":"2014-07-07 15:32:20.000000000","message":"No. DVRPortBinding has a status field not in original PortBinding table.  You can look for this field in ml2/models.py in patch #102101.","commit_id":"8b05e6018964f0590645beb8545d17092cf6f059"},{"author":{"_account_id":4395,"name":"Aaron Rosen","email":"aaronorosen@gmail.com","username":"arosen"},"change_message_id":"1ac78eaa57d9cfe9e5a0dfc1371688022a2a2929","unresolved":false,"context_lines":[{"line_number":44,"context_line":"        self.migrated_ports \u003d {}"},{"line_number":45,"context_line":"        self.remove_fdb_entries \u003d {}"},{"line_number":46,"context_line":""},{"line_number":47,"context_line":"    def _get_port_fdb_entries(self, port):"},{"line_number":48,"context_line":"        return [[port[\u0027mac_address\u0027], port[\u0027device_owner\u0027],"},{"line_number":49,"context_line":"                 ip[\u0027ip_address\u0027]] for ip in port[\u0027fixed_ips\u0027]]"},{"line_number":50,"context_line":""}],"source_content_type":"text/x-python","patch_set":19,"id":"baada198_9b8cd237","line":47,"updated":"2014-07-09 01:06:01.000000000","message":"just curious what does fdb stand for?","commit_id":"ec4848b7a9006482162f417e8d027c27837f8ed6"},{"author":{"_account_id":4395,"name":"Aaron Rosen","email":"aaronorosen@gmail.com","username":"arosen"},"change_message_id":"1ac78eaa57d9cfe9e5a0dfc1371688022a2a2929","unresolved":false,"context_lines":[{"line_number":100,"context_line":"            return"},{"line_number":101,"context_line":"        agent, agent_host, agent_ip, segment, port_fdb_entries \u003d port_infos"},{"line_number":102,"context_line":""},{"line_number":103,"context_line":"        orig_mac_ip \u003d [[port[\u0027mac_address\u0027], port[\u0027device_owner\u0027], ip]"},{"line_number":104,"context_line":"                       for ip in orig_ips]"},{"line_number":105,"context_line":"        port_mac_ip \u003d [[port[\u0027mac_address\u0027], port[\u0027device_owner\u0027], ip]"},{"line_number":106,"context_line":"                       for ip in port_ips]"}],"source_content_type":"text/x-python","patch_set":19,"id":"baada198_fb7a2e24","line":103,"updated":"2014-07-09 01:06:01.000000000","message":"I guess you can\u0027t use your helper function you defined, \"_get_port_fdb_entries\"","commit_id":"ec4848b7a9006482162f417e8d027c27837f8ed6"},{"author":{"_account_id":4395,"name":"Aaron Rosen","email":"aaronorosen@gmail.com","username":"arosen"},"change_message_id":"1ac78eaa57d9cfe9e5a0dfc1371688022a2a2929","unresolved":false,"context_lines":[{"line_number":191,"context_line":""},{"line_number":192,"context_line":"        fdb_entries \u003d self._get_port_fdb_entries(port)"},{"line_number":193,"context_line":""},{"line_number":194,"context_line":"        return agent, agent_host, agent_ip, segment, fdb_entries"},{"line_number":195,"context_line":""},{"line_number":196,"context_line":"    def _update_port_up(self, context):"},{"line_number":197,"context_line":"        port_context \u003d context.current"}],"source_content_type":"text/x-python","patch_set":19,"id":"baada198_5ba95a7a","line":194,"updated":"2014-07-09 01:06:01.000000000","message":"random comment: it would be nice if we returned dicts here instead of a tuple of all these things (or better yet an object that encaps all this).","commit_id":"ec4848b7a9006482162f417e8d027c27837f8ed6"},{"author":{"_account_id":4395,"name":"Aaron Rosen","email":"aaronorosen@gmail.com","username":"arosen"},"change_message_id":"1ac78eaa57d9cfe9e5a0dfc1371688022a2a2929","unresolved":false,"context_lines":[{"line_number":239,"context_line":"                agent_ports +\u003d self._get_port_fdb_entries(binding.port)"},{"line_number":240,"context_line":"                ports[ip] \u003d agent_ports"},{"line_number":241,"context_line":""},{"line_number":242,"context_line":"            dvr_network_ports \u003d self.get_dvr_network_ports(session, network_id)"},{"line_number":243,"context_line":"            for network_port in dvr_network_ports:"},{"line_number":244,"context_line":"                binding, agent \u003d network_port"},{"line_number":245,"context_line":"                if agent.host \u003d\u003d agent_host:"}],"source_content_type":"text/x-python","patch_set":19,"id":"baada198_5bc07a2a","line":242,"updated":"2014-07-09 01:06:01.000000000","message":"might be nice to pull this logic out to a helper function so this method doesn\u0027t keep growing.","commit_id":"ec4848b7a9006482162f417e8d027c27837f8ed6"},{"author":{"_account_id":6659,"name":"Paul Michali","email":"pc@michali.net","username":"pcm"},"change_message_id":"6baa33d0d7456ef033621f77e7cdf9de39ed63f4","unresolved":false,"context_lines":[{"line_number":239,"context_line":""},{"line_number":240,"context_line":"                ip \u003d self.get_agent_ip(agent)"},{"line_number":241,"context_line":"                if not ip:"},{"line_number":242,"context_line":"                    LOG.debug(_(\"Unable to retrieve the agent ip, check \""},{"line_number":243,"context_line":"                                \"the agent %(agent_host)s configuration.\"),"},{"line_number":244,"context_line":"                              {\u0027agent_host\u0027: agent.host})"},{"line_number":245,"context_line":"                    continue"}],"source_content_type":"text/x-python","patch_set":32,"id":"baada198_bb56dd28","line":242,"updated":"2014-07-16 18:36:06.000000000","message":"Since adding debug long, can exclude i18n translation. Also, since only one parameter, don\u0027t need dict.","commit_id":"6c6d547f44af23a23448e893e1fe0ee6c1ec9d24"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"886d5cd2eed2cc7403a22386ca7a20fbbb5b2aea","unresolved":false,"context_lines":[{"line_number":239,"context_line":""},{"line_number":240,"context_line":"                ip \u003d self.get_agent_ip(agent)"},{"line_number":241,"context_line":"                if not ip:"},{"line_number":242,"context_line":"                    LOG.debug(_(\"Unable to retrieve the agent ip, check \""},{"line_number":243,"context_line":"                                \"the agent %(agent_host)s configuration.\"),"},{"line_number":244,"context_line":"                              {\u0027agent_host\u0027: agent.host})"},{"line_number":245,"context_line":"                    continue"}],"source_content_type":"text/x-python","patch_set":32,"id":"baada198_4d9d0859","line":242,"in_reply_to":"baada198_bb56dd28","updated":"2014-07-16 18:51:52.000000000","message":"Done","commit_id":"6c6d547f44af23a23448e893e1fe0ee6c1ec9d24"},{"author":{"_account_id":1689,"name":"Robert Kukura","email":"rk@theep.net","username":"rkukura"},"change_message_id":"0b2a788eb0e063fad091cf3bf814076424fdfd9e","unresolved":false,"context_lines":[{"line_number":50,"context_line":""},{"line_number":51,"context_line":"    def _get_agent_host(self, context, port):"},{"line_number":52,"context_line":"        if port[\u0027device_owner\u0027] \u003d\u003d const.DEVICE_OWNER_DVR_INTERFACE:"},{"line_number":53,"context_line":"            agent_host \u003d context.binding.host"},{"line_number":54,"context_line":"        else:"},{"line_number":55,"context_line":"            agent_host \u003d port[\u0027binding:host_id\u0027]"},{"line_number":56,"context_line":"        return agent_host"}],"source_content_type":"text/x-python","patch_set":33,"id":"baada198_4b5a2584","line":53,"updated":"2014-07-17 16:20:07.000000000","message":"Maybe this should be a new bound_host property on PortContext that could encapsulate this logic and avoid exposing the binding DB model class to drivers.","commit_id":"bd6fdc71e7c4845405afc2391798aae3761da9d9"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"fd19816b4d2027d1a84b7ad7af4522a9065b61cf","unresolved":false,"context_lines":[{"line_number":50,"context_line":""},{"line_number":51,"context_line":"    def _get_agent_host(self, context, port):"},{"line_number":52,"context_line":"        if port[\u0027device_owner\u0027] \u003d\u003d const.DEVICE_OWNER_DVR_INTERFACE:"},{"line_number":53,"context_line":"            agent_host \u003d context.binding.host"},{"line_number":54,"context_line":"        else:"},{"line_number":55,"context_line":"            agent_host \u003d port[\u0027binding:host_id\u0027]"},{"line_number":56,"context_line":"        return agent_host"}],"source_content_type":"text/x-python","patch_set":33,"id":"baada198_57ae3f99","line":53,"in_reply_to":"baada198_4b5a2584","updated":"2014-07-17 19:18:28.000000000","message":"seems sensible, even though this sounds outside the scope of this patch as the binding:host_id have been used elsewhere, prior to this patch. What about doing it on a patch on the side? I\u0027ll start to work on it.","commit_id":"bd6fdc71e7c4845405afc2391798aae3761da9d9"},{"author":{"_account_id":1689,"name":"Robert Kukura","email":"rk@theep.net","username":"rkukura"},"change_message_id":"0b2a788eb0e063fad091cf3bf814076424fdfd9e","unresolved":false,"context_lines":[{"line_number":119,"context_line":"        if diff_ips:"},{"line_number":120,"context_line":"            self._fixed_ips_changed(context, orig, port, diff_ips)"},{"line_number":121,"context_line":"        # TODO(vivek): DVR may need more robust handling of binding:host_id key"},{"line_number":122,"context_line":"        if (port.get(\u0027binding:host_id\u0027) !\u003d orig.get(\u0027binding:host_id\u0027)"},{"line_number":123,"context_line":"            and port[\u0027status\u0027] \u003d\u003d const.PORT_STATUS_ACTIVE"},{"line_number":124,"context_line":"            and not self.migrated_ports.get(orig[\u0027id\u0027])):"},{"line_number":125,"context_line":"            # The port has been migrated. We have to store the original"}],"source_content_type":"text/x-python","patch_set":33,"id":"baada198_eb7bf9bb","line":122,"updated":"2014-07-17 16:20:07.000000000","message":"Again, adding bound_host and original_bound_host properties to port_context would avoid exposing a lot of this logic to the drivers.","commit_id":"bd6fdc71e7c4845405afc2391798aae3761da9d9"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"fd19816b4d2027d1a84b7ad7af4522a9065b61cf","unresolved":false,"context_lines":[{"line_number":119,"context_line":"        if diff_ips:"},{"line_number":120,"context_line":"            self._fixed_ips_changed(context, orig, port, diff_ips)"},{"line_number":121,"context_line":"        # TODO(vivek): DVR may need more robust handling of binding:host_id key"},{"line_number":122,"context_line":"        if (port.get(\u0027binding:host_id\u0027) !\u003d orig.get(\u0027binding:host_id\u0027)"},{"line_number":123,"context_line":"            and port[\u0027status\u0027] \u003d\u003d const.PORT_STATUS_ACTIVE"},{"line_number":124,"context_line":"            and not self.migrated_ports.get(orig[\u0027id\u0027])):"},{"line_number":125,"context_line":"            # The port has been migrated. We have to store the original"}],"source_content_type":"text/x-python","patch_set":33,"id":"baada198_57b39fe8","line":122,"in_reply_to":"baada198_eb7bf9bb","updated":"2014-07-17 19:18:28.000000000","message":"Yes, this is another example where this could be encapsulated better; DVR has only made this more evident.","commit_id":"bd6fdc71e7c4845405afc2391798aae3761da9d9"},{"author":{"_account_id":1689,"name":"Robert Kukura","email":"rk@theep.net","username":"rkukura"},"change_message_id":"0b2a788eb0e063fad091cf3bf814076424fdfd9e","unresolved":false,"context_lines":[{"line_number":128,"context_line":"            self.migrated_ports[orig[\u0027id\u0027]] \u003d orig"},{"line_number":129,"context_line":"        elif port[\u0027device_owner\u0027] \u003d\u003d const.DEVICE_OWNER_DVR_INTERFACE:"},{"line_number":130,"context_line":"            binding \u003d context.binding"},{"line_number":131,"context_line":"            if binding.status \u003d\u003d const.PORT_STATUS_ACTIVE:"},{"line_number":132,"context_line":"                self._update_port_up(context)"},{"line_number":133,"context_line":"            if binding.status \u003d\u003d const.PORT_STATUS_DOWN:"},{"line_number":134,"context_line":"                agent_host \u003d binding.host"}],"source_content_type":"text/x-python","patch_set":33,"id":"baada198_eb521934","line":131,"updated":"2014-07-17 16:20:07.000000000","message":"Maybe we need to add accessors for the status and original_status to the PortContext.","commit_id":"bd6fdc71e7c4845405afc2391798aae3761da9d9"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"fd19816b4d2027d1a84b7ad7af4522a9065b61cf","unresolved":false,"context_lines":[{"line_number":128,"context_line":"            self.migrated_ports[orig[\u0027id\u0027]] \u003d orig"},{"line_number":129,"context_line":"        elif port[\u0027device_owner\u0027] \u003d\u003d const.DEVICE_OWNER_DVR_INTERFACE:"},{"line_number":130,"context_line":"            binding \u003d context.binding"},{"line_number":131,"context_line":"            if binding.status \u003d\u003d const.PORT_STATUS_ACTIVE:"},{"line_number":132,"context_line":"                self._update_port_up(context)"},{"line_number":133,"context_line":"            if binding.status \u003d\u003d const.PORT_STATUS_DOWN:"},{"line_number":134,"context_line":"                agent_host \u003d binding.host"}],"source_content_type":"text/x-python","patch_set":33,"id":"baada198_17076782","line":131,"in_reply_to":"baada198_eb521934","updated":"2014-07-17 19:18:28.000000000","message":"What about doing this in a patch that provides better encapsulation for the mech_context? We\u0027ll encapsulate the status as well as the the bound host.","commit_id":"bd6fdc71e7c4845405afc2391798aae3761da9d9"},{"author":{"_account_id":9361,"name":"Vivekanandan Narasimhan","email":"n.vivekanandan@ericsson.com","username":"viveknarasimhan"},"change_message_id":"293403b4f3ea8c5af3b5b124eed63e0af58091df","unresolved":false,"context_lines":[{"line_number":62,"context_line":"            for agent_host in list(self.remove_fdb_entries[port[\u0027id\u0027]]):"},{"line_number":63,"context_line":"                self.L2populationAgentNotify.remove_fdb_entries("},{"line_number":64,"context_line":"                    self.rpc_ctx,"},{"line_number":65,"context_line":"                    self.remove_fdb_entries[port[\u0027id\u0027]][agent_host])"},{"line_number":66,"context_line":"                self.remove_fdb_entries[port[\u0027id\u0027]].pop(agent_host, 0)"},{"line_number":67,"context_line":"            self.remove_fdb_entries.pop(port[\u0027id\u0027], 0)"},{"line_number":68,"context_line":""}],"source_content_type":"text/x-python","patch_set":43,"id":"baada198_435cd3f0","line":65,"updated":"2014-07-23 18:56:03.000000000","message":"remove_fdb_entries {} is not used in any other method other than delete_port_postcommit.  So we can use fdb_entries local variable here as well and do away with remove_fdb_entries{} altogether from the class.\r\n\r\nMay want to check if fdb_entries is non-empty before making RPC call to remove_fdb_entries, similar to fanout_msg check in base-code.","commit_id":"d2f3c9dae3816a561550358b1ceeb7af91a71910"},{"author":{"_account_id":9361,"name":"Vivekanandan Narasimhan","email":"n.vivekanandan@ericsson.com","username":"viveknarasimhan"},"change_message_id":"f70f8c52ff0078af5d4dc072da4d6b6724c665ed","unresolved":false,"context_lines":[{"line_number":62,"context_line":"            for agent_host in list(self.remove_fdb_entries[port[\u0027id\u0027]]):"},{"line_number":63,"context_line":"                self.L2populationAgentNotify.remove_fdb_entries("},{"line_number":64,"context_line":"                    self.rpc_ctx,"},{"line_number":65,"context_line":"                    self.remove_fdb_entries[port[\u0027id\u0027]][agent_host])"},{"line_number":66,"context_line":"                self.remove_fdb_entries[port[\u0027id\u0027]].pop(agent_host, 0)"},{"line_number":67,"context_line":"            self.remove_fdb_entries.pop(port[\u0027id\u0027], 0)"},{"line_number":68,"context_line":""}],"source_content_type":"text/x-python","patch_set":43,"id":"baada198_dd90a944","line":65,"in_reply_to":"baada198_31a7140d","updated":"2014-07-24 11:16:40.000000000","message":"Done","commit_id":"d2f3c9dae3816a561550358b1ceeb7af91a71910"},{"author":{"_account_id":9361,"name":"Vivekanandan Narasimhan","email":"n.vivekanandan@ericsson.com","username":"viveknarasimhan"},"change_message_id":"10c3e1a6e9d6733413f09ad75557c6e109fe90f2","unresolved":false,"context_lines":[{"line_number":62,"context_line":"            for agent_host in list(self.remove_fdb_entries[port[\u0027id\u0027]]):"},{"line_number":63,"context_line":"                self.L2populationAgentNotify.remove_fdb_entries("},{"line_number":64,"context_line":"                    self.rpc_ctx,"},{"line_number":65,"context_line":"                    self.remove_fdb_entries[port[\u0027id\u0027]][agent_host])"},{"line_number":66,"context_line":"                self.remove_fdb_entries[port[\u0027id\u0027]].pop(agent_host, 0)"},{"line_number":67,"context_line":"            self.remove_fdb_entries.pop(port[\u0027id\u0027], 0)"},{"line_number":68,"context_line":""}],"source_content_type":"text/x-python","patch_set":43,"id":"baada198_c828f099","line":65,"in_reply_to":"baada198_435cd3f0","updated":"2014-07-24 06:08:21.000000000","message":"We will need to use delete_port_precommit to gather the bindings and remove them in delete_port_postcommit.\r\nAs a result we cannot do away with remove_fdb_entries{} dict.\r\n\r\nThis is required because, we need to remove all dvr bindings and update l2pop entries for cloud nodes for a given port during delete_port() and delete_port() for even DVR Interfaces will be just a single call.","commit_id":"d2f3c9dae3816a561550358b1ceeb7af91a71910"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"00ae61d718f2b1da2aad9c38b888394a8bd8e80a","unresolved":false,"context_lines":[{"line_number":62,"context_line":"            for agent_host in list(self.remove_fdb_entries[port[\u0027id\u0027]]):"},{"line_number":63,"context_line":"                self.L2populationAgentNotify.remove_fdb_entries("},{"line_number":64,"context_line":"                    self.rpc_ctx,"},{"line_number":65,"context_line":"                    self.remove_fdb_entries[port[\u0027id\u0027]][agent_host])"},{"line_number":66,"context_line":"                self.remove_fdb_entries[port[\u0027id\u0027]].pop(agent_host, 0)"},{"line_number":67,"context_line":"            self.remove_fdb_entries.pop(port[\u0027id\u0027], 0)"},{"line_number":68,"context_line":""}],"source_content_type":"text/x-python","patch_set":43,"id":"baada198_31a7140d","line":65,"in_reply_to":"baada198_c828f099","updated":"2014-07-24 07:05:16.000000000","message":"This seems sensible, we don\u0027t want to let resources lie around upon deletion; this seems worth fixing :)","commit_id":"d2f3c9dae3816a561550358b1ceeb7af91a71910"},{"author":{"_account_id":9361,"name":"Vivekanandan Narasimhan","email":"n.vivekanandan@ericsson.com","username":"viveknarasimhan"},"change_message_id":"293403b4f3ea8c5af3b5b124eed63e0af58091df","unresolved":false,"context_lines":[{"line_number":87,"context_line":"        agent, agent_host, agent_ip, segment, port_fdb_entries \u003d port_infos"},{"line_number":88,"context_line":""},{"line_number":89,"context_line":"        orig_mac_ip \u003d [[port[\u0027mac_address\u0027], port[\u0027device_owner\u0027], ip]"},{"line_number":90,"context_line":"                       for ip in orig_ips]"},{"line_number":91,"context_line":"        port_mac_ip \u003d [[port[\u0027mac_address\u0027], port[\u0027device_owner\u0027], ip]"},{"line_number":92,"context_line":"                       for ip in port_ips]"},{"line_number":93,"context_line":""}],"source_content_type":"text/x-python","patch_set":43,"id":"baada198_4303f3bd","line":90,"updated":"2014-07-23 18:56:03.000000000","message":"may change the variable names to orig_mac_devowner_ip and port_mac_devowner_ip.","commit_id":"d2f3c9dae3816a561550358b1ceeb7af91a71910"},{"author":{"_account_id":9361,"name":"Vivekanandan Narasimhan","email":"n.vivekanandan@ericsson.com","username":"viveknarasimhan"},"change_message_id":"f70f8c52ff0078af5d4dc072da4d6b6724c665ed","unresolved":false,"context_lines":[{"line_number":87,"context_line":"        agent, agent_host, agent_ip, segment, port_fdb_entries \u003d port_infos"},{"line_number":88,"context_line":""},{"line_number":89,"context_line":"        orig_mac_ip \u003d [[port[\u0027mac_address\u0027], port[\u0027device_owner\u0027], ip]"},{"line_number":90,"context_line":"                       for ip in orig_ips]"},{"line_number":91,"context_line":"        port_mac_ip \u003d [[port[\u0027mac_address\u0027], port[\u0027device_owner\u0027], ip]"},{"line_number":92,"context_line":"                       for ip in port_ips]"},{"line_number":93,"context_line":""}],"source_content_type":"text/x-python","patch_set":43,"id":"baada198_bd8db52c","line":90,"in_reply_to":"baada198_317e346b","updated":"2014-07-24 11:16:40.000000000","message":"Done","commit_id":"d2f3c9dae3816a561550358b1ceeb7af91a71910"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"00ae61d718f2b1da2aad9c38b888394a8bd8e80a","unresolved":false,"context_lines":[{"line_number":87,"context_line":"        agent, agent_host, agent_ip, segment, port_fdb_entries \u003d port_infos"},{"line_number":88,"context_line":""},{"line_number":89,"context_line":"        orig_mac_ip \u003d [[port[\u0027mac_address\u0027], port[\u0027device_owner\u0027], ip]"},{"line_number":90,"context_line":"                       for ip in orig_ips]"},{"line_number":91,"context_line":"        port_mac_ip \u003d [[port[\u0027mac_address\u0027], port[\u0027device_owner\u0027], ip]"},{"line_number":92,"context_line":"                       for ip in port_ips]"},{"line_number":93,"context_line":""}],"source_content_type":"text/x-python","patch_set":43,"id":"baada198_317e346b","line":90,"in_reply_to":"baada198_4303f3bd","updated":"2014-07-24 07:05:16.000000000","message":"this sounds cosmetic, but I\u0027d be happy to see if a new revision to this patch if you got the time.","commit_id":"d2f3c9dae3816a561550358b1ceeb7af91a71910"},{"author":{"_account_id":9361,"name":"Vivekanandan Narasimhan","email":"n.vivekanandan@ericsson.com","username":"viveknarasimhan"},"change_message_id":"293403b4f3ea8c5af3b5b124eed63e0af58091df","unresolved":false,"context_lines":[{"line_number":281,"context_line":"                const.FLOODING_ENTRY)"},{"line_number":282,"context_line":"        # Notify other agents to remove fdb rules for current port"},{"line_number":283,"context_line":"        if port[\u0027device_owner\u0027] !\u003d const.DEVICE_OWNER_DVR_INTERFACE:"},{"line_number":284,"context_line":"            fdb_entries \u003d self._get_port_fdb_entries(port)"},{"line_number":285,"context_line":"            other_fdb_entries[network_id][\u0027ports\u0027][agent_ip] +\u003d fdb_entries"},{"line_number":286,"context_line":""},{"line_number":287,"context_line":"        return other_fdb_entries"}],"source_content_type":"text/x-python","patch_set":43,"id":"baada198_6319d786","line":284,"updated":"2014-07-23 18:56:03.000000000","message":"can use port_fdb_entries here since its already obtained at start of the the method via port_infos.","commit_id":"d2f3c9dae3816a561550358b1ceeb7af91a71910"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"00ae61d718f2b1da2aad9c38b888394a8bd8e80a","unresolved":false,"context_lines":[{"line_number":281,"context_line":"                const.FLOODING_ENTRY)"},{"line_number":282,"context_line":"        # Notify other agents to remove fdb rules for current port"},{"line_number":283,"context_line":"        if port[\u0027device_owner\u0027] !\u003d const.DEVICE_OWNER_DVR_INTERFACE:"},{"line_number":284,"context_line":"            fdb_entries \u003d self._get_port_fdb_entries(port)"},{"line_number":285,"context_line":"            other_fdb_entries[network_id][\u0027ports\u0027][agent_ip] +\u003d fdb_entries"},{"line_number":286,"context_line":""},{"line_number":287,"context_line":"        return other_fdb_entries"}],"source_content_type":"text/x-python","patch_set":43,"id":"baada198_b1e08427","line":284,"in_reply_to":"baada198_6319d786","updated":"2014-07-24 07:05:16.000000000","message":"If you don\u0027t need an updated version from line 265 to here, then this sounds like a genuine improvement that is worth addressing.","commit_id":"d2f3c9dae3816a561550358b1ceeb7af91a71910"},{"author":{"_account_id":9361,"name":"Vivekanandan Narasimhan","email":"n.vivekanandan@ericsson.com","username":"viveknarasimhan"},"change_message_id":"f70f8c52ff0078af5d4dc072da4d6b6724c665ed","unresolved":false,"context_lines":[{"line_number":281,"context_line":"                const.FLOODING_ENTRY)"},{"line_number":282,"context_line":"        # Notify other agents to remove fdb rules for current port"},{"line_number":283,"context_line":"        if port[\u0027device_owner\u0027] !\u003d const.DEVICE_OWNER_DVR_INTERFACE:"},{"line_number":284,"context_line":"            fdb_entries \u003d self._get_port_fdb_entries(port)"},{"line_number":285,"context_line":"            other_fdb_entries[network_id][\u0027ports\u0027][agent_ip] +\u003d fdb_entries"},{"line_number":286,"context_line":""},{"line_number":287,"context_line":"        return other_fdb_entries"}],"source_content_type":"text/x-python","patch_set":43,"id":"baada198_7de31da4","line":284,"in_reply_to":"baada198_b1e08427","updated":"2014-07-24 11:16:40.000000000","message":"Done","commit_id":"d2f3c9dae3816a561550358b1ceeb7af91a71910"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"542da09bee2daaad9a21a5b16184943250d729de","unresolved":false,"context_lines":[{"line_number":48,"context_line":"        return [[port[\u0027mac_address\u0027], port[\u0027device_owner\u0027],"},{"line_number":49,"context_line":"                 ip[\u0027ip_address\u0027]] for ip in port[\u0027fixed_ips\u0027]]"},{"line_number":50,"context_line":""},{"line_number":51,"context_line":"    def delete_port_postcommit(self, context):"},{"line_number":52,"context_line":"        port \u003d context.current"},{"line_number":53,"context_line":"        agent_host \u003d context.host"},{"line_number":54,"context_line":""}],"source_content_type":"text/x-python","patch_set":45,"id":"baada198_77dcf574","line":51,"updated":"2014-07-25 03:14:25.000000000","message":"oops bad rebase","commit_id":"adaa5aa1a9567c1cd66daa07734be03538ef5d8e"},{"author":{"_account_id":6854,"name":"YAMAMOTO Takashi","email":"yamamoto@midokura.com","username":"yamamoto"},"change_message_id":"11165d8f1865c4ab53fd13e64769089cba384b6d","unresolved":false,"context_lines":[{"line_number":42,"context_line":"        LOG.debug(_(\"Experimental L2 population driver\"))"},{"line_number":43,"context_line":"        self.rpc_ctx \u003d n_context.get_admin_context_without_session()"},{"line_number":44,"context_line":"        self.migrated_ports \u003d {}"},{"line_number":45,"context_line":"        self.remove_fdb_entries \u003d {}"},{"line_number":46,"context_line":""},{"line_number":47,"context_line":"    def _get_port_fdb_entries(self, port):"},{"line_number":48,"context_line":"        return [[port[\u0027mac_address\u0027], port[\u0027device_owner\u0027],"}],"source_content_type":"text/x-python","patch_set":46,"id":"baada198_2b221854","line":45,"updated":"2014-07-25 07:19:15.000000000","message":"who cleans this up in case of rollback?","commit_id":"21673f13e29abf3cee58a387d491e16a090d912c"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"f122c84ee37f45b364e6918612fe60a793b0efd8","unresolved":false,"context_lines":[{"line_number":42,"context_line":"        LOG.debug(_(\"Experimental L2 population driver\"))"},{"line_number":43,"context_line":"        self.rpc_ctx \u003d n_context.get_admin_context_without_session()"},{"line_number":44,"context_line":"        self.migrated_ports \u003d {}"},{"line_number":45,"context_line":"        self.remove_fdb_entries \u003d {}"},{"line_number":46,"context_line":""},{"line_number":47,"context_line":"    def _get_port_fdb_entries(self, port):"},{"line_number":48,"context_line":"        return [[port[\u0027mac_address\u0027], port[\u0027device_owner\u0027],"}],"source_content_type":"text/x-python","patch_set":46,"id":"baada198_1f1100af","line":45,"in_reply_to":"baada198_2b221854","updated":"2014-07-25 14:05:27.000000000","message":"what do you mean?","commit_id":"21673f13e29abf3cee58a387d491e16a090d912c"},{"author":{"_account_id":6854,"name":"YAMAMOTO Takashi","email":"yamamoto@midokura.com","username":"yamamoto"},"change_message_id":"11165d8f1865c4ab53fd13e64769089cba384b6d","unresolved":false,"context_lines":[{"line_number":53,"context_line":"        agent_host \u003d context.host"},{"line_number":54,"context_line":""},{"line_number":55,"context_line":"        if port[\u0027id\u0027] not in self.remove_fdb_entries:"},{"line_number":56,"context_line":"            self.remove_fdb_entries[port[\u0027id\u0027]] \u003d {}"},{"line_number":57,"context_line":""},{"line_number":58,"context_line":"        self.remove_fdb_entries[port[\u0027id\u0027]][agent_host] \u003d ("},{"line_number":59,"context_line":"            self._update_port_down(context, port, agent_host, 1))"}],"source_content_type":"text/x-python","patch_set":46,"id":"baada198_eb73c0b1","line":56,"updated":"2014-07-25 07:19:15.000000000","message":"self.remove_fdb_entries.setdefault(port[\u0027id\u0027], {})","commit_id":"21673f13e29abf3cee58a387d491e16a090d912c"},{"author":{"_account_id":261,"name":"Salvatore Orlando","email":"salv.orlando@gmail.com","username":"salvatore-orlando"},"change_message_id":"4101b2490881ad5c999f340ed4cc672fe6cedce4","unresolved":false,"context_lines":[{"line_number":53,"context_line":"        agent_host \u003d context.host"},{"line_number":54,"context_line":""},{"line_number":55,"context_line":"        if port[\u0027id\u0027] not in self.remove_fdb_entries:"},{"line_number":56,"context_line":"            self.remove_fdb_entries[port[\u0027id\u0027]] \u003d {}"},{"line_number":57,"context_line":""},{"line_number":58,"context_line":"        self.remove_fdb_entries[port[\u0027id\u0027]][agent_host] \u003d ("},{"line_number":59,"context_line":"            self._update_port_down(context, port, agent_host, 1))"}],"source_content_type":"text/x-python","patch_set":46,"id":"baada198_beae5d2d","line":56,"in_reply_to":"baada198_eb73c0b1","updated":"2014-07-25 12:19:51.000000000","message":"there are time like this when I found myself to be really ignorant.\nCan you explain me why one should use setdefault here?","commit_id":"21673f13e29abf3cee58a387d491e16a090d912c"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"f122c84ee37f45b364e6918612fe60a793b0efd8","unresolved":false,"context_lines":[{"line_number":53,"context_line":"        agent_host \u003d context.host"},{"line_number":54,"context_line":""},{"line_number":55,"context_line":"        if port[\u0027id\u0027] not in self.remove_fdb_entries:"},{"line_number":56,"context_line":"            self.remove_fdb_entries[port[\u0027id\u0027]] \u003d {}"},{"line_number":57,"context_line":""},{"line_number":58,"context_line":"        self.remove_fdb_entries[port[\u0027id\u0027]][agent_host] \u003d ("},{"line_number":59,"context_line":"            self._update_port_down(context, port, agent_host, 1))"}],"source_content_type":"text/x-python","patch_set":46,"id":"baada198_9f38b0d5","line":56,"in_reply_to":"baada198_eb73c0b1","updated":"2014-07-25 14:05:27.000000000","message":"this sounds cosmetic.","commit_id":"21673f13e29abf3cee58a387d491e16a090d912c"},{"author":{"_account_id":6854,"name":"YAMAMOTO Takashi","email":"yamamoto@midokura.com","username":"yamamoto"},"change_message_id":"11165d8f1865c4ab53fd13e64769089cba384b6d","unresolved":false,"context_lines":[{"line_number":179,"context_line":""},{"line_number":180,"context_line":"        fdb_entries \u003d self._get_port_fdb_entries(port)"},{"line_number":181,"context_line":""},{"line_number":182,"context_line":"        return agent, agent_host, agent_ip, segment, fdb_entries"},{"line_number":183,"context_line":""},{"line_number":184,"context_line":"    def _update_port_up(self, context):"},{"line_number":185,"context_line":"        port \u003d context.current"}],"source_content_type":"text/x-python","patch_set":46,"id":"baada198_4bb10cdf","line":182,"range":{"start_line":182,"start_character":22,"end_line":182,"end_character":32},"updated":"2014-07-25 07:19:15.000000000","message":"why to return agent_host, which is known by the caller?","commit_id":"21673f13e29abf3cee58a387d491e16a090d912c"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"f122c84ee37f45b364e6918612fe60a793b0efd8","unresolved":false,"context_lines":[{"line_number":179,"context_line":""},{"line_number":180,"context_line":"        fdb_entries \u003d self._get_port_fdb_entries(port)"},{"line_number":181,"context_line":""},{"line_number":182,"context_line":"        return agent, agent_host, agent_ip, segment, fdb_entries"},{"line_number":183,"context_line":""},{"line_number":184,"context_line":"    def _update_port_up(self, context):"},{"line_number":185,"context_line":"        port \u003d context.current"}],"source_content_type":"text/x-python","patch_set":46,"id":"baada198_ff6d2c68","line":182,"in_reply_to":"baada198_4bb10cdf","updated":"2014-07-25 14:05:27.000000000","message":"there is no particular reason if not for the fact that we are more detailed in the response object about agent attributes.\n\nThe better question in my opinion is why do we use a tuple this long to pass elements around? I\u0027d rather see this being wrapped up in a class, but that\u0027s beyond the scope of this patch.","commit_id":"21673f13e29abf3cee58a387d491e16a090d912c"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"2adbc14b46668c2583dfa619bd5b4c9770375752","unresolved":false,"context_lines":[{"line_number":45,"context_line":"        self.remove_fdb_entries \u003d {}"},{"line_number":46,"context_line":""},{"line_number":47,"context_line":"    def _get_port_fdb_entries(self, port):"},{"line_number":48,"context_line":"        return [[port[\u0027mac_address\u0027], port[\u0027device_owner\u0027],"},{"line_number":49,"context_line":"                 ip[\u0027ip_address\u0027]] for ip in port[\u0027fixed_ips\u0027]]"},{"line_number":50,"context_line":""},{"line_number":51,"context_line":"    def delete_port_precommit(self, context):"}],"source_content_type":"text/x-python","patch_set":48,"id":"baada198_b341210c","line":48,"updated":"2014-07-25 22:16:07.000000000","message":"This is an ad-hoc structure getting a little out of hand.  Seems it might be worth adding a more explicit structure of some sort.\n\nHow is a reviewer supposed to confirm that this has been done right?  It is difficult.\n\nThis is probably out of the scope of this patch but I just had to put in a comment.  It seems this could use a refactor.","commit_id":"91fa0d64637b08f410f311918c0bef446bf6bc36"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"65d0a788e00f30436e266206d46b69409352c33d","unresolved":false,"context_lines":[{"line_number":45,"context_line":"        self.remove_fdb_entries \u003d {}"},{"line_number":46,"context_line":""},{"line_number":47,"context_line":"    def _get_port_fdb_entries(self, port):"},{"line_number":48,"context_line":"        return [[port[\u0027mac_address\u0027], port[\u0027device_owner\u0027],"},{"line_number":49,"context_line":"                 ip[\u0027ip_address\u0027]] for ip in port[\u0027fixed_ips\u0027]]"},{"line_number":50,"context_line":""},{"line_number":51,"context_line":"    def delete_port_precommit(self, context):"}],"source_content_type":"text/x-python","patch_set":48,"id":"baada198_704f78be","line":48,"in_reply_to":"baada198_b341210c","updated":"2014-07-25 23:12:27.000000000","message":"Agreed, this whole driver would do with a make-over. Even the use of tuple is kind of awkward. I\u0027d like to revisit it sometime","commit_id":"91fa0d64637b08f410f311918c0bef446bf6bc36"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"2adbc14b46668c2583dfa619bd5b4c9770375752","unresolved":false,"context_lines":[{"line_number":55,"context_line":"        if port[\u0027id\u0027] not in self.remove_fdb_entries:"},{"line_number":56,"context_line":"            self.remove_fdb_entries[port[\u0027id\u0027]] \u003d {}"},{"line_number":57,"context_line":""},{"line_number":58,"context_line":"        self.remove_fdb_entries[port[\u0027id\u0027]][agent_host] \u003d ("},{"line_number":59,"context_line":"            self._update_port_down(context, port, agent_host, 1))"},{"line_number":60,"context_line":""},{"line_number":61,"context_line":"    def delete_port_postcommit(self, context):"}],"source_content_type":"text/x-python","patch_set":48,"id":"baada198_27886b6a","line":58,"updated":"2014-07-25 22:16:07.000000000","message":"I see what is going on here.  It looks like it will work.\n\nI\u0027m not sure I like storing these in a dict on the mech_driver instance like this.  Could these be gathered on the context?  I think the complexity of this code would improve a bit.  See plugin.py for more.","commit_id":"91fa0d64637b08f410f311918c0bef446bf6bc36"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"65d0a788e00f30436e266206d46b69409352c33d","unresolved":false,"context_lines":[{"line_number":55,"context_line":"        if port[\u0027id\u0027] not in self.remove_fdb_entries:"},{"line_number":56,"context_line":"            self.remove_fdb_entries[port[\u0027id\u0027]] \u003d {}"},{"line_number":57,"context_line":""},{"line_number":58,"context_line":"        self.remove_fdb_entries[port[\u0027id\u0027]][agent_host] \u003d ("},{"line_number":59,"context_line":"            self._update_port_down(context, port, agent_host, 1))"},{"line_number":60,"context_line":""},{"line_number":61,"context_line":"    def delete_port_postcommit(self, context):"}],"source_content_type":"text/x-python","patch_set":48,"id":"baada198_904a4cab","line":58,"in_reply_to":"baada198_27886b6a","updated":"2014-07-25 23:12:27.000000000","message":"agreed, see comment above","commit_id":"91fa0d64637b08f410f311918c0bef446bf6bc36"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"2adbc14b46668c2583dfa619bd5b4c9770375752","unresolved":false,"context_lines":[{"line_number":62,"context_line":"        port \u003d context.current"},{"line_number":63,"context_line":"        agent_host \u003d context.host"},{"line_number":64,"context_line":"        if port[\u0027id\u0027] in self.remove_fdb_entries:"},{"line_number":65,"context_line":"            for agent_host in list(self.remove_fdb_entries[port[\u0027id\u0027]]):"},{"line_number":66,"context_line":"                self.L2populationAgentNotify.remove_fdb_entries("},{"line_number":67,"context_line":"                    self.rpc_ctx,"},{"line_number":68,"context_line":"                    self.remove_fdb_entries[port[\u0027id\u0027]][agent_host])"}],"source_content_type":"text/x-python","patch_set":48,"id":"baada198_87213751","line":65,"updated":"2014-07-25 22:16:07.000000000","message":"nit:  If you didn\u0027t pop on L69, you wouldn\u0027t have to make a temporary list here.","commit_id":"91fa0d64637b08f410f311918c0bef446bf6bc36"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"2adbc14b46668c2583dfa619bd5b4c9770375752","unresolved":false,"context_lines":[{"line_number":66,"context_line":"                self.L2populationAgentNotify.remove_fdb_entries("},{"line_number":67,"context_line":"                    self.rpc_ctx,"},{"line_number":68,"context_line":"                    self.remove_fdb_entries[port[\u0027id\u0027]][agent_host])"},{"line_number":69,"context_line":"                self.remove_fdb_entries[port[\u0027id\u0027]].pop(agent_host, 0)"},{"line_number":70,"context_line":"            self.remove_fdb_entries.pop(port[\u0027id\u0027], 0)"},{"line_number":71,"context_line":""},{"line_number":72,"context_line":"    def _get_diff_ips(self, orig, port):"}],"source_content_type":"text/x-python","patch_set":48,"id":"baada198_07b44734","line":69,"updated":"2014-07-25 22:16:07.000000000","message":"nit: Why bother popping this?  It\u0027ll all be gone with L70 anyway.","commit_id":"91fa0d64637b08f410f311918c0bef446bf6bc36"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"2adbc14b46668c2583dfa619bd5b4c9770375752","unresolved":false,"context_lines":[{"line_number":67,"context_line":"                    self.rpc_ctx,"},{"line_number":68,"context_line":"                    self.remove_fdb_entries[port[\u0027id\u0027]][agent_host])"},{"line_number":69,"context_line":"                self.remove_fdb_entries[port[\u0027id\u0027]].pop(agent_host, 0)"},{"line_number":70,"context_line":"            self.remove_fdb_entries.pop(port[\u0027id\u0027], 0)"},{"line_number":71,"context_line":""},{"line_number":72,"context_line":"    def _get_diff_ips(self, orig, port):"},{"line_number":73,"context_line":"        orig_ips \u003d set([ip[\u0027ip_address\u0027] for ip in orig[\u0027fixed_ips\u0027]])"}],"source_content_type":"text/x-python","patch_set":48,"id":"baada198_679fc3b4","line":70,"updated":"2014-07-25 22:16:07.000000000","message":"nit: del self.remove_fdb_entries[port[\u0027id\u0027]]","commit_id":"91fa0d64637b08f410f311918c0bef446bf6bc36"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"65d0a788e00f30436e266206d46b69409352c33d","unresolved":false,"context_lines":[{"line_number":67,"context_line":"                    self.rpc_ctx,"},{"line_number":68,"context_line":"                    self.remove_fdb_entries[port[\u0027id\u0027]][agent_host])"},{"line_number":69,"context_line":"                self.remove_fdb_entries[port[\u0027id\u0027]].pop(agent_host, 0)"},{"line_number":70,"context_line":"            self.remove_fdb_entries.pop(port[\u0027id\u0027], 0)"},{"line_number":71,"context_line":""},{"line_number":72,"context_line":"    def _get_diff_ips(self, orig, port):"},{"line_number":73,"context_line":"        orig_ips \u003d set([ip[\u0027ip_address\u0027] for ip in orig[\u0027fixed_ips\u0027]])"}],"source_content_type":"text/x-python","patch_set":48,"id":"baada198_9347b64b","line":70,"in_reply_to":"baada198_679fc3b4","updated":"2014-07-25 23:12:27.000000000","message":"this can also be improved slightly, but I\u0027d rather do that as follow-up","commit_id":"91fa0d64637b08f410f311918c0bef446bf6bc36"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"2adbc14b46668c2583dfa619bd5b4c9770375752","unresolved":false,"context_lines":[{"line_number":179,"context_line":""},{"line_number":180,"context_line":"        fdb_entries \u003d self._get_port_fdb_entries(port)"},{"line_number":181,"context_line":""},{"line_number":182,"context_line":"        return agent, agent_host, agent_ip, segment, fdb_entries"},{"line_number":183,"context_line":""},{"line_number":184,"context_line":"    def _update_port_up(self, context):"},{"line_number":185,"context_line":"        port \u003d context.current"}],"source_content_type":"text/x-python","patch_set":48,"id":"baada198_f3463920","line":182,"updated":"2014-07-25 22:16:07.000000000","message":"Another place where things seem to be getting a bit out of control.  This method returns 5 values.  How am I supposed to keep all this straight?\n\nThis comment is probably out of the scope of this patch.  The base code is what it is.","commit_id":"91fa0d64637b08f410f311918c0bef446bf6bc36"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"65d0a788e00f30436e266206d46b69409352c33d","unresolved":false,"context_lines":[{"line_number":179,"context_line":""},{"line_number":180,"context_line":"        fdb_entries \u003d self._get_port_fdb_entries(port)"},{"line_number":181,"context_line":""},{"line_number":182,"context_line":"        return agent, agent_host, agent_ip, segment, fdb_entries"},{"line_number":183,"context_line":""},{"line_number":184,"context_line":"    def _update_port_up(self, context):"},{"line_number":185,"context_line":"        port \u003d context.current"}],"source_content_type":"text/x-python","patch_set":48,"id":"baada198_70abf81d","line":182,"in_reply_to":"baada198_f3463920","updated":"2014-07-25 23:12:27.000000000","message":"yes, we should\u0027ve never returned 4 params in the first place. I suggested in a prior review that this should have been encapsulated :(","commit_id":"91fa0d64637b08f410f311918c0bef446bf6bc36"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"2adbc14b46668c2583dfa619bd5b4c9770375752","unresolved":false,"context_lines":[{"line_number":241,"context_line":"                              {\u0027agent_host\u0027: agent.host})"},{"line_number":242,"context_line":"                    continue"},{"line_number":243,"context_line":""},{"line_number":244,"context_line":"                agent_ports \u003d ports.get(ip, [const.FLOODING_ENTRY])"},{"line_number":245,"context_line":"                ports[ip] \u003d agent_ports"},{"line_number":246,"context_line":""},{"line_number":247,"context_line":"            # And notify other agents to add flooding entry"}],"source_content_type":"text/x-python","patch_set":48,"id":"baada198_4c2586ac","line":244,"updated":"2014-07-25 22:16:07.000000000","message":"nit:  Why bother with a temporary?  Why not assign directly?","commit_id":"91fa0d64637b08f410f311918c0bef446bf6bc36"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"65d0a788e00f30436e266206d46b69409352c33d","unresolved":false,"context_lines":[{"line_number":241,"context_line":"                              {\u0027agent_host\u0027: agent.host})"},{"line_number":242,"context_line":"                    continue"},{"line_number":243,"context_line":""},{"line_number":244,"context_line":"                agent_ports \u003d ports.get(ip, [const.FLOODING_ENTRY])"},{"line_number":245,"context_line":"                ports[ip] \u003d agent_ports"},{"line_number":246,"context_line":""},{"line_number":247,"context_line":"            # And notify other agents to add flooding entry"}],"source_content_type":"text/x-python","patch_set":48,"id":"baada198_505ef445","line":244,"in_reply_to":"baada198_4c2586ac","updated":"2014-07-25 23:12:27.000000000","message":"the only reason I could think of is documentation purposes, but a comment would\u0027ve done the same","commit_id":"91fa0d64637b08f410f311918c0bef446bf6bc36"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"2adbc14b46668c2583dfa619bd5b4c9770375752","unresolved":false,"context_lines":[{"line_number":284,"context_line":"                const.FLOODING_ENTRY)"},{"line_number":285,"context_line":"        # Notify other agents to remove fdb rules for current port"},{"line_number":286,"context_line":"        if port[\u0027device_owner\u0027] !\u003d const.DEVICE_OWNER_DVR_INTERFACE:"},{"line_number":287,"context_line":"            fdb_entries \u003d port_fdb_entries"},{"line_number":288,"context_line":"            other_fdb_entries[network_id][\u0027ports\u0027][agent_ip] +\u003d fdb_entries"},{"line_number":289,"context_line":""},{"line_number":290,"context_line":"        return other_fdb_entries"}],"source_content_type":"text/x-python","patch_set":48,"id":"baada198_cca19696","line":287,"updated":"2014-07-25 22:16:07.000000000","message":"nit:  I don\u0027t think I\u0027d mind if you just renamed port_fdb_entries to fdb_entries above.","commit_id":"91fa0d64637b08f410f311918c0bef446bf6bc36"},{"author":{"_account_id":841,"name":"Akihiro Motoki","email":"amotoki@gmail.com","username":"amotoki"},"change_message_id":"bfa43a95c8d2184fa8302b02380711b93e7b9c76","unresolved":false,"context_lines":[{"line_number":62,"context_line":"        port \u003d context.current"},{"line_number":63,"context_line":"        agent_host \u003d context.host"},{"line_number":64,"context_line":"        if port[\u0027id\u0027] in self.remove_fdb_entries:"},{"line_number":65,"context_line":"            for agent_host in list(self.remove_fdb_entries[port[\u0027id\u0027]]):"},{"line_number":66,"context_line":"                self.L2populationAgentNotify.remove_fdb_entries("},{"line_number":67,"context_line":"                    self.rpc_ctx,"},{"line_number":68,"context_line":"                    self.remove_fdb_entries[port[\u0027id\u0027]][agent_host])"}],"source_content_type":"text/x-python","patch_set":49,"id":"baada198_1189ccc9","line":65,"updated":"2014-07-28 05:49:55.000000000","message":"I think list() is not needed. self.remove_fdb_entries[port[\u0027id\u0027]] is a dict and it returns a list of keys.","commit_id":"cd35b1904e1da5e3da0a63b37af34d426e72e933"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"823822388f67e1cdafb463ff1ed494d679b7024b","unresolved":false,"context_lines":[{"line_number":62,"context_line":"        port \u003d context.current"},{"line_number":63,"context_line":"        agent_host \u003d context.host"},{"line_number":64,"context_line":"        if port[\u0027id\u0027] in self.remove_fdb_entries:"},{"line_number":65,"context_line":"            for agent_host in list(self.remove_fdb_entries[port[\u0027id\u0027]]):"},{"line_number":66,"context_line":"                self.L2populationAgentNotify.remove_fdb_entries("},{"line_number":67,"context_line":"                    self.rpc_ctx,"},{"line_number":68,"context_line":"                    self.remove_fdb_entries[port[\u0027id\u0027]][agent_host])"}],"source_content_type":"text/x-python","patch_set":49,"id":"baada198_b81f0a59","line":65,"in_reply_to":"baada198_1189ccc9","updated":"2014-07-28 17:33:53.000000000","message":"I am confused by your comment. The:\n\nlist(self.remove_fdb_entries[port[\u0027id\u0027]]) \n\ndoes return a list of keys for the dictionary \nself.remove_fdb_entries[port[\u0027id\u0027]]\n\nThis could be improved by doing:\n\nself.remove_fdb_entries[port[\u0027id\u0027]].keys()\n\nor by using the dict directly and tweaking the for body.\n\nThat said, I agree this block could do with some improvement, but the logic does seem sound.","commit_id":"cd35b1904e1da5e3da0a63b37af34d426e72e933"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"b47e106cdff6f8239d88397fb40d43c19340f740","unresolved":false,"context_lines":[{"line_number":62,"context_line":"        port \u003d context.current"},{"line_number":63,"context_line":"        agent_host \u003d context.host"},{"line_number":64,"context_line":"        if port[\u0027id\u0027] in self.remove_fdb_entries:"},{"line_number":65,"context_line":"            for agent_host in list(self.remove_fdb_entries[port[\u0027id\u0027]]):"},{"line_number":66,"context_line":"                self.L2populationAgentNotify.remove_fdb_entries("},{"line_number":67,"context_line":"                    self.rpc_ctx,"},{"line_number":68,"context_line":"                    self.remove_fdb_entries[port[\u0027id\u0027]][agent_host])"}],"source_content_type":"text/x-python","patch_set":49,"id":"baada198_7e055b0e","line":65,"in_reply_to":"baada198_b81f0a59","updated":"2014-07-28 18:01:03.000000000","message":"I made a similar comment on a previous patch.  However, I am willing to +2 because the logic is sound.  We\u0027re kind of splitting hairs here.","commit_id":"cd35b1904e1da5e3da0a63b37af34d426e72e933"},{"author":{"_account_id":11279,"name":"Angus Lees","email":"gus@inodes.org","username":"gus"},"change_message_id":"cced150c025b927114544f50a3a9efa6d2d519b6","unresolved":false,"context_lines":[{"line_number":62,"context_line":"        port \u003d context.current"},{"line_number":63,"context_line":"        agent_host \u003d context.host"},{"line_number":64,"context_line":"        if port[\u0027id\u0027] in self.remove_fdb_entries:"},{"line_number":65,"context_line":"            for agent_host in list(self.remove_fdb_entries[port[\u0027id\u0027]]):"},{"line_number":66,"context_line":"                self.L2populationAgentNotify.remove_fdb_entries("},{"line_number":67,"context_line":"                    self.rpc_ctx,"},{"line_number":68,"context_line":"                    self.remove_fdb_entries[port[\u0027id\u0027]][agent_host])"}],"source_content_type":"text/x-python","patch_set":49,"id":"baada198_c5f3efe4","line":65,"in_reply_to":"baada198_b81f0a59","updated":"2014-07-28 21:48:57.000000000","message":"amotoki means the reason list(foo) works is that \u0027foo\u0027 is an iterable.  You can run the for loop across the iterable directly, without having to build a list object from it first, so seeing \"for i in list(something)\" looks weird.\n\nIn other words, this will work just fine, and avoid the intermediate  object:\n\n for agent_host in self.remove_fdb_entries[port[\u0027id\u0027]]:\n   ...\n\nI see however, that you\u0027re modifying this dict from inside the loop below.  Creating a separate copy of the keys (as you have with list()) makes this more obviously safe.  I\u0027d suggest keeping the list() fwiw.","commit_id":"cd35b1904e1da5e3da0a63b37af34d426e72e933"},{"author":{"_account_id":841,"name":"Akihiro Motoki","email":"amotoki@gmail.com","username":"amotoki"},"change_message_id":"807fdab3882041f670a945d9657bdcabc7784a50","unresolved":false,"context_lines":[{"line_number":62,"context_line":"        port \u003d context.current"},{"line_number":63,"context_line":"        agent_host \u003d context.host"},{"line_number":64,"context_line":"        if port[\u0027id\u0027] in self.remove_fdb_entries:"},{"line_number":65,"context_line":"            for agent_host in list(self.remove_fdb_entries[port[\u0027id\u0027]]):"},{"line_number":66,"context_line":"                self.L2populationAgentNotify.remove_fdb_entries("},{"line_number":67,"context_line":"                    self.rpc_ctx,"},{"line_number":68,"context_line":"                    self.remove_fdb_entries[port[\u0027id\u0027]][agent_host])"}],"source_content_type":"text/x-python","patch_set":49,"id":"baada198_3b2da346","line":65,"in_reply_to":"baada198_c5f3efe4","updated":"2014-07-29 03:53:13.000000000","message":"What I would like to say is what Angus described. \"for agent_host in list(dict)\" creates a copy of dict keys. Instead, if we use \"for agent_host in dict\", \"dict\" would be a generator and each element will accessed if needed.\n\nRegarding the second point, I am not sure it is better to use list() when a dict entry is modified in the loop.","commit_id":"cd35b1904e1da5e3da0a63b37af34d426e72e933"}],"neutron/plugins/ml2/plugin.py":[{"author":{"_account_id":1923,"name":"Mohammad Banikazemi","email":"mbanikazemi@gmail.com","username":"mb-s"},"change_message_id":"f9cd9598323766692d5715ee9742597c8245e139","unresolved":false,"context_lines":[{"line_number":278,"context_line":"        return ret_value"},{"line_number":279,"context_line":""},{"line_number":280,"context_line":"    def _process_dvr_port_binding(self, mech_context, context, attrs):"},{"line_number":281,"context_line":"        binding \u003d mech_context._binding"},{"line_number":282,"context_line":"        #port \u003d mech_context.current"},{"line_number":283,"context_line":""},{"line_number":284,"context_line":"        host \u003d attrs and attrs.get(portbindings.HOST_ID)"}],"source_content_type":"text/x-python","patch_set":8,"id":"dab895d6_5bcc0e36","line":281,"updated":"2014-06-30 01:27:14.000000000","message":"Shouldn\u0027t the added binding() method be used here?","commit_id":"43946520c8d49963e3efed90caf4cca4a7eeac0c"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"c9536517cbe8d1733f0ee08d28f4b3df6ea84b30","unresolved":false,"context_lines":[{"line_number":278,"context_line":"        return ret_value"},{"line_number":279,"context_line":""},{"line_number":280,"context_line":"    def _process_dvr_port_binding(self, mech_context, context, attrs):"},{"line_number":281,"context_line":"        binding \u003d mech_context._binding"},{"line_number":282,"context_line":"        #port \u003d mech_context.current"},{"line_number":283,"context_line":""},{"line_number":284,"context_line":"        host \u003d attrs and attrs.get(portbindings.HOST_ID)"}],"source_content_type":"text/x-python","patch_set":8,"id":"baada198_105b4a55","line":281,"in_reply_to":"dab895d6_5bcc0e36","updated":"2014-06-30 23:30:29.000000000","message":"Done","commit_id":"43946520c8d49963e3efed90caf4cca4a7eeac0c"},{"author":{"_account_id":6854,"name":"YAMAMOTO Takashi","email":"yamamoto@midokura.com","username":"yamamoto"},"change_message_id":"af50a03c175ae6da790c822c212921f388a1454d","unresolved":false,"context_lines":[{"line_number":342,"context_line":"        if (not dvr_binding.router_id and"},{"line_number":343,"context_line":"                dvr_binding.status \u003d\u003d const.PORT_STATUS_DOWN):"},{"line_number":344,"context_line":"            with context.session.begin(subtransactions\u003dTrue):"},{"line_number":345,"context_line":"                LOG.debug(_(\"DVR: Deleting dvr binding for port %s\"),"},{"line_number":346,"context_line":"                          dvr_binding.port_id)"},{"line_number":347,"context_line":"                context.session.delete(dvr_binding)"},{"line_number":348,"context_line":""}],"source_content_type":"text/x-python","patch_set":8,"id":"dab895d6_b12b8b2f","line":345,"updated":"2014-06-30 03:52:47.000000000","message":"no localization please","commit_id":"43946520c8d49963e3efed90caf4cca4a7eeac0c"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"c9536517cbe8d1733f0ee08d28f4b3df6ea84b30","unresolved":false,"context_lines":[{"line_number":342,"context_line":"        if (not dvr_binding.router_id and"},{"line_number":343,"context_line":"                dvr_binding.status \u003d\u003d const.PORT_STATUS_DOWN):"},{"line_number":344,"context_line":"            with context.session.begin(subtransactions\u003dTrue):"},{"line_number":345,"context_line":"                LOG.debug(_(\"DVR: Deleting dvr binding for port %s\"),"},{"line_number":346,"context_line":"                          dvr_binding.port_id)"},{"line_number":347,"context_line":"                context.session.delete(dvr_binding)"},{"line_number":348,"context_line":""}],"source_content_type":"text/x-python","patch_set":8,"id":"baada198_2a76213f","line":345,"in_reply_to":"dab895d6_b12b8b2f","updated":"2014-06-30 23:30:29.000000000","message":"Done","commit_id":"43946520c8d49963e3efed90caf4cca4a7eeac0c"},{"author":{"_account_id":6854,"name":"YAMAMOTO Takashi","email":"yamamoto@midokura.com","username":"yamamoto"},"change_message_id":"af50a03c175ae6da790c822c212921f388a1454d","unresolved":false,"context_lines":[{"line_number":817,"context_line":"                                                              port, network,"},{"line_number":818,"context_line":"                                                              binding\u003dbind)"},{"line_number":819,"context_line":"                    self.mechanism_manager.delete_port_precommit(mech_context)"},{"line_number":820,"context_line":"                LOG.debug(_(\"Calling base delete_port %s for DVR\"), id)"},{"line_number":821,"context_line":"                super(Ml2Plugin, self).delete_port(context, id)"},{"line_number":822,"context_line":"            else:"},{"line_number":823,"context_line":"                mech_context \u003d driver_context.PortContext(self, context, port,"}],"source_content_type":"text/x-python","patch_set":8,"id":"dab895d6_f11c2316","line":820,"updated":"2014-06-30 03:52:47.000000000","message":"should not localize","commit_id":"43946520c8d49963e3efed90caf4cca4a7eeac0c"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"c9536517cbe8d1733f0ee08d28f4b3df6ea84b30","unresolved":false,"context_lines":[{"line_number":817,"context_line":"                                                              port, network,"},{"line_number":818,"context_line":"                                                              binding\u003dbind)"},{"line_number":819,"context_line":"                    self.mechanism_manager.delete_port_precommit(mech_context)"},{"line_number":820,"context_line":"                LOG.debug(_(\"Calling base delete_port %s for DVR\"), id)"},{"line_number":821,"context_line":"                super(Ml2Plugin, self).delete_port(context, id)"},{"line_number":822,"context_line":"            else:"},{"line_number":823,"context_line":"                mech_context \u003d driver_context.PortContext(self, context, port,"}],"source_content_type":"text/x-python","patch_set":8,"id":"baada198_4a73554d","line":820,"in_reply_to":"dab895d6_f11c2316","updated":"2014-06-30 23:30:29.000000000","message":"Done","commit_id":"43946520c8d49963e3efed90caf4cca4a7eeac0c"},{"author":{"_account_id":6854,"name":"YAMAMOTO Takashi","email":"yamamoto@midokura.com","username":"yamamoto"},"change_message_id":"af50a03c175ae6da790c822c212921f388a1454d","unresolved":false,"context_lines":[{"line_number":881,"context_line":"                              port_id)"},{"line_number":882,"context_line":"                    return False"},{"line_number":883,"context_line":"                binding[\u0027status\u0027] \u003d status"},{"line_number":884,"context_line":"                binding.update(binding)"},{"line_number":885,"context_line":""},{"line_number":886,"context_line":"        # binding already updated"},{"line_number":887,"context_line":"        with contextlib.nested(lockutils.lock(\u0027db-access\u0027),"}],"source_content_type":"text/x-python","patch_set":8,"id":"dab895d6_b1ec6bc9","line":884,"updated":"2014-06-30 03:52:47.000000000","message":"is it ok not to rollback this on precommit failure?\n\nwhy don\u0027t you do this and the following in a single transaction?","commit_id":"43946520c8d49963e3efed90caf4cca4a7eeac0c"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"c9536517cbe8d1733f0ee08d28f4b3df6ea84b30","unresolved":false,"context_lines":[{"line_number":881,"context_line":"                              port_id)"},{"line_number":882,"context_line":"                    return False"},{"line_number":883,"context_line":"                binding[\u0027status\u0027] \u003d status"},{"line_number":884,"context_line":"                binding.update(binding)"},{"line_number":885,"context_line":""},{"line_number":886,"context_line":"        # binding already updated"},{"line_number":887,"context_line":"        with contextlib.nested(lockutils.lock(\u0027db-access\u0027),"}],"source_content_type":"text/x-python","patch_set":8,"id":"baada198_7031e60a","line":884,"in_reply_to":"dab895d6_b1ec6bc9","updated":"2014-06-30 23:30:29.000000000","message":"perhaps...I\u0027ll revise","commit_id":"43946520c8d49963e3efed90caf4cca4a7eeac0c"},{"author":{"_account_id":6854,"name":"YAMAMOTO Takashi","email":"yamamoto@midokura.com","username":"yamamoto"},"change_message_id":"af50a03c175ae6da790c822c212921f388a1454d","unresolved":false,"context_lines":[{"line_number":899,"context_line":"                port.status \u003d self._generate_dvr_port_status(session,"},{"line_number":900,"context_line":"                                                             port[\u0027id\u0027])"},{"line_number":901,"context_line":"                updated_port \u003d self._make_port_dict(port)"},{"line_number":902,"context_line":"                mech_context \u003d driver_context.\\"},{"line_number":903,"context_line":"                    PortContext(self, context, updated_port, network,"},{"line_number":904,"context_line":"                                original_port\u003doriginal_port,"},{"line_number":905,"context_line":"                                binding\u003dbinding)"}],"source_content_type":"text/x-python","patch_set":8,"id":"dab895d6_71949337","line":902,"updated":"2014-06-30 03:52:47.000000000","message":"don\u0027t use backslash this way.","commit_id":"43946520c8d49963e3efed90caf4cca4a7eeac0c"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"c9536517cbe8d1733f0ee08d28f4b3df6ea84b30","unresolved":false,"context_lines":[{"line_number":899,"context_line":"                port.status \u003d self._generate_dvr_port_status(session,"},{"line_number":900,"context_line":"                                                             port[\u0027id\u0027])"},{"line_number":901,"context_line":"                updated_port \u003d self._make_port_dict(port)"},{"line_number":902,"context_line":"                mech_context \u003d driver_context.\\"},{"line_number":903,"context_line":"                    PortContext(self, context, updated_port, network,"},{"line_number":904,"context_line":"                                original_port\u003doriginal_port,"},{"line_number":905,"context_line":"                                binding\u003dbinding)"}],"source_content_type":"text/x-python","patch_set":8,"id":"baada198_4aaa7571","line":902,"in_reply_to":"dab895d6_71949337","updated":"2014-06-30 23:30:29.000000000","message":"Done","commit_id":"43946520c8d49963e3efed90caf4cca4a7eeac0c"},{"author":{"_account_id":6876,"name":"stephen-ma","email":"stephenbma43@gmail.com","username":"stephen-ma"},"change_message_id":"429044c7c1a364c9856cccf6fe6e43f82cf4eff9","unresolved":false,"context_lines":[{"line_number":278,"context_line":"        return ret_value"},{"line_number":279,"context_line":""},{"line_number":280,"context_line":"    def _process_dvr_port_binding(self, mech_context, context, attrs):"},{"line_number":281,"context_line":"        binding \u003d mech_context.binding()"},{"line_number":282,"context_line":""},{"line_number":283,"context_line":"        host \u003d attrs and attrs.get(portbindings.HOST_ID)"},{"line_number":284,"context_line":"        host_set \u003d attributes.is_attr_set(host)"}],"source_content_type":"text/x-python","patch_set":12,"id":"baada198_9af677d6","line":281,"updated":"2014-07-01 17:17:57.000000000","message":"should be mech_context.binding. binding is a property.","commit_id":"1b0e3a61a6cbe50a95686cc313f15f5ac8871a53"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"f433a30a23aeaf0fafdd2cce57f2b770c6d38031","unresolved":false,"context_lines":[{"line_number":278,"context_line":"        return ret_value"},{"line_number":279,"context_line":""},{"line_number":280,"context_line":"    def _process_dvr_port_binding(self, mech_context, context, attrs):"},{"line_number":281,"context_line":"        binding \u003d mech_context.binding()"},{"line_number":282,"context_line":""},{"line_number":283,"context_line":"        host \u003d attrs and attrs.get(portbindings.HOST_ID)"},{"line_number":284,"context_line":"        host_set \u003d attributes.is_attr_set(host)"}],"source_content_type":"text/x-python","patch_set":12,"id":"baada198_372c9947","line":281,"in_reply_to":"baada198_9af677d6","updated":"2014-07-01 21:56:32.000000000","message":"good catch!","commit_id":"1b0e3a61a6cbe50a95686cc313f15f5ac8871a53"},{"author":{"_account_id":6876,"name":"stephen-ma","email":"stephenbma43@gmail.com","username":"stephen-ma"},"change_message_id":"429044c7c1a364c9856cccf6fe6e43f82cf4eff9","unresolved":false,"context_lines":[{"line_number":337,"context_line":"        self._update_port_dict_binding(port, binding)"},{"line_number":338,"context_line":""},{"line_number":339,"context_line":"    def _check_and_delete_dvr_port_binding(self, mech_context, context):"},{"line_number":340,"context_line":"        dvr_binding \u003d mech_context.binding()"},{"line_number":341,"context_line":"        if (not dvr_binding.router_id and"},{"line_number":342,"context_line":"                dvr_binding.status \u003d\u003d const.PORT_STATUS_DOWN):"},{"line_number":343,"context_line":"            with context.session.begin(subtransactions\u003dTrue):"}],"source_content_type":"text/x-python","patch_set":12,"id":"baada198_da69cf8c","line":340,"updated":"2014-07-01 17:17:57.000000000","message":"same as line 281.","commit_id":"1b0e3a61a6cbe50a95686cc313f15f5ac8871a53"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"f433a30a23aeaf0fafdd2cce57f2b770c6d38031","unresolved":false,"context_lines":[{"line_number":337,"context_line":"        self._update_port_dict_binding(port, binding)"},{"line_number":338,"context_line":""},{"line_number":339,"context_line":"    def _check_and_delete_dvr_port_binding(self, mech_context, context):"},{"line_number":340,"context_line":"        dvr_binding \u003d mech_context.binding()"},{"line_number":341,"context_line":"        if (not dvr_binding.router_id and"},{"line_number":342,"context_line":"                dvr_binding.status \u003d\u003d const.PORT_STATUS_DOWN):"},{"line_number":343,"context_line":"            with context.session.begin(subtransactions\u003dTrue):"}],"source_content_type":"text/x-python","patch_set":12,"id":"baada198_b717c9ec","line":340,"in_reply_to":"baada198_da69cf8c","updated":"2014-07-01 21:56:32.000000000","message":"Done","commit_id":"1b0e3a61a6cbe50a95686cc313f15f5ac8871a53"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"388c5dd1214c5afabfa352bed35f21c35114cc5f","unresolved":false,"context_lines":[{"line_number":767,"context_line":""},{"line_number":768,"context_line":"        binding \u003d db.get_dvr_port_binding_by_host(port_id\u003did, host\u003dhost,"},{"line_number":769,"context_line":"                                                  session\u003dNone)"},{"line_number":770,"context_line":"        if ((not binding) or"},{"line_number":771,"context_line":"                (binding.vif_type \u003d\u003d portbindings.VIF_TYPE_BINDING_FAILED)):"},{"line_number":772,"context_line":"            session \u003d context.session"},{"line_number":773,"context_line":"            with session.begin(subtransactions\u003dTrue):"}],"source_content_type":"text/x-python","patch_set":14,"id":"baada198_2e8895e6","line":770,"updated":"2014-07-03 00:03:41.000000000","message":"() not needed","commit_id":"7fb7ae203e1d75e7552e6967ecd97c90e347dfe4"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"388c5dd1214c5afabfa352bed35f21c35114cc5f","unresolved":false,"context_lines":[{"line_number":771,"context_line":"                (binding.vif_type \u003d\u003d portbindings.VIF_TYPE_BINDING_FAILED)):"},{"line_number":772,"context_line":"            session \u003d context.session"},{"line_number":773,"context_line":"            with session.begin(subtransactions\u003dTrue):"},{"line_number":774,"context_line":"                if (not binding):"},{"line_number":775,"context_line":"                    binding \u003d db.ensure_dvr_port_binding(session, id,"},{"line_number":776,"context_line":"                                                         host,"},{"line_number":777,"context_line":"                                                         attrs[\u0027device_id\u0027])"}],"source_content_type":"text/x-python","patch_set":14,"id":"baada198_4e6ea930","line":774,"updated":"2014-07-03 00:03:41.000000000","message":"here too","commit_id":"7fb7ae203e1d75e7552e6967ecd97c90e347dfe4"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"6a8a5cebefcb41e6283855b438395d87485570a4","unresolved":false,"context_lines":[{"line_number":930,"context_line":"            if port[\u0027device_owner\u0027] \u003d\u003d const.DEVICE_OWNER_DVR_INTERFACE:"},{"line_number":931,"context_line":"                bindings \u003d db.get_dvr_port_bindings(port_id)"},{"line_number":932,"context_line":"                for b in bindings:"},{"line_number":933,"context_line":"                    if (b.host \u003d\u003d host):"},{"line_number":934,"context_line":"                        #LOG.debug(_(\"Binding with host %s exists for port %s\")"},{"line_number":935,"context_line":"                        #          % (host, port_id))"},{"line_number":936,"context_line":"                        return True"}],"source_content_type":"text/x-python","patch_set":14,"id":"baada198_8e828192","line":933,"updated":"2014-07-03 00:18:08.000000000","message":"remove ()","commit_id":"7fb7ae203e1d75e7552e6967ecd97c90e347dfe4"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"6a8a5cebefcb41e6283855b438395d87485570a4","unresolved":false,"context_lines":[{"line_number":932,"context_line":"                for b in bindings:"},{"line_number":933,"context_line":"                    if (b.host \u003d\u003d host):"},{"line_number":934,"context_line":"                        #LOG.debug(_(\"Binding with host %s exists for port %s\")"},{"line_number":935,"context_line":"                        #          % (host, port_id))"},{"line_number":936,"context_line":"                        return True"},{"line_number":937,"context_line":"                LOG.debug(_(\"No Binding exists for port %s\"), port_id)"},{"line_number":938,"context_line":"                return False"}],"source_content_type":"text/x-python","patch_set":14,"id":"baada198_ae7d85b3","line":935,"updated":"2014-07-03 00:18:08.000000000","message":"remove this","commit_id":"7fb7ae203e1d75e7552e6967ecd97c90e347dfe4"},{"author":{"_account_id":7183,"name":"Xu Han Peng","email":"xuhanp@linux.vnet.ibm.com","username":"xuhanp"},"change_message_id":"a13b31965b652195746ee67e9e56e5bd898f82fa","unresolved":false,"context_lines":[{"line_number":288,"context_line":"                    self.mechanism_manager."},{"line_number":289,"context_line":"                    validate_port_binding(mech_context)):"},{"line_number":290,"context_line":"                return False"},{"line_number":291,"context_line":"            self.mechanism_manager.unbind_port(mech_context)"},{"line_number":292,"context_line":""},{"line_number":293,"context_line":"        if host_set:"},{"line_number":294,"context_line":"            binding.host \u003d host"}],"source_content_type":"text/x-python","patch_set":15,"id":"baada198_58ad20e8","line":291,"updated":"2014-07-07 14:21:50.000000000","message":"Seems like the mechanism_manager in my test env doesn\u0027t have the unbind_port function. Am I missing a patch again?","commit_id":"8b05e6018964f0590645beb8545d17092cf6f059"},{"author":{"_account_id":9361,"name":"Vivekanandan Narasimhan","email":"n.vivekanandan@ericsson.com","username":"viveknarasimhan"},"change_message_id":"65dc5ab149178967dfef430fe5f2e5f55fc0bbba","unresolved":false,"context_lines":[{"line_number":288,"context_line":"                    self.mechanism_manager."},{"line_number":289,"context_line":"                    validate_port_binding(mech_context)):"},{"line_number":290,"context_line":"                return False"},{"line_number":291,"context_line":"            self.mechanism_manager.unbind_port(mech_context)"},{"line_number":292,"context_line":""},{"line_number":293,"context_line":"        if host_set:"},{"line_number":294,"context_line":"            binding.host \u003d host"}],"source_content_type":"text/x-python","patch_set":15,"id":"baada198_eca557a2","line":291,"in_reply_to":"baada198_58ad20e8","updated":"2014-07-07 15:32:20.000000000","message":"unbind_port() has been removed by icehouse stable.\r\n\r\nThe above code bunch need to be changed as below:\r\n\r\nif binding.vif_type !\u003d portbindings.VIF_TYPE_UNBOUND:\r\n              if (not host_set and not vnic_type_set and not profile_set and binding.segment):\r\n                 return False\r\n    self._delete_port_binding(mech_context)\r\n\r\nI\u0027ll try to make this change and repush a new patch set.","commit_id":"8b05e6018964f0590645beb8545d17092cf6f059"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"7113e94a7af90c8e714ec5ecb49dcbd5d886cd00","unresolved":false,"context_lines":[{"line_number":288,"context_line":"                    self.mechanism_manager."},{"line_number":289,"context_line":"                    validate_port_binding(mech_context)):"},{"line_number":290,"context_line":"                return False"},{"line_number":291,"context_line":"            self.mechanism_manager.unbind_port(mech_context)"},{"line_number":292,"context_line":""},{"line_number":293,"context_line":"        if host_set:"},{"line_number":294,"context_line":"            binding.host \u003d host"}],"source_content_type":"text/x-python","patch_set":15,"id":"baada198_c4c69899","line":291,"in_reply_to":"baada198_eca557a2","updated":"2014-07-08 01:05:50.000000000","message":"Done","commit_id":"8b05e6018964f0590645beb8545d17092cf6f059"},{"author":{"_account_id":4395,"name":"Aaron Rosen","email":"aaronorosen@gmail.com","username":"arosen"},"change_message_id":"1ac78eaa57d9cfe9e5a0dfc1371688022a2a2929","unresolved":false,"context_lines":[{"line_number":760,"context_line":"        return updated_port"},{"line_number":761,"context_line":""},{"line_number":762,"context_line":"    def update_dvr_port_binding(self, context, id, port):"},{"line_number":763,"context_line":"        attrs \u003d port[\u0027port\u0027]"},{"line_number":764,"context_line":"        need_port_update_notify \u003d False"},{"line_number":765,"context_line":""},{"line_number":766,"context_line":"        host \u003d attrs and attrs.get(portbindings.HOST_ID)"}],"source_content_type":"text/x-python","patch_set":19,"id":"baada198_fbf6ae8f","line":763,"updated":"2014-07-09 01:06:01.000000000","message":"nit: i think p would be a better name than attrs.","commit_id":"ec4848b7a9006482162f417e8d027c27837f8ed6"},{"author":{"_account_id":4395,"name":"Aaron Rosen","email":"aaronorosen@gmail.com","username":"arosen"},"change_message_id":"1ac78eaa57d9cfe9e5a0dfc1371688022a2a2929","unresolved":false,"context_lines":[{"line_number":857,"context_line":"        # dvrportbinding bucket"},{"line_number":858,"context_line":"        query \u003d session.query(models.DVRPortBinding)"},{"line_number":859,"context_line":"        bindings \u003d query.filter(models.DVRPortBinding.port_id \u003d\u003d port_id).all()"},{"line_number":860,"context_line":"        for bind in bindings:"},{"line_number":861,"context_line":"            if bind.status \u003d\u003d const.PORT_STATUS_ACTIVE:"},{"line_number":862,"context_line":"                return const.PORT_STATUS_ACTIVE"},{"line_number":863,"context_line":"        for bind in bindings:"}],"source_content_type":"text/x-python","patch_set":19,"id":"baada198_3b4826cc","line":860,"updated":"2014-07-09 01:06:01.000000000","message":"I\u0027m not quite sure why you need to interate this twice  Ihere and 863)","commit_id":"ec4848b7a9006482162f417e8d027c27837f8ed6"},{"author":{"_account_id":9200,"name":"IWAMOTO Toshihiro","email":"iwamoto@valinux.co.jp","username":"toshii"},"change_message_id":"0ba042ed27a481ba6ba7266d43020bfc8808b0c9","unresolved":false,"context_lines":[{"line_number":852,"context_line":"        # a binding has been succesfully established?"},{"line_number":853,"context_line":"        self.notify_security_groups_member_updated(context, result)"},{"line_number":854,"context_line":""},{"line_number":855,"context_line":"        try:"},{"line_number":856,"context_line":"            bound_context \u003d self._bind_port_if_needed(mech_context)"},{"line_number":857,"context_line":"        except ml2_exc.MechanismDriverError:"},{"line_number":858,"context_line":"            with excutils.save_and_reraise_exception():"}],"source_content_type":"text/x-python","patch_set":29,"id":"baada198_1e2d1ba9","line":855,"updated":"2014-07-16 03:21:25.000000000","message":"mech_context \u003d\u003d None case should be handled here, too.","commit_id":"bdc5d966db8d066e857c12b989380cd73bd4341c"},{"author":{"_account_id":6659,"name":"Paul Michali","email":"pc@michali.net","username":"pcm"},"change_message_id":"6baa33d0d7456ef033621f77e7cdf9de39ed63f4","unresolved":false,"context_lines":[{"line_number":982,"context_line":"                    context, id, do_notify\u003dFalse)"},{"line_number":983,"context_line":""},{"line_number":984,"context_line":"            LOG.debug(\"Calling delete_port for %(port_id)s owned by %(owner)s\""},{"line_number":985,"context_line":"                      % {\"port_id\": id, \"owner\": port[\u0027device_owner\u0027]})"},{"line_number":986,"context_line":"            super(Ml2Plugin, self).delete_port(context, id)"},{"line_number":987,"context_line":""},{"line_number":988,"context_line":"        # now that we\u0027ve left db transaction, we are safe to notify"}],"source_content_type":"text/x-python","patch_set":32,"id":"baada198_7b2365be","line":985,"updated":"2014-07-16 18:36:06.000000000","message":"% -\u003e ,","commit_id":"6c6d547f44af23a23448e893e1fe0ee6c1ec9d24"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"886d5cd2eed2cc7403a22386ca7a20fbbb5b2aea","unresolved":false,"context_lines":[{"line_number":982,"context_line":"                    context, id, do_notify\u003dFalse)"},{"line_number":983,"context_line":""},{"line_number":984,"context_line":"            LOG.debug(\"Calling delete_port for %(port_id)s owned by %(owner)s\""},{"line_number":985,"context_line":"                      % {\"port_id\": id, \"owner\": port[\u0027device_owner\u0027]})"},{"line_number":986,"context_line":"            super(Ml2Plugin, self).delete_port(context, id)"},{"line_number":987,"context_line":""},{"line_number":988,"context_line":"        # now that we\u0027ve left db transaction, we are safe to notify"}],"source_content_type":"text/x-python","patch_set":32,"id":"baada198_edb41cd6","line":985,"in_reply_to":"baada198_7b2365be","updated":"2014-07-16 18:51:52.000000000","message":"Done","commit_id":"6c6d547f44af23a23448e893e1fe0ee6c1ec9d24"},{"author":{"_account_id":6659,"name":"Paul Michali","email":"pc@michali.net","username":"pcm"},"change_message_id":"6baa33d0d7456ef033621f77e7cdf9de39ed63f4","unresolved":false,"context_lines":[{"line_number":995,"context_line":"            if mech_context:"},{"line_number":996,"context_line":"                self.mechanism_manager.delete_port_postcommit(mech_context)"},{"line_number":997,"context_line":"            else:"},{"line_number":998,"context_line":"                LOG.error(_(\"Unable to invoke delete_port_postcommit,\""},{"line_number":999,"context_line":"                            \" mech_context NULL for port %s\"), id)"},{"line_number":1000,"context_line":"        except ml2_exc.MechanismDriverError:"},{"line_number":1001,"context_line":"            # TODO(apech) - One or more mechanism driver failed to"}],"source_content_type":"text/x-python","patch_set":32,"id":"baada198_bb2dfdaa","line":998,"updated":"2014-07-16 18:36:06.000000000","message":"Nit: space at end of line vs start of next line. here and L1004-1005","commit_id":"6c6d547f44af23a23448e893e1fe0ee6c1ec9d24"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"886d5cd2eed2cc7403a22386ca7a20fbbb5b2aea","unresolved":false,"context_lines":[{"line_number":995,"context_line":"            if mech_context:"},{"line_number":996,"context_line":"                self.mechanism_manager.delete_port_postcommit(mech_context)"},{"line_number":997,"context_line":"            else:"},{"line_number":998,"context_line":"                LOG.error(_(\"Unable to invoke delete_port_postcommit,\""},{"line_number":999,"context_line":"                            \" mech_context NULL for port %s\"), id)"},{"line_number":1000,"context_line":"        except ml2_exc.MechanismDriverError:"},{"line_number":1001,"context_line":"            # TODO(apech) - One or more mechanism driver failed to"}],"source_content_type":"text/x-python","patch_set":32,"id":"baada198_0dba30c0","line":998,"in_reply_to":"baada198_bb2dfdaa","updated":"2014-07-16 18:51:52.000000000","message":"Done","commit_id":"6c6d547f44af23a23448e893e1fe0ee6c1ec9d24"},{"author":{"_account_id":6659,"name":"Paul Michali","email":"pc@michali.net","username":"pcm"},"change_message_id":"6baa33d0d7456ef033621f77e7cdf9de39ed63f4","unresolved":false,"context_lines":[{"line_number":1029,"context_line":"    def _generate_dvr_port_status(self, session, port_id):"},{"line_number":1030,"context_line":"        # an OR\u0027ed value of status assigned to parent port from the"},{"line_number":1031,"context_line":"        # dvrportbinding bucket"},{"line_number":1032,"context_line":"        query \u003d session.query(models.DVRPortBinding)"},{"line_number":1033,"context_line":"        bindings \u003d query.filter(models.DVRPortBinding.port_id \u003d\u003d port_id).all()"},{"line_number":1034,"context_line":"        for bind in bindings:"},{"line_number":1035,"context_line":"            if bind.status \u003d\u003d const.PORT_STATUS_ACTIVE:"}],"source_content_type":"text/x-python","patch_set":32,"id":"baada198_3b11ed5d","line":1032,"updated":"2014-07-16 18:36:06.000000000","message":"Could you have the query only return the status field, and then check to see if const.PORT_STATUS_ACTIVE is IN the bindings? Ditto for DOWN?","commit_id":"6c6d547f44af23a23448e893e1fe0ee6c1ec9d24"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"886d5cd2eed2cc7403a22386ca7a20fbbb5b2aea","unresolved":false,"context_lines":[{"line_number":1029,"context_line":"    def _generate_dvr_port_status(self, session, port_id):"},{"line_number":1030,"context_line":"        # an OR\u0027ed value of status assigned to parent port from the"},{"line_number":1031,"context_line":"        # dvrportbinding bucket"},{"line_number":1032,"context_line":"        query \u003d session.query(models.DVRPortBinding)"},{"line_number":1033,"context_line":"        bindings \u003d query.filter(models.DVRPortBinding.port_id \u003d\u003d port_id).all()"},{"line_number":1034,"context_line":"        for bind in bindings:"},{"line_number":1035,"context_line":"            if bind.status \u003d\u003d const.PORT_STATUS_ACTIVE:"}],"source_content_type":"text/x-python","patch_set":32,"id":"baada198_8dc5603f","line":1032,"in_reply_to":"baada198_3b11ed5d","updated":"2014-07-16 18:51:52.000000000","message":"actually this shouldn\u0027t be here at all...I\u0027ll fix it, thanks for pointing it out.","commit_id":"6c6d547f44af23a23448e893e1fe0ee6c1ec9d24"},{"author":{"_account_id":1689,"name":"Robert Kukura","email":"rk@theep.net","username":"rkukura"},"change_message_id":"0b2a788eb0e063fad091cf3bf814076424fdfd9e","unresolved":false,"context_lines":[{"line_number":428,"context_line":"            if (not host_set and not vnic_type_set and"},{"line_number":429,"context_line":"                not profile_set and binding.segment):"},{"line_number":430,"context_line":"                return False"},{"line_number":431,"context_line":"            self._delete_port_binding(mech_context)"},{"line_number":432,"context_line":""},{"line_number":433,"context_line":"        if host_set:"},{"line_number":434,"context_line":"            binding.host \u003d host"}],"source_content_type":"text/x-python","patch_set":33,"id":"baada198_500f30e1","line":431,"updated":"2014-07-17 16:20:07.000000000","message":"The _delete_port_binding() function no longer exists. This also raises concern that this binding logic isn\u0027t adequately covered by unit tests.","commit_id":"bd6fdc71e7c4845405afc2391798aae3761da9d9"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"fd19816b4d2027d1a84b7ad7af4522a9065b61cf","unresolved":false,"context_lines":[{"line_number":428,"context_line":"            if (not host_set and not vnic_type_set and"},{"line_number":429,"context_line":"                not profile_set and binding.segment):"},{"line_number":430,"context_line":"                return False"},{"line_number":431,"context_line":"            self._delete_port_binding(mech_context)"},{"line_number":432,"context_line":""},{"line_number":433,"context_line":"        if host_set:"},{"line_number":434,"context_line":"            binding.host \u003d host"}],"source_content_type":"text/x-python","patch_set":33,"id":"baada198_570f1f88","line":431,"in_reply_to":"baada198_500f30e1","updated":"2014-07-17 19:18:28.000000000","message":"you\u0027re right; we\u0027ll fix it","commit_id":"bd6fdc71e7c4845405afc2391798aae3761da9d9"},{"author":{"_account_id":1689,"name":"Robert Kukura","email":"rk@theep.net","username":"rkukura"},"change_message_id":"0b2a788eb0e063fad091cf3bf814076424fdfd9e","unresolved":false,"context_lines":[{"line_number":434,"context_line":"            binding.host \u003d host"},{"line_number":435,"context_line":""},{"line_number":436,"context_line":"        if binding.host:"},{"line_number":437,"context_line":"            self.mechanism_manager.bind_port(mech_context)"},{"line_number":438,"context_line":""},{"line_number":439,"context_line":"        return True"},{"line_number":440,"context_line":""}],"source_content_type":"text/x-python","patch_set":33,"id":"baada198_907b8828","line":437,"updated":"2014-07-17 16:20:07.000000000","message":"The _processs_dvr_port_binding() function is called within a transaction, but the bind_port() function must not be called within a transaction because mechanism drivers\u0027 bind_port() methods are allowed to make blocking calls on devices and controllers. This DVR binding logic needs to be updated based on the recent changes to ML2 port binding.","commit_id":"bd6fdc71e7c4845405afc2391798aae3761da9d9"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"fd19816b4d2027d1a84b7ad7af4522a9065b61cf","unresolved":false,"context_lines":[{"line_number":434,"context_line":"            binding.host \u003d host"},{"line_number":435,"context_line":""},{"line_number":436,"context_line":"        if binding.host:"},{"line_number":437,"context_line":"            self.mechanism_manager.bind_port(mech_context)"},{"line_number":438,"context_line":""},{"line_number":439,"context_line":"        return True"},{"line_number":440,"context_line":""}],"source_content_type":"text/x-python","patch_set":33,"id":"baada198_17bf6761","line":437,"in_reply_to":"baada198_907b8828","updated":"2014-07-17 19:18:28.000000000","message":"Agreed.  I\u0027ll revise","commit_id":"bd6fdc71e7c4845405afc2391798aae3761da9d9"},{"author":{"_account_id":1131,"name":"Brian Haley","email":"haleyb.dev@gmail.com","username":"brian-haley"},"change_message_id":"6a4e785598c17eef7b229db3a52179850965e9a2","unresolved":false,"context_lines":[{"line_number":472,"context_line":"        if (not dvr_binding.router_id and"},{"line_number":473,"context_line":"                dvr_binding.status \u003d\u003d const.PORT_STATUS_DOWN):"},{"line_number":474,"context_line":"            with context.session.begin(subtransactions\u003dTrue):"},{"line_number":475,"context_line":"                LOG.debug(\"DVR: Deleting dvr binding for port %s\","},{"line_number":476,"context_line":"                          dvr_binding.port_id)"},{"line_number":477,"context_line":"                context.session.delete(dvr_binding)"},{"line_number":478,"context_line":""}],"source_content_type":"text/x-python","patch_set":33,"id":"baada198_e7118905","line":475,"updated":"2014-07-17 03:58:48.000000000","message":"Can remove one of the \"dvr\" strings here, maybe:\n\"Deleting DVR binding for port %s\" ?","commit_id":"bd6fdc71e7c4845405afc2391798aae3761da9d9"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"fd19816b4d2027d1a84b7ad7af4522a9065b61cf","unresolved":false,"context_lines":[{"line_number":472,"context_line":"        if (not dvr_binding.router_id and"},{"line_number":473,"context_line":"                dvr_binding.status \u003d\u003d const.PORT_STATUS_DOWN):"},{"line_number":474,"context_line":"            with context.session.begin(subtransactions\u003dTrue):"},{"line_number":475,"context_line":"                LOG.debug(\"DVR: Deleting dvr binding for port %s\","},{"line_number":476,"context_line":"                          dvr_binding.port_id)"},{"line_number":477,"context_line":"                context.session.delete(dvr_binding)"},{"line_number":478,"context_line":""}],"source_content_type":"text/x-python","patch_set":33,"id":"baada198_f75f5373","line":475,"in_reply_to":"baada198_e7118905","updated":"2014-07-17 19:18:28.000000000","message":"Done","commit_id":"bd6fdc71e7c4845405afc2391798aae3761da9d9"},{"author":{"_account_id":1689,"name":"Robert Kukura","email":"rk@theep.net","username":"rkukura"},"change_message_id":"0b2a788eb0e063fad091cf3bf814076424fdfd9e","unresolved":false,"context_lines":[{"line_number":823,"context_line":"            self._process_port_create_security_group(context, result, sgids)"},{"line_number":824,"context_line":"            network \u003d self.get_network(context, result[\u0027network_id\u0027])"},{"line_number":825,"context_line":"            # do early binding for non-DVR ports; DVR ports binding"},{"line_number":826,"context_line":"            # happens late (via L3-Agent)"},{"line_number":827,"context_line":"            if attrs[\u0027device_owner\u0027] !\u003d const.DEVICE_OWNER_DVR_INTERFACE:"},{"line_number":828,"context_line":"                binding \u003d db.add_port_binding(session, result[\u0027id\u0027])"},{"line_number":829,"context_line":"                mech_context \u003d driver_context.PortContext("}],"source_content_type":"text/x-python","patch_set":33,"id":"baada198_30771ca1","line":826,"updated":"2014-07-17 16:20:07.000000000","message":"Please fix this comment. The _process_port_binding() function does not actually do the binding, which has to happen outside any transaction. It just determines if any existing binding has been invalidated, and populates the port dictionary with the portbinding attributes.","commit_id":"bd6fdc71e7c4845405afc2391798aae3761da9d9"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"fd19816b4d2027d1a84b7ad7af4522a9065b61cf","unresolved":false,"context_lines":[{"line_number":823,"context_line":"            self._process_port_create_security_group(context, result, sgids)"},{"line_number":824,"context_line":"            network \u003d self.get_network(context, result[\u0027network_id\u0027])"},{"line_number":825,"context_line":"            # do early binding for non-DVR ports; DVR ports binding"},{"line_number":826,"context_line":"            # happens late (via L3-Agent)"},{"line_number":827,"context_line":"            if attrs[\u0027device_owner\u0027] !\u003d const.DEVICE_OWNER_DVR_INTERFACE:"},{"line_number":828,"context_line":"                binding \u003d db.add_port_binding(session, result[\u0027id\u0027])"},{"line_number":829,"context_line":"                mech_context \u003d driver_context.PortContext("}],"source_content_type":"text/x-python","patch_set":33,"id":"baada198_7753436c","line":826,"in_reply_to":"baada198_30771ca1","updated":"2014-07-17 19:18:28.000000000","message":"Done","commit_id":"bd6fdc71e7c4845405afc2391798aae3761da9d9"},{"author":{"_account_id":9200,"name":"IWAMOTO Toshihiro","email":"iwamoto@valinux.co.jp","username":"toshii"},"change_message_id":"e680f4e41b434d85fb5dbe4848946aeb1eda08c0","unresolved":false,"context_lines":[{"line_number":966,"context_line":"            port \u003d self._make_port_dict(port_db)"},{"line_number":967,"context_line":""},{"line_number":968,"context_line":"            network \u003d self.get_network(context, port[\u0027network_id\u0027])"},{"line_number":969,"context_line":"            if port[\u0027device_owner\u0027] \u003d\u003d const.DEVICE_OWNER_DVR_INTERFACE:"},{"line_number":970,"context_line":"                bindings \u003d db.get_dvr_port_bindings(context.session, id)"},{"line_number":971,"context_line":"                for bind in bindings:"},{"line_number":972,"context_line":"                    mech_context \u003d driver_context.PortContext("}],"source_content_type":"text/x-python","patch_set":33,"id":"baada198_8ca0eca6","line":969,"updated":"2014-07-17 08:34:57.000000000","message":"IIUC, if the device_owner is DVR_INTERFACE, db.get_locked_port_and_binding above returns None and you cannot reach here.","commit_id":"bd6fdc71e7c4845405afc2391798aae3761da9d9"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"fd19816b4d2027d1a84b7ad7af4522a9065b61cf","unresolved":false,"context_lines":[{"line_number":966,"context_line":"            port \u003d self._make_port_dict(port_db)"},{"line_number":967,"context_line":""},{"line_number":968,"context_line":"            network \u003d self.get_network(context, port[\u0027network_id\u0027])"},{"line_number":969,"context_line":"            if port[\u0027device_owner\u0027] \u003d\u003d const.DEVICE_OWNER_DVR_INTERFACE:"},{"line_number":970,"context_line":"                bindings \u003d db.get_dvr_port_bindings(context.session, id)"},{"line_number":971,"context_line":"                for bind in bindings:"},{"line_number":972,"context_line":"                    mech_context \u003d driver_context.PortContext("}],"source_content_type":"text/x-python","patch_set":33,"id":"baada198_12021509","line":969,"in_reply_to":"baada198_8ca0eca6","updated":"2014-07-17 19:18:28.000000000","message":"Done","commit_id":"bd6fdc71e7c4845405afc2391798aae3761da9d9"},{"author":{"_account_id":9200,"name":"IWAMOTO Toshihiro","email":"iwamoto@valinux.co.jp","username":"toshii"},"change_message_id":"e680f4e41b434d85fb5dbe4848946aeb1eda08c0","unresolved":false,"context_lines":[{"line_number":1018,"context_line":"                return"},{"line_number":1019,"context_line":"            port \u003d self._make_port_dict(port_db)"},{"line_number":1020,"context_line":"            network \u003d self.get_network(plugin_context, port[\u0027network_id\u0027])"},{"line_number":1021,"context_line":"            port_context \u003d driver_context.PortContext("},{"line_number":1022,"context_line":"                self, plugin_context, port, network, port_db.port_binding)"},{"line_number":1023,"context_line":""},{"line_number":1024,"context_line":"        return self._bind_port_if_needed(port_context)"}],"source_content_type":"text/x-python","patch_set":33,"id":"baada198_ece968b8","line":1021,"updated":"2014-07-17 08:34:57.000000000","message":"port_binding can be None and _bind_port_if_needed below fails in this case.","commit_id":"bd6fdc71e7c4845405afc2391798aae3761da9d9"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"fd19816b4d2027d1a84b7ad7af4522a9065b61cf","unresolved":false,"context_lines":[{"line_number":1018,"context_line":"                return"},{"line_number":1019,"context_line":"            port \u003d self._make_port_dict(port_db)"},{"line_number":1020,"context_line":"            network \u003d self.get_network(plugin_context, port[\u0027network_id\u0027])"},{"line_number":1021,"context_line":"            port_context \u003d driver_context.PortContext("},{"line_number":1022,"context_line":"                self, plugin_context, port, network, port_db.port_binding)"},{"line_number":1023,"context_line":""},{"line_number":1024,"context_line":"        return self._bind_port_if_needed(port_context)"}],"source_content_type":"text/x-python","patch_set":33,"id":"baada198_520c8d3b","line":1021,"in_reply_to":"baada198_ece968b8","updated":"2014-07-17 19:18:28.000000000","message":"Done","commit_id":"bd6fdc71e7c4845405afc2391798aae3761da9d9"},{"author":{"_account_id":9200,"name":"IWAMOTO Toshihiro","email":"iwamoto@valinux.co.jp","username":"toshii"},"change_message_id":"e680f4e41b434d85fb5dbe4848946aeb1eda08c0","unresolved":false,"context_lines":[{"line_number":1037,"context_line":"                LOG.warning(_(\"Port %(port)s updated up by agent not found\"),"},{"line_number":1038,"context_line":"                            {\u0027port\u0027: port_id})"},{"line_number":1039,"context_line":"                return False"},{"line_number":1040,"context_line":"            if port[\u0027device_owner\u0027] \u003d\u003d const.DEVICE_OWNER_DVR_INTERFACE:"},{"line_number":1041,"context_line":"                binding \u003d db.get_dvr_port_binding_by_host("},{"line_number":1042,"context_line":"                    session, port[\u0027id\u0027], host)"},{"line_number":1043,"context_line":"                if not binding:"}],"source_content_type":"text/x-python","patch_set":33,"id":"baada198_3139f73f","line":1040,"updated":"2014-07-17 08:34:57.000000000","message":"This transaction does nothing if the device_owner isn\u0027t DVR_INTERFACE. So I think this if statement should go before line 1033.\n\nAlso, could you explain why this needs to be a separate transaction from the other one starting at line 1051?","commit_id":"bd6fdc71e7c4845405afc2391798aae3761da9d9"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"fd19816b4d2027d1a84b7ad7af4522a9065b61cf","unresolved":false,"context_lines":[{"line_number":1037,"context_line":"                LOG.warning(_(\"Port %(port)s updated up by agent not found\"),"},{"line_number":1038,"context_line":"                            {\u0027port\u0027: port_id})"},{"line_number":1039,"context_line":"                return False"},{"line_number":1040,"context_line":"            if port[\u0027device_owner\u0027] \u003d\u003d const.DEVICE_OWNER_DVR_INTERFACE:"},{"line_number":1041,"context_line":"                binding \u003d db.get_dvr_port_binding_by_host("},{"line_number":1042,"context_line":"                    session, port[\u0027id\u0027], host)"},{"line_number":1043,"context_line":"                if not binding:"}],"source_content_type":"text/x-python","patch_set":33,"id":"baada198_72127159","line":1040,"in_reply_to":"baada198_3139f73f","updated":"2014-07-17 19:18:28.000000000","message":"Done","commit_id":"bd6fdc71e7c4845405afc2391798aae3761da9d9"},{"author":{"_account_id":1131,"name":"Brian Haley","email":"haleyb.dev@gmail.com","username":"brian-haley"},"change_message_id":"6a4e785598c17eef7b229db3a52179850965e9a2","unresolved":false,"context_lines":[{"line_number":1041,"context_line":"                binding \u003d db.get_dvr_port_binding_by_host("},{"line_number":1042,"context_line":"                    session, port[\u0027id\u0027], host)"},{"line_number":1043,"context_line":"                if not binding:"},{"line_number":1044,"context_line":"                    LOG.error(_(\"Binding info for port %s not found\"),"},{"line_number":1045,"context_line":"                              port_id)"},{"line_number":1046,"context_line":"                    return False"},{"line_number":1047,"context_line":"                binding[\u0027status\u0027] \u003d status"}],"source_content_type":"text/x-python","patch_set":33,"id":"baada198_872b6d32","line":1044,"updated":"2014-07-17 03:58:48.000000000","message":"s/port/DVR port/ to be consistent with other log messages","commit_id":"bd6fdc71e7c4845405afc2391798aae3761da9d9"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"fd19816b4d2027d1a84b7ad7af4522a9065b61cf","unresolved":false,"context_lines":[{"line_number":1041,"context_line":"                binding \u003d db.get_dvr_port_binding_by_host("},{"line_number":1042,"context_line":"                    session, port[\u0027id\u0027], host)"},{"line_number":1043,"context_line":"                if not binding:"},{"line_number":1044,"context_line":"                    LOG.error(_(\"Binding info for port %s not found\"),"},{"line_number":1045,"context_line":"                              port_id)"},{"line_number":1046,"context_line":"                    return False"},{"line_number":1047,"context_line":"                binding[\u0027status\u0027] \u003d status"}],"source_content_type":"text/x-python","patch_set":33,"id":"baada198_f2fe8104","line":1044,"in_reply_to":"baada198_872b6d32","updated":"2014-07-17 19:18:28.000000000","message":"Done","commit_id":"bd6fdc71e7c4845405afc2391798aae3761da9d9"},{"author":{"_account_id":1131,"name":"Brian Haley","email":"haleyb.dev@gmail.com","username":"brian-haley"},"change_message_id":"6a4e785598c17eef7b229db3a52179850965e9a2","unresolved":false,"context_lines":[{"line_number":1094,"context_line":"                for b in bindings:"},{"line_number":1095,"context_line":"                    if b.host \u003d\u003d host:"},{"line_number":1096,"context_line":"                        return True"},{"line_number":1097,"context_line":"                LOG.debug(\"No Binding exists for port %s\", port_id)"},{"line_number":1098,"context_line":"                return False"},{"line_number":1099,"context_line":"            else:"},{"line_number":1100,"context_line":"                port_host \u003d db.get_port_binding_host(port_id)"}],"source_content_type":"text/x-python","patch_set":33,"id":"baada198_47195521","line":1097,"updated":"2014-07-17 03:58:48.000000000","message":"s/port/DVR port/ to be consistent with other log messages","commit_id":"bd6fdc71e7c4845405afc2391798aae3761da9d9"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"fd19816b4d2027d1a84b7ad7af4522a9065b61cf","unresolved":false,"context_lines":[{"line_number":1094,"context_line":"                for b in bindings:"},{"line_number":1095,"context_line":"                    if b.host \u003d\u003d host:"},{"line_number":1096,"context_line":"                        return True"},{"line_number":1097,"context_line":"                LOG.debug(\"No Binding exists for port %s\", port_id)"},{"line_number":1098,"context_line":"                return False"},{"line_number":1099,"context_line":"            else:"},{"line_number":1100,"context_line":"                port_host \u003d db.get_port_binding_host(port_id)"}],"source_content_type":"text/x-python","patch_set":33,"id":"baada198_9739b741","line":1097,"in_reply_to":"baada198_47195521","updated":"2014-07-17 19:18:28.000000000","message":"Done","commit_id":"bd6fdc71e7c4845405afc2391798aae3761da9d9"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"f39d0903858d4d50d9f7e9e89a722885b82b9f7f","unresolved":false,"context_lines":[{"line_number":806,"context_line":"            mech_context \u003d driver_context.PortContext(self, context, result,"},{"line_number":807,"context_line":"                                                      network, binding)"},{"line_number":808,"context_line":"            self._process_port_binding(mech_context, attrs)"},{"line_number":809,"context_line":""},{"line_number":810,"context_line":"            result[addr_pair.ADDRESS_PAIRS] \u003d ("},{"line_number":811,"context_line":"                self._process_create_allowed_address_pairs("},{"line_number":812,"context_line":"                    context, result,"}],"source_content_type":"text/x-python","patch_set":35,"id":"baada198_c370ae0a","line":809,"updated":"2014-07-18 19:23:33.000000000","message":"oops","commit_id":"c116784491e50adc224b9cfe7f3f2ba2f24e086e"},{"author":{"_account_id":9361,"name":"Vivekanandan Narasimhan","email":"n.vivekanandan@ericsson.com","username":"viveknarasimhan"},"change_message_id":"293403b4f3ea8c5af3b5b124eed63e0af58091df","unresolved":false,"context_lines":[{"line_number":887,"context_line":"            binding.vif_details \u003d \u0027\u0027"},{"line_number":888,"context_line":"            binding.vif_type \u003d portbindings.VIF_TYPE_UNBOUND"},{"line_number":889,"context_line":"            binding.driver \u003d None"},{"line_number":890,"context_line":"            binding.segment \u003d None"},{"line_number":891,"context_line":""},{"line_number":892,"context_line":"        self._update_port_dict_binding(port, binding)"},{"line_number":893,"context_line":"        binding.host \u003d attrs and attrs.get(portbindings.HOST_ID)"}],"source_content_type":"text/x-python","patch_set":43,"id":"baada198_be9304a3","line":890,"updated":"2014-07-23 18:56:03.000000000","message":"Need to insert binding.host \u003d \u0027 \u0027","commit_id":"d2f3c9dae3816a561550358b1ceeb7af91a71910"},{"author":{"_account_id":9361,"name":"Vivekanandan Narasimhan","email":"n.vivekanandan@ericsson.com","username":"viveknarasimhan"},"change_message_id":"f70f8c52ff0078af5d4dc072da4d6b6724c665ed","unresolved":false,"context_lines":[{"line_number":887,"context_line":"            binding.vif_details \u003d \u0027\u0027"},{"line_number":888,"context_line":"            binding.vif_type \u003d portbindings.VIF_TYPE_UNBOUND"},{"line_number":889,"context_line":"            binding.driver \u003d None"},{"line_number":890,"context_line":"            binding.segment \u003d None"},{"line_number":891,"context_line":""},{"line_number":892,"context_line":"        self._update_port_dict_binding(port, binding)"},{"line_number":893,"context_line":"        binding.host \u003d attrs and attrs.get(portbindings.HOST_ID)"}],"source_content_type":"text/x-python","patch_set":43,"id":"baada198_bd93f5fe","line":890,"in_reply_to":"baada198_916aa07f","updated":"2014-07-24 11:16:40.000000000","message":"Done","commit_id":"d2f3c9dae3816a561550358b1ceeb7af91a71910"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"00ae61d718f2b1da2aad9c38b888394a8bd8e80a","unresolved":false,"context_lines":[{"line_number":887,"context_line":"            binding.vif_details \u003d \u0027\u0027"},{"line_number":888,"context_line":"            binding.vif_type \u003d portbindings.VIF_TYPE_UNBOUND"},{"line_number":889,"context_line":"            binding.driver \u003d None"},{"line_number":890,"context_line":"            binding.segment \u003d None"},{"line_number":891,"context_line":""},{"line_number":892,"context_line":"        self._update_port_dict_binding(port, binding)"},{"line_number":893,"context_line":"        binding.host \u003d attrs and attrs.get(portbindings.HOST_ID)"}],"source_content_type":"text/x-python","patch_set":43,"id":"baada198_916aa07f","line":890,"in_reply_to":"baada198_be9304a3","updated":"2014-07-24 07:05:16.000000000","message":"this might come as a default, but it\u0027s good to be explicit.","commit_id":"d2f3c9dae3816a561550358b1ceeb7af91a71910"},{"author":{"_account_id":9361,"name":"Vivekanandan Narasimhan","email":"n.vivekanandan@ericsson.com","username":"viveknarasimhan"},"change_message_id":"10c3e1a6e9d6733413f09ad75557c6e109fe90f2","unresolved":false,"context_lines":[{"line_number":1006,"context_line":"            # for both normal and DVR Interface ports, only one invocation of"},{"line_number":1007,"context_line":"            # delete_port_postcommit"},{"line_number":1008,"context_line":"            if mech_context:"},{"line_number":1009,"context_line":"                self.mechanism_manager.delete_port_postcommit(mech_context)"},{"line_number":1010,"context_line":"        except ml2_exc.MechanismDriverError:"},{"line_number":1011,"context_line":"            # TODO(apech) - One or more mechanism driver failed to"},{"line_number":1012,"context_line":"            # delete the port.  Ideally we\u0027d notify the caller of the"}],"source_content_type":"text/x-python","patch_set":43,"id":"baada198_8eb7e139","line":1009,"updated":"2014-07-24 06:08:21.000000000","message":"Only last binding is updated to cloud nodes here, due to removal of calls to delete_port_precommit.  Need to put back calls to delete_port_precommit for gathering the bindings so that delete_port_postcommit can scatter fdb entries for such deleted bindings to the cloud nodes.","commit_id":"d2f3c9dae3816a561550358b1ceeb7af91a71910"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"00ae61d718f2b1da2aad9c38b888394a8bd8e80a","unresolved":false,"context_lines":[{"line_number":1006,"context_line":"            # for both normal and DVR Interface ports, only one invocation of"},{"line_number":1007,"context_line":"            # delete_port_postcommit"},{"line_number":1008,"context_line":"            if mech_context:"},{"line_number":1009,"context_line":"                self.mechanism_manager.delete_port_postcommit(mech_context)"},{"line_number":1010,"context_line":"        except ml2_exc.MechanismDriverError:"},{"line_number":1011,"context_line":"            # TODO(apech) - One or more mechanism driver failed to"},{"line_number":1012,"context_line":"            # delete the port.  Ideally we\u0027d notify the caller of the"}],"source_content_type":"text/x-python","patch_set":43,"id":"baada198_b1988476","line":1009,"in_reply_to":"baada198_8eb7e139","updated":"2014-07-24 07:05:16.000000000","message":"Understood, it sounds like here the issue is that we leave resources behind. We might get away with this thanks to the cascading trigger, perhaps? I trust you verified that what you propose it\u0027s the best course of action, so I am okay seeing this changed.","commit_id":"d2f3c9dae3816a561550358b1ceeb7af91a71910"},{"author":{"_account_id":9361,"name":"Vivekanandan Narasimhan","email":"n.vivekanandan@ericsson.com","username":"viveknarasimhan"},"change_message_id":"f70f8c52ff0078af5d4dc072da4d6b6724c665ed","unresolved":false,"context_lines":[{"line_number":1006,"context_line":"            # for both normal and DVR Interface ports, only one invocation of"},{"line_number":1007,"context_line":"            # delete_port_postcommit"},{"line_number":1008,"context_line":"            if mech_context:"},{"line_number":1009,"context_line":"                self.mechanism_manager.delete_port_postcommit(mech_context)"},{"line_number":1010,"context_line":"        except ml2_exc.MechanismDriverError:"},{"line_number":1011,"context_line":"            # TODO(apech) - One or more mechanism driver failed to"},{"line_number":1012,"context_line":"            # delete the port.  Ideally we\u0027d notify the caller of the"}],"source_content_type":"text/x-python","patch_set":43,"id":"baada198_9dff1102","line":1009,"in_reply_to":"baada198_b1988476","updated":"2014-07-24 11:16:40.000000000","message":"Done","commit_id":"d2f3c9dae3816a561550358b1ceeb7af91a71910"},{"author":{"_account_id":9361,"name":"Vivekanandan Narasimhan","email":"n.vivekanandan@ericsson.com","username":"viveknarasimhan"},"change_message_id":"293403b4f3ea8c5af3b5b124eed63e0af58091df","unresolved":false,"context_lines":[{"line_number":1101,"context_line":"                mech_context \u003d (driver_context.DvrPortContext("},{"line_number":1102,"context_line":"                    self, context, updated_port, network,"},{"line_number":1103,"context_line":"                    binding, original_port\u003doriginal_port))"},{"line_number":1104,"context_line":"                self.mechanism_manager.update_port_precommit(mech_context)"},{"line_number":1105,"context_line":""},{"line_number":1106,"context_line":"        if updated:"},{"line_number":1107,"context_line":"            self.mechanism_manager.update_port_postcommit(mech_context)"}],"source_content_type":"text/x-python","patch_set":43,"id":"baada198_5eeae80e","line":1104,"updated":"2014-07-23 18:56:03.000000000","message":"The above if block can be combined with the earlier elif port[\u0027device_owner\u0027] \u003d\u003d DVR_INTERFACE","commit_id":"d2f3c9dae3816a561550358b1ceeb7af91a71910"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"00ae61d718f2b1da2aad9c38b888394a8bd8e80a","unresolved":false,"context_lines":[{"line_number":1101,"context_line":"                mech_context \u003d (driver_context.DvrPortContext("},{"line_number":1102,"context_line":"                    self, context, updated_port, network,"},{"line_number":1103,"context_line":"                    binding, original_port\u003doriginal_port))"},{"line_number":1104,"context_line":"                self.mechanism_manager.update_port_precommit(mech_context)"},{"line_number":1105,"context_line":""},{"line_number":1106,"context_line":"        if updated:"},{"line_number":1107,"context_line":"            self.mechanism_manager.update_port_postcommit(mech_context)"}],"source_content_type":"text/x-python","patch_set":43,"id":"baada198_b16fa45f","line":1104,"in_reply_to":"baada198_5eeae80e","updated":"2014-07-24 07:05:16.000000000","message":"the reason why this was broken out it\u0027s because this is happening outside the with statement. Feel free to revise though it you think that\u0027s the right thing to do.","commit_id":"d2f3c9dae3816a561550358b1ceeb7af91a71910"},{"author":{"_account_id":9361,"name":"Vivekanandan Narasimhan","email":"n.vivekanandan@ericsson.com","username":"viveknarasimhan"},"change_message_id":"f70f8c52ff0078af5d4dc072da4d6b6724c665ed","unresolved":false,"context_lines":[{"line_number":1101,"context_line":"                mech_context \u003d (driver_context.DvrPortContext("},{"line_number":1102,"context_line":"                    self, context, updated_port, network,"},{"line_number":1103,"context_line":"                    binding, original_port\u003doriginal_port))"},{"line_number":1104,"context_line":"                self.mechanism_manager.update_port_precommit(mech_context)"},{"line_number":1105,"context_line":""},{"line_number":1106,"context_line":"        if updated:"},{"line_number":1107,"context_line":"            self.mechanism_manager.update_port_postcommit(mech_context)"}],"source_content_type":"text/x-python","patch_set":43,"id":"baada198_e89ccdc1","line":1104,"in_reply_to":"baada198_b16fa45f","updated":"2014-07-24 11:16:40.000000000","message":"It looks ok since binding gets committed on earlier \u0027with\u0027 context.  So leaving this as is.","commit_id":"d2f3c9dae3816a561550358b1ceeb7af91a71910"},{"author":{"_account_id":1689,"name":"Robert Kukura","email":"rk@theep.net","username":"rkukura"},"change_message_id":"2a6d8ce5aec4e86ac70d2b3db4dcce9cf75cdeb5","unresolved":false,"context_lines":[{"line_number":879,"context_line":"            need_notify\u003dneed_port_update_notify)"},{"line_number":880,"context_line":"        return bound_port._port"},{"line_number":881,"context_line":""},{"line_number":882,"context_line":"    def _process_dvr_port_binding(self, mech_context, context, attrs):"},{"line_number":883,"context_line":"        binding \u003d mech_context._binding"},{"line_number":884,"context_line":"        port \u003d mech_context.current"},{"line_number":885,"context_line":""}],"source_content_type":"text/x-python","patch_set":44,"id":"baada198_c3fb4ebc","line":882,"updated":"2014-07-24 21:56:54.000000000","message":"I\u0027d like to unify the DVR and non-DVR port binding code and eliminate these DVR-specific binding functions. This will prevent the implementations from subtly diverging over time, and will simplify implementing the hierarchical port binding BP and other future changes to the binding process.\n\nI think this would be facilitated by changing the DB schema that ML2 uses to allow separate bindings for different hosts, and make the non-distributed binding case a special case of this. This might someday also be useful in VM migration support, allowing the VM\u0027s new binding to be established before the old binding is torn down.\n\nI\u0027ve discussed this unification goal with Armando, and we both agree it makes most sense to merge this patch using the current DB schema and separate functions, and to address unifying the normal and DVR binding code, and any schema changes necessary for this, in a separate patch afterwards.","commit_id":"add2393a524b940c218db5dd4afd85dbb2700971"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"62a565742e500aac5f2c3c42f9ce25042d9280ce","unresolved":false,"context_lines":[{"line_number":879,"context_line":"            need_notify\u003dneed_port_update_notify)"},{"line_number":880,"context_line":"        return bound_port._port"},{"line_number":881,"context_line":""},{"line_number":882,"context_line":"    def _process_dvr_port_binding(self, mech_context, context, attrs):"},{"line_number":883,"context_line":"        binding \u003d mech_context._binding"},{"line_number":884,"context_line":"        port \u003d mech_context.current"},{"line_number":885,"context_line":""}],"source_content_type":"text/x-python","patch_set":44,"id":"baada198_8915f7e7","line":882,"in_reply_to":"baada198_c3fb4ebc","updated":"2014-07-24 22:52:00.000000000","message":"yup, actively working to make this vision in practice! I should be able to come up with something useful in the next day or so","commit_id":"add2393a524b940c218db5dd4afd85dbb2700971"},{"author":{"_account_id":261,"name":"Salvatore Orlando","email":"salv.orlando@gmail.com","username":"salvatore-orlando"},"change_message_id":"4101b2490881ad5c999f340ed4cc672fe6cedce4","unresolved":false,"context_lines":[{"line_number":1087,"context_line":"                if not binding:"},{"line_number":1088,"context_line":"                    return"},{"line_number":1089,"context_line":"                binding[\u0027status\u0027] \u003d status"},{"line_number":1090,"context_line":"                binding.update(binding)"},{"line_number":1091,"context_line":"                updated \u003d True"},{"line_number":1092,"context_line":""},{"line_number":1093,"context_line":"        if (updated and"}],"source_content_type":"text/x-python","patch_set":46,"id":"baada198_ab90de4e","line":1090,"updated":"2014-07-25 12:19:51.000000000","message":"it seems line 1090 could be removed?","commit_id":"21673f13e29abf3cee58a387d491e16a090d912c"},{"author":{"_account_id":9361,"name":"Vivekanandan Narasimhan","email":"n.vivekanandan@ericsson.com","username":"viveknarasimhan"},"change_message_id":"9b2b9c8c137a6b21f037df094947599fd2f07ac5","unresolved":false,"context_lines":[{"line_number":1087,"context_line":"                if not binding:"},{"line_number":1088,"context_line":"                    return"},{"line_number":1089,"context_line":"                binding[\u0027status\u0027] \u003d status"},{"line_number":1090,"context_line":"                binding.update(binding)"},{"line_number":1091,"context_line":"                updated \u003d True"},{"line_number":1092,"context_line":""},{"line_number":1093,"context_line":"        if (updated and"}],"source_content_type":"text/x-python","patch_set":46,"id":"baada198_a4b55233","line":1090,"in_reply_to":"baada198_1fb580cf","updated":"2014-07-26 02:15:11.000000000","message":"Update of binding status of replicated DVR Interface port is necessary here, as it would be later used in line 1104 to generate holistic port status into the Port resource representing the DVR interface itself.","commit_id":"21673f13e29abf3cee58a387d491e16a090d912c"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"f122c84ee37f45b364e6918612fe60a793b0efd8","unresolved":false,"context_lines":[{"line_number":1087,"context_line":"                if not binding:"},{"line_number":1088,"context_line":"                    return"},{"line_number":1089,"context_line":"                binding[\u0027status\u0027] \u003d status"},{"line_number":1090,"context_line":"                binding.update(binding)"},{"line_number":1091,"context_line":"                updated \u003d True"},{"line_number":1092,"context_line":""},{"line_number":1093,"context_line":"        if (updated and"}],"source_content_type":"text/x-python","patch_set":46,"id":"baada198_1fb580cf","line":1090,"in_reply_to":"baada198_ab90de4e","updated":"2014-07-25 14:05:27.000000000","message":"I wouldn\u0027t think so.","commit_id":"21673f13e29abf3cee58a387d491e16a090d912c"},{"author":{"_account_id":261,"name":"Salvatore Orlando","email":"salv.orlando@gmail.com","username":"salvatore-orlando"},"change_message_id":"4101b2490881ad5c999f340ed4cc672fe6cedce4","unresolved":false,"context_lines":[{"line_number":1120,"context_line":"    def port_bound_to_host(self, context, port_id, host):"},{"line_number":1121,"context_line":"        port \u003d db.get_port(context.session, port_id)"},{"line_number":1122,"context_line":"        if not port:"},{"line_number":1123,"context_line":"            LOG.debug(\"No Port found with prefix %s\", port_id)"},{"line_number":1124,"context_line":"            return False"},{"line_number":1125,"context_line":"        if port[\u0027device_owner\u0027] \u003d\u003d const.DEVICE_OWNER_DVR_INTERFACE:"},{"line_number":1126,"context_line":"            bindings \u003d db.get_dvr_port_bindings(context.session, port_id)"}],"source_content_type":"text/x-python","patch_set":46,"id":"baada198_4b04a213","line":1123,"updated":"2014-07-25 12:19:51.000000000","message":"prefix? that one seem an id to me...","commit_id":"21673f13e29abf3cee58a387d491e16a090d912c"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"f122c84ee37f45b364e6918612fe60a793b0efd8","unresolved":false,"context_lines":[{"line_number":1120,"context_line":"    def port_bound_to_host(self, context, port_id, host):"},{"line_number":1121,"context_line":"        port \u003d db.get_port(context.session, port_id)"},{"line_number":1122,"context_line":"        if not port:"},{"line_number":1123,"context_line":"            LOG.debug(\"No Port found with prefix %s\", port_id)"},{"line_number":1124,"context_line":"            return False"},{"line_number":1125,"context_line":"        if port[\u0027device_owner\u0027] \u003d\u003d const.DEVICE_OWNER_DVR_INTERFACE:"},{"line_number":1126,"context_line":"            bindings \u003d db.get_dvr_port_bindings(context.session, port_id)"}],"source_content_type":"text/x-python","patch_set":46,"id":"baada198_bff3b49d","line":1123,"in_reply_to":"baada198_4b04a213","updated":"2014-07-25 14:05:27.000000000","message":"well...port id can be a partial port id too...this is a wart of the api ;(","commit_id":"21673f13e29abf3cee58a387d491e16a090d912c"},{"author":{"_account_id":1923,"name":"Mohammad Banikazemi","email":"mbanikazemi@gmail.com","username":"mb-s"},"change_message_id":"0fd3748e09ebafc4fa6e2970b5515816e9cd7acb","unresolved":false,"context_lines":[{"line_number":1113,"context_line":""},{"line_number":1114,"context_line":"        if port[\u0027device_owner\u0027] \u003d\u003d const.DEVICE_OWNER_DVR_INTERFACE:"},{"line_number":1115,"context_line":"            db.delete_dvr_port_binding_if_stale("},{"line_number":1116,"context_line":"                session, binding, binding.router_id, binding.status)"},{"line_number":1117,"context_line":""},{"line_number":1118,"context_line":"        return port[\u0027id\u0027]"},{"line_number":1119,"context_line":""}],"source_content_type":"text/x-python","patch_set":47,"id":"baada198_7d091adc","line":1116,"updated":"2014-07-25 19:10:56.000000000","message":"Are the binding.router_id and binding.status parameters passed to this method to make the code compact here? The check being done in that method could be done here.","commit_id":"4db2cfa31965499d57cb93ceb37f7914631a038b"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"73a2bd309d0e1193d39c84bddee1118e95d7e50f","unresolved":false,"context_lines":[{"line_number":1113,"context_line":""},{"line_number":1114,"context_line":"        if port[\u0027device_owner\u0027] \u003d\u003d const.DEVICE_OWNER_DVR_INTERFACE:"},{"line_number":1115,"context_line":"            db.delete_dvr_port_binding_if_stale("},{"line_number":1116,"context_line":"                session, binding, binding.router_id, binding.status)"},{"line_number":1117,"context_line":""},{"line_number":1118,"context_line":"        return port[\u0027id\u0027]"},{"line_number":1119,"context_line":""}],"source_content_type":"text/x-python","patch_set":47,"id":"baada198_2015b9e5","line":1116,"in_reply_to":"baada198_7d091adc","updated":"2014-07-25 19:57:40.000000000","message":"Salvatore had a similar comment; the intention here was to be more descriptive about what is going on. Let me see if I can come up with something better. When this code was introduced it already looked pretty similar:\n\nhttps://review.openstack.org/#/c/102398/41..42/neutron/plugins/ml2/plugin.py","commit_id":"4db2cfa31965499d57cb93ceb37f7914631a038b"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"2adbc14b46668c2583dfa619bd5b4c9770375752","unresolved":false,"context_lines":[{"line_number":980,"context_line":"            port \u003d self._make_port_dict(port_db)"},{"line_number":981,"context_line":""},{"line_number":982,"context_line":"            network \u003d self.get_network(context, port[\u0027network_id\u0027])"},{"line_number":983,"context_line":"            mech_context \u003d None"},{"line_number":984,"context_line":"            if port[\u0027device_owner\u0027] \u003d\u003d const.DEVICE_OWNER_DVR_INTERFACE:"},{"line_number":985,"context_line":"                bindings \u003d db.get_dvr_port_bindings(context.session, id)"},{"line_number":986,"context_line":"                for bind in bindings:"}],"source_content_type":"text/x-python","patch_set":48,"id":"baada198_a7b0fbdc","line":983,"updated":"2014-07-25 22:16:07.000000000","message":"mech_context \u003d []\n\nSee suggestion below.","commit_id":"91fa0d64637b08f410f311918c0bef446bf6bc36"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"2adbc14b46668c2583dfa619bd5b4c9770375752","unresolved":false,"context_lines":[{"line_number":1005,"context_line":"            l3plugin.notify_routers_updated(context, router_ids)"},{"line_number":1006,"context_line":""},{"line_number":1007,"context_line":"        try:"},{"line_number":1008,"context_line":"            # for both normal and DVR Interface ports, only one invocation of"},{"line_number":1009,"context_line":"            # delete_port_postcommit.  We use gather/scatter technique for DVR"},{"line_number":1010,"context_line":"            # interface ports, where the bindings are gathered in"},{"line_number":1011,"context_line":"            # delete_port_precommit() call earlier and scattered as l2pop"}],"source_content_type":"text/x-python","patch_set":48,"id":"baada198_47dc7f18","line":1008,"updated":"2014-07-25 22:16:07.000000000","message":"Suggestion:  Could the bindings be gathered in the context(s) instead of the driver?  That seems a little more natural to me.  I could be wrong, maybe that would be abusing the context class.\n\nmech_context would be a list (L983).  L987 and L991 would append to the list and this code would iterate over the list and call delete_port_postcommit on each.\n\nI think the code in mech_driver.py benefits the most in terms of code complexity from this suggestion.  Also, this note wouldn\u0027t be needed to explain what is going on.","commit_id":"91fa0d64637b08f410f311918c0bef446bf6bc36"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"65d0a788e00f30436e266206d46b69409352c33d","unresolved":false,"context_lines":[{"line_number":1005,"context_line":"            l3plugin.notify_routers_updated(context, router_ids)"},{"line_number":1006,"context_line":""},{"line_number":1007,"context_line":"        try:"},{"line_number":1008,"context_line":"            # for both normal and DVR Interface ports, only one invocation of"},{"line_number":1009,"context_line":"            # delete_port_postcommit.  We use gather/scatter technique for DVR"},{"line_number":1010,"context_line":"            # interface ports, where the bindings are gathered in"},{"line_number":1011,"context_line":"            # delete_port_precommit() call earlier and scattered as l2pop"}],"source_content_type":"text/x-python","patch_set":48,"id":"baada198_93b5f633","line":1008,"in_reply_to":"baada198_47dc7f18","updated":"2014-07-25 23:12:27.000000000","message":"I am experimenting with some ideas like these in the context of this patch:\n\nhttps://review.openstack.org/#/c/109046/\n\nBob and I had an extensive chat about this, I\u0027ll take your inputs going forward.","commit_id":"91fa0d64637b08f410f311918c0bef446bf6bc36"},{"author":{"_account_id":841,"name":"Akihiro Motoki","email":"amotoki@gmail.com","username":"amotoki"},"change_message_id":"bfa43a95c8d2184fa8302b02380711b93e7b9c76","unresolved":false,"context_lines":[{"line_number":253,"context_line":"            binding.vif_details \u003d \u0027\u0027"},{"line_number":254,"context_line":"            binding.driver \u003d None"},{"line_number":255,"context_line":"            binding.segment \u003d None"},{"line_number":256,"context_line":"            binding.host \u003d \u0027\u0027"},{"line_number":257,"context_line":""},{"line_number":258,"context_line":"        self._update_port_dict_binding(port, binding)"},{"line_number":259,"context_line":"        return changes"}],"source_content_type":"text/x-python","patch_set":49,"id":"baada198_712688cc","line":256,"updated":"2014-07-28 05:49:55.000000000","message":"Don\u0027t we need to take care of \"changes\" flag for DVR case?","commit_id":"cd35b1904e1da5e3da0a63b37af34d426e72e933"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"823822388f67e1cdafb463ff1ed494d679b7024b","unresolved":false,"context_lines":[{"line_number":253,"context_line":"            binding.vif_details \u003d \u0027\u0027"},{"line_number":254,"context_line":"            binding.driver \u003d None"},{"line_number":255,"context_line":"            binding.segment \u003d None"},{"line_number":256,"context_line":"            binding.host \u003d \u0027\u0027"},{"line_number":257,"context_line":""},{"line_number":258,"context_line":"        self._update_port_dict_binding(port, binding)"},{"line_number":259,"context_line":"        return changes"}],"source_content_type":"text/x-python","patch_set":49,"id":"baada198_1830f6e7","line":256,"in_reply_to":"baada198_712688cc","updated":"2014-07-28 17:33:53.000000000","message":"this is taken case when the L3 agent determines the actual host binding","commit_id":"cd35b1904e1da5e3da0a63b37af34d426e72e933"}]}
