)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":23804,"name":"Daniel Alvarez","email":"dalvarez@redhat.com","username":"dalvarez"},"change_message_id":"fd9469c9a49ccee3bae4fba02023d8c05dff8723","unresolved":false,"context_lines":[{"line_number":18,"context_line":"since we won\u0027t need to cycle the port status anymore on every single"},{"line_number":19,"context_line":"agent restart."},{"line_number":20,"context_line":""},{"line_number":21,"context_line":"Closes-Bug: #1665215"},{"line_number":22,"context_line":"Change-Id: I99c2b77b35e6eabb6e4f633c4e8e2533594c6b55"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":9,"id":"da36d5c6_18063ace","line":21,"range":{"start_line":21,"start_character":0,"end_line":21,"end_character":6},"updated":"2017-02-22 16:46:37.000000000","message":"Partial?\nAlso is also bug 1430999 related o/closed with this patch?","commit_id":"f2255789fe3ab3f8b3a9b2e82b2ee059741db7a3"},{"author":{"_account_id":7787,"name":"Kevin Benton","email":"kevin@benton.pub","username":"blak111"},"change_message_id":"a476e97475d2d68a5296c040f659f9fc311ecab0","unresolved":false,"context_lines":[{"line_number":18,"context_line":"since we won\u0027t need to cycle the port status anymore on every single"},{"line_number":19,"context_line":"agent restart."},{"line_number":20,"context_line":""},{"line_number":21,"context_line":"Closes-Bug: #1665215"},{"line_number":22,"context_line":"Change-Id: I99c2b77b35e6eabb6e4f633c4e8e2533594c6b55"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":9,"id":"da36d5c6_90066c1b","line":21,"range":{"start_line":21,"start_character":0,"end_line":21,"end_character":6},"in_reply_to":"da36d5c6_18063ace","updated":"2017-02-23 03:37:01.000000000","message":"This is the last one in the series for 1665215 so I\u0027d like to mark it as Closes since I don\u0027t imagine anymore for now unless the performance still significantly sucks, in which case you can re-open the bug.\n\nI will leave 1430999 alone for now since that was related to the batching mechanism.","commit_id":"f2255789fe3ab3f8b3a9b2e82b2ee059741db7a3"}],"neutron/plugins/ml2/plugin.py":[{"author":{"_account_id":23804,"name":"Daniel Alvarez","email":"dalvarez@redhat.com","username":"dalvarez"},"change_message_id":"fd9469c9a49ccee3bae4fba02023d8c05dff8723","unresolved":false,"context_lines":[{"line_number":1782,"context_line":"        \"\"\""},{"line_number":1783,"context_line":"        Returns port_id (non-truncated uuid) if the port exists."},{"line_number":1784,"context_line":"        Otherwise returns None."},{"line_number":1785,"context_line":"        \u0027network\u0027 is deprecated and has no effect"},{"line_number":1786,"context_line":"        \"\"\""},{"line_number":1787,"context_line":"        full \u003d self.partial_port_ids_to_full_ids(context, [port_id])"},{"line_number":1788,"context_line":"        if port_id not in full:"}],"source_content_type":"text/x-python","patch_set":9,"id":"da36d5c6_272d9f46","line":1785,"updated":"2017-02-22 16:46:37.000000000","message":"Shouldn\u0027t we remove it then? Seems that the only place in the code where it\u0027s passed is in get_device_details() and tests.","commit_id":"f2255789fe3ab3f8b3a9b2e82b2ee059741db7a3"},{"author":{"_account_id":7787,"name":"Kevin Benton","email":"kevin@benton.pub","username":"blak111"},"change_message_id":"a476e97475d2d68a5296c040f659f9fc311ecab0","unresolved":false,"context_lines":[{"line_number":1782,"context_line":"        \"\"\""},{"line_number":1783,"context_line":"        Returns port_id (non-truncated uuid) if the port exists."},{"line_number":1784,"context_line":"        Otherwise returns None."},{"line_number":1785,"context_line":"        \u0027network\u0027 is deprecated and has no effect"},{"line_number":1786,"context_line":"        \"\"\""},{"line_number":1787,"context_line":"        full \u003d self.partial_port_ids_to_full_ids(context, [port_id])"},{"line_number":1788,"context_line":"        if port_id not in full:"}],"source_content_type":"text/x-python","patch_set":9,"id":"da36d5c6_b06c50d1","line":1785,"in_reply_to":"da36d5c6_272d9f46","updated":"2017-02-23 03:37:01.000000000","message":"No, unfortunately I found an out of tree reference that uses it so that wouldn\u0027t make it safe to back-port. \n\nhttp://git.openstack.org/cgit/openstack/networking-nec/tree/networking_nec/nwa/l2/rpc/ml2_server_callback.py#n97","commit_id":"f2255789fe3ab3f8b3a9b2e82b2ee059741db7a3"},{"author":{"_account_id":7787,"name":"Kevin Benton","email":"kevin@benton.pub","username":"blak111"},"change_message_id":"239719acf89ce7f14734be5134220b6f165c13f9","unresolved":false,"context_lines":[{"line_number":1604,"context_line":"    def update_port_statuses(self, context, port_id_to_status, host\u003dNone):"},{"line_number":1605,"context_line":"        result \u003d {}"},{"line_number":1606,"context_line":"        port_ids \u003d port_id_to_status.keys()"},{"line_number":1607,"context_line":"        port_dbs_by_id \u003d db.get_port_db_objects(context, port_ids)"},{"line_number":1608,"context_line":"        for port_id, status in port_id_to_status.items():"},{"line_number":1609,"context_line":"            if not port_dbs_by_id.get(port_id):"},{"line_number":1610,"context_line":"                LOG.debug(\"Port %(port)s update to %(val)s by agent not found\","}],"source_content_type":"text/x-python","patch_set":18,"id":"3f044301_5c688e1b","line":1607,"updated":"2017-05-12 03:35:18.000000000","message":"Good point. I will need to catch missing record exceptions around _update_individual_port_db_status","commit_id":"11719538e73b7a54af735c921066ec29654d6d7a"},{"author":{"_account_id":4694,"name":"Miguel Lavalle","email":"miguel@mlavalle.com","username":"minsel"},"change_message_id":"47a0376e621a56900033c6f7b642c3f0552f0d81","unresolved":false,"context_lines":[{"line_number":1604,"context_line":"    def update_port_statuses(self, context, port_id_to_status, host\u003dNone):"},{"line_number":1605,"context_line":"        result \u003d {}"},{"line_number":1606,"context_line":"        port_ids \u003d port_id_to_status.keys()"},{"line_number":1607,"context_line":"        port_dbs_by_id \u003d db.get_port_db_objects(context, port_ids)"},{"line_number":1608,"context_line":"        for port_id, status in port_id_to_status.items():"},{"line_number":1609,"context_line":"            if not port_dbs_by_id.get(port_id):"},{"line_number":1610,"context_line":"                LOG.debug(\"Port %(port)s update to %(val)s by agent not found\","}],"source_content_type":"text/x-python","patch_set":18,"id":"5ff73747_0e140e43","line":1607,"updated":"2017-04-27 21:53:02.000000000","message":"I have a concern here (it might be that I need to further my education in the DB layer). In the code that we are changing, we retrieved the port and updated it in the same writer session. In this new implementation, we retrieve all the port db objects in a reader session and then we update each port object with a writer session. Isn\u0027t there a non zero chance that by the time we update the port it might be gone or changed?","commit_id":"11719538e73b7a54af735c921066ec29654d6d7a"},{"author":{"_account_id":7787,"name":"Kevin Benton","email":"kevin@benton.pub","username":"blak111"},"change_message_id":"239719acf89ce7f14734be5134220b6f165c13f9","unresolved":false,"context_lines":[{"line_number":1611,"context_line":"                          {\u0027port\u0027: port_id, \u0027val\u0027: status})"},{"line_number":1612,"context_line":"                result[port_id] \u003d None"},{"line_number":1613,"context_line":"                continue"},{"line_number":1614,"context_line":"            port_db \u003d port_dbs_by_id[port_id]"},{"line_number":1615,"context_line":"            result[port_id] \u003d self._update_individual_port_db_status("},{"line_number":1616,"context_line":"                context, port_db, status, host)"},{"line_number":1617,"context_line":"        return result"}],"source_content_type":"text/x-python","patch_set":18,"id":"3f044301_3c59428d","line":1614,"updated":"2017-05-12 03:35:18.000000000","message":"Ack","commit_id":"11719538e73b7a54af735c921066ec29654d6d7a"},{"author":{"_account_id":4694,"name":"Miguel Lavalle","email":"miguel@mlavalle.com","username":"minsel"},"change_message_id":"47a0376e621a56900033c6f7b642c3f0552f0d81","unresolved":false,"context_lines":[{"line_number":1611,"context_line":"                          {\u0027port\u0027: port_id, \u0027val\u0027: status})"},{"line_number":1612,"context_line":"                result[port_id] \u003d None"},{"line_number":1613,"context_line":"                continue"},{"line_number":1614,"context_line":"            port_db \u003d port_dbs_by_id[port_id]"},{"line_number":1615,"context_line":"            result[port_id] \u003d self._update_individual_port_db_status("},{"line_number":1616,"context_line":"                context, port_db, status, host)"},{"line_number":1617,"context_line":"        return result"}],"source_content_type":"text/x-python","patch_set":18,"id":"5ff73747_0e3d2ec3","line":1614,"updated":"2017-04-27 21:53:02.000000000","message":"Nit: I don\u0027t think this adds much value. I just would pass port_dbs_by_id[port_id] in L1616","commit_id":"11719538e73b7a54af735c921066ec29654d6d7a"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"a484b52ffacd6eb422adde420c2766dbddb5c4ad","unresolved":false,"context_lines":[{"line_number":1605,"context_line":"        \u0027network\u0027 is deprecated and has no effect"},{"line_number":1606,"context_line":"        \"\"\""},{"line_number":1607,"context_line":"        full \u003d db.partial_port_ids_to_full_ids(context, [port_id])"},{"line_number":1608,"context_line":"        if port_id not in full:"},{"line_number":1609,"context_line":"            return None"},{"line_number":1610,"context_line":"        port_id \u003d full[port_id]"},{"line_number":1611,"context_line":"        return self.update_port_statuses("},{"line_number":1612,"context_line":"            context, {port_id: status}, host)[port_id]"},{"line_number":1613,"context_line":""}],"source_content_type":"text/x-python","patch_set":21,"id":"ff0f0b1f_2aff3d68","line":1610,"range":{"start_line":1608,"start_character":0,"end_line":1610,"end_character":31},"updated":"2017-05-27 00:07:10.000000000","message":"style nit:\n\n  port_id \u003d full.get(port_id)\n  if not port_id:\n     return","commit_id":"1be00e8239db3db6e962b30a6b3c2b90144e19b8"},{"author":{"_account_id":7787,"name":"Kevin Benton","email":"kevin@benton.pub","username":"blak111"},"change_message_id":"a7a69ef3120f10b145af4ea8c3588e69e207208a","unresolved":false,"context_lines":[{"line_number":1605,"context_line":"        \u0027network\u0027 is deprecated and has no effect"},{"line_number":1606,"context_line":"        \"\"\""},{"line_number":1607,"context_line":"        full \u003d db.partial_port_ids_to_full_ids(context, [port_id])"},{"line_number":1608,"context_line":"        if port_id not in full:"},{"line_number":1609,"context_line":"            return None"},{"line_number":1610,"context_line":"        port_id \u003d full[port_id]"},{"line_number":1611,"context_line":"        return self.update_port_statuses("},{"line_number":1612,"context_line":"            context, {port_id: status}, host)[port_id]"},{"line_number":1613,"context_line":""}],"source_content_type":"text/x-python","patch_set":21,"id":"ff0f0b1f_4af4b15b","line":1610,"range":{"start_line":1608,"start_character":0,"end_line":1610,"end_character":31},"in_reply_to":"ff0f0b1f_2aff3d68","updated":"2017-05-27 00:18:52.000000000","message":"Will catch if I need to respin","commit_id":"1be00e8239db3db6e962b30a6b3c2b90144e19b8"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"a484b52ffacd6eb422adde420c2766dbddb5c4ad","unresolved":false,"context_lines":[{"line_number":1609,"context_line":"            return None"},{"line_number":1610,"context_line":"        port_id \u003d full[port_id]"},{"line_number":1611,"context_line":"        return self.update_port_statuses("},{"line_number":1612,"context_line":"            context, {port_id: status}, host)[port_id]"},{"line_number":1613,"context_line":""},{"line_number":1614,"context_line":"    @utils.transaction_guard"},{"line_number":1615,"context_line":"    @db_api.retry_if_session_inactive()"}],"source_content_type":"text/x-python","patch_set":21,"id":"ff0f0b1f_eaf8257d","line":1612,"updated":"2017-05-27 00:07:10.000000000","message":"are you guaranteed that update_port_statues will always return a non empty dict at this point?","commit_id":"1be00e8239db3db6e962b30a6b3c2b90144e19b8"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"3be82c7dd5a0248ca9d19217a7190df2ea38d52a","unresolved":false,"context_lines":[{"line_number":1609,"context_line":"            return None"},{"line_number":1610,"context_line":"        port_id \u003d full[port_id]"},{"line_number":1611,"context_line":"        return self.update_port_statuses("},{"line_number":1612,"context_line":"            context, {port_id: status}, host)[port_id]"},{"line_number":1613,"context_line":""},{"line_number":1614,"context_line":"    @utils.transaction_guard"},{"line_number":1615,"context_line":"    @db_api.retry_if_session_inactive()"}],"source_content_type":"text/x-python","patch_set":21,"id":"df140735_56a36550","line":1612,"in_reply_to":"df140735_9609fdde","updated":"2017-05-29 02:59:03.000000000","message":"oh, I misread confused port_id_to_status with port_dbs_by_id, hence I freaked. Those variable names can get readers wires crossed, and I only noticed that now.","commit_id":"1be00e8239db3db6e962b30a6b3c2b90144e19b8"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"7b5d953454b44554be59a9dbd11437682c336660","unresolved":false,"context_lines":[{"line_number":1609,"context_line":"            return None"},{"line_number":1610,"context_line":"        port_id \u003d full[port_id]"},{"line_number":1611,"context_line":"        return self.update_port_statuses("},{"line_number":1612,"context_line":"            context, {port_id: status}, host)[port_id]"},{"line_number":1613,"context_line":""},{"line_number":1614,"context_line":"    @utils.transaction_guard"},{"line_number":1615,"context_line":"    @db_api.retry_if_session_inactive()"}],"source_content_type":"text/x-python","patch_set":21,"id":"ff0f0b1f_eab0258e","line":1612,"in_reply_to":"ff0f0b1f_6aef7587","updated":"2017-05-27 00:24:41.000000000","message":"Not if we don\u0027t ever get into the for loop, are you saying that we always get into the loop? There\u0027s really no added test coverage for me to clearly see this is the expected behavior.","commit_id":"1be00e8239db3db6e962b30a6b3c2b90144e19b8"},{"author":{"_account_id":7787,"name":"Kevin Benton","email":"kevin@benton.pub","username":"blak111"},"change_message_id":"232c659e9b2e7902c7bd0a7a0bda95b7820f4c2e","unresolved":false,"context_lines":[{"line_number":1609,"context_line":"            return None"},{"line_number":1610,"context_line":"        port_id \u003d full[port_id]"},{"line_number":1611,"context_line":"        return self.update_port_statuses("},{"line_number":1612,"context_line":"            context, {port_id: status}, host)[port_id]"},{"line_number":1613,"context_line":""},{"line_number":1614,"context_line":"    @utils.transaction_guard"},{"line_number":1615,"context_line":"    @db_api.retry_if_session_inactive()"}],"source_content_type":"text/x-python","patch_set":21,"id":"df140735_9609fdde","line":1612,"in_reply_to":"ff0f0b1f_eab0258e","updated":"2017-05-29 01:59:01.000000000","message":"Yes, there is no early return in update_port_statuses so there is no way to avoid the for loop.\n\nAll of the existing coverage for update_port_status covers this use case (updating a single port).\n\nYou\u0027re right that I didn\u0027t add UT coverage for multiple ports, which I can certainly add. But I\u0027m not sure if that will prove anything more about this code path (updating a single port).\n\nWhat coverage would help prove that there is no early return between L1617 and L1628?","commit_id":"1be00e8239db3db6e962b30a6b3c2b90144e19b8"},{"author":{"_account_id":7787,"name":"Kevin Benton","email":"kevin@benton.pub","username":"blak111"},"change_message_id":"a7a69ef3120f10b145af4ea8c3588e69e207208a","unresolved":false,"context_lines":[{"line_number":1609,"context_line":"            return None"},{"line_number":1610,"context_line":"        port_id \u003d full[port_id]"},{"line_number":1611,"context_line":"        return self.update_port_statuses("},{"line_number":1612,"context_line":"            context, {port_id: status}, host)[port_id]"},{"line_number":1613,"context_line":""},{"line_number":1614,"context_line":"    @utils.transaction_guard"},{"line_number":1615,"context_line":"    @db_api.retry_if_session_inactive()"}],"source_content_type":"text/x-python","patch_set":21,"id":"ff0f0b1f_6aef7587","line":1612,"in_reply_to":"ff0f0b1f_eaf8257d","updated":"2017-05-27 00:18:52.000000000","message":"Yes. update_port_statuses creates a key for every ID in this port_id_to_status_map we pass in.","commit_id":"1be00e8239db3db6e962b30a6b3c2b90144e19b8"},{"author":{"_account_id":16688,"name":"Rodolfo Alonso","email":"ralonsoh@redhat.com","username":"rodolfo-alonso-hernandez"},"change_message_id":"53b310ea2c0ef78851883253c03f5d8b51b30be0","unresolved":false,"context_lines":[{"line_number":1636,"context_line":"        except Exception:"},{"line_number":1637,"context_line":"            with excutils.save_and_reraise_exception() as ectx:"},{"line_number":1638,"context_line":"                # don\u0027t reraise if port doesn\u0027t exist anymore"},{"line_number":1639,"context_line":"                ectx.reraise \u003d bool(db.get_port(context, port_id))"},{"line_number":1640,"context_line":""},{"line_number":1641,"context_line":"    def _update_individual_port_db_status(self, context, port, status, host):"},{"line_number":1642,"context_line":"        updated \u003d False"}],"source_content_type":"text/x-python","patch_set":21,"id":"ff0f0b1f_98e6a344","line":1639,"range":{"start_line":1639,"start_character":36,"end_line":1639,"end_character":65},"updated":"2017-05-18 16:51:58.000000000","message":"I don\u0027t know if this could be a problem.\n\ndb.get_port will raise an exception if the port doesn\u0027t exist [1][2].\n\nSo this can collide with comment in L1638.\n\n[1] https://github.com/openstack/neutron/blob/master/neutron/db/db_base_plugin_v2.py#L1361\n[2] https://github.com/openstack/neutron/blob/master/neutron/db/db_base_plugin_common.py#L219","commit_id":"1be00e8239db3db6e962b30a6b3c2b90144e19b8"},{"author":{"_account_id":7787,"name":"Kevin Benton","email":"kevin@benton.pub","username":"blak111"},"change_message_id":"8dfd77deec75af0dc594864788fa37242cd207ac","unresolved":false,"context_lines":[{"line_number":1636,"context_line":"        except Exception:"},{"line_number":1637,"context_line":"            with excutils.save_and_reraise_exception() as ectx:"},{"line_number":1638,"context_line":"                # don\u0027t reraise if port doesn\u0027t exist anymore"},{"line_number":1639,"context_line":"                ectx.reraise \u003d bool(db.get_port(context, port_id))"},{"line_number":1640,"context_line":""},{"line_number":1641,"context_line":"    def _update_individual_port_db_status(self, context, port, status, host):"},{"line_number":1642,"context_line":"        updated \u003d False"}],"source_content_type":"text/x-python","patch_set":21,"id":"ff0f0b1f_d074e79b","line":1639,"updated":"2017-05-19 00:12:24.000000000","message":"db.get_port isn\u0027t the same thing as core plugin get_port.\n\nThis one returns None on missing records: https://github.com/openstack/neutron/blob/master/neutron/plugins/ml2/db.py#L154","commit_id":"1be00e8239db3db6e962b30a6b3c2b90144e19b8"},{"author":{"_account_id":16688,"name":"Rodolfo Alonso","email":"ralonsoh@redhat.com","username":"rodolfo-alonso-hernandez"},"change_message_id":"610b56d1599eb4dd56a2b78ef3f4331e451d1361","unresolved":false,"context_lines":[{"line_number":1636,"context_line":"        except Exception:"},{"line_number":1637,"context_line":"            with excutils.save_and_reraise_exception() as ectx:"},{"line_number":1638,"context_line":"                # don\u0027t reraise if port doesn\u0027t exist anymore"},{"line_number":1639,"context_line":"                ectx.reraise \u003d bool(db.get_port(context, port_id))"},{"line_number":1640,"context_line":""},{"line_number":1641,"context_line":"    def _update_individual_port_db_status(self, context, port, status, host):"},{"line_number":1642,"context_line":"        updated \u003d False"}],"source_content_type":"text/x-python","patch_set":21,"id":"ff0f0b1f_ec05ccc3","line":1639,"in_reply_to":"ff0f0b1f_d074e79b","updated":"2017-05-19 08:16:08.000000000","message":"You are right!","commit_id":"1be00e8239db3db6e962b30a6b3c2b90144e19b8"}],"neutron/plugins/ml2/rpc.py":[{"author":{"_account_id":23804,"name":"Daniel Alvarez","email":"dalvarez@redhat.com","username":"dalvarez"},"change_message_id":"fd9469c9a49ccee3bae4fba02023d8c05dff8723","unresolved":false,"context_lines":[{"line_number":193,"context_line":"        try:"},{"line_number":194,"context_line":"            plugin.update_port_statuses(rpc_context, new_status_map, host)"},{"line_number":195,"context_line":"        except Exception:"},{"line_number":196,"context_line":"            LOG.exception(_LE(\"Failure updating statuses, retring all\"))"},{"line_number":197,"context_line":"            failed_devices \u003d devices_to_fetch"},{"line_number":198,"context_line":"            devices \u003d []"},{"line_number":199,"context_line":""}],"source_content_type":"text/x-python","patch_set":9,"id":"da36d5c6_c7f4c388","line":196,"range":{"start_line":196,"start_character":58,"end_line":196,"end_character":65},"updated":"2017-02-22 16:46:37.000000000","message":"nit: retrying","commit_id":"f2255789fe3ab3f8b3a9b2e82b2ee059741db7a3"},{"author":{"_account_id":7787,"name":"Kevin Benton","email":"kevin@benton.pub","username":"blak111"},"change_message_id":"a476e97475d2d68a5296c040f659f9fc311ecab0","unresolved":false,"context_lines":[{"line_number":193,"context_line":"        try:"},{"line_number":194,"context_line":"            plugin.update_port_statuses(rpc_context, new_status_map, host)"},{"line_number":195,"context_line":"        except Exception:"},{"line_number":196,"context_line":"            LOG.exception(_LE(\"Failure updating statuses, retring all\"))"},{"line_number":197,"context_line":"            failed_devices \u003d devices_to_fetch"},{"line_number":198,"context_line":"            devices \u003d []"},{"line_number":199,"context_line":""}],"source_content_type":"text/x-python","patch_set":9,"id":"da36d5c6_d071c4a9","line":196,"range":{"start_line":196,"start_character":58,"end_line":196,"end_character":65},"in_reply_to":"da36d5c6_c7f4c388","updated":"2017-02-23 03:37:01.000000000","message":"Done","commit_id":"f2255789fe3ab3f8b3a9b2e82b2ee059741db7a3"},{"author":{"_account_id":7787,"name":"Kevin Benton","email":"kevin@benton.pub","username":"blak111"},"change_message_id":"3055804beed506a5d1cebf36ab7715eb3e122b49","unresolved":false,"context_lines":[{"line_number":60,"context_line":""},{"line_number":61,"context_line":"    def _get_new_status(self, host, port_context):"},{"line_number":62,"context_line":"        port \u003d port_context.current"},{"line_number":63,"context_line":"        if (not host or host \u003d\u003d port_context.host):"},{"line_number":64,"context_line":"            new_status \u003d (n_const.PORT_STATUS_BUILD if port[\u0027admin_state_up\u0027]"},{"line_number":65,"context_line":"                          else n_const.PORT_STATUS_DOWN)"},{"line_number":66,"context_line":"            if port[\u0027status\u0027] !\u003d new_status:"}],"source_content_type":"text/x-python","patch_set":16,"id":"7ffa3b31_94326a5d","line":63,"updated":"2017-04-20 21:12:22.000000000","message":"done","commit_id":"a59a8991c65a2ed67f85128cea71abf6af2d05b2"},{"author":{"_account_id":16688,"name":"Rodolfo Alonso","email":"ralonsoh@redhat.com","username":"rodolfo-alonso-hernandez"},"change_message_id":"ef95b4a5c11f842a104ce45ad20617d3d5252a09","unresolved":false,"context_lines":[{"line_number":60,"context_line":""},{"line_number":61,"context_line":"    def _get_new_status(self, host, port_context):"},{"line_number":62,"context_line":"        port \u003d port_context.current"},{"line_number":63,"context_line":"        if (not host or host \u003d\u003d port_context.host):"},{"line_number":64,"context_line":"            new_status \u003d (n_const.PORT_STATUS_BUILD if port[\u0027admin_state_up\u0027]"},{"line_number":65,"context_line":"                          else n_const.PORT_STATUS_DOWN)"},{"line_number":66,"context_line":"            if port[\u0027status\u0027] !\u003d new_status:"}],"source_content_type":"text/x-python","patch_set":16,"id":"7ffa3b31_6cda834b","line":63,"range":{"start_line":63,"start_character":11,"end_line":63,"end_character":12},"updated":"2017-04-20 14:54:41.000000000","message":"nit: parenthesis is not needed","commit_id":"a59a8991c65a2ed67f85128cea71abf6af2d05b2"},{"author":{"_account_id":7787,"name":"Kevin Benton","email":"kevin@benton.pub","username":"blak111"},"change_message_id":"3055804beed506a5d1cebf36ab7715eb3e122b49","unresolved":false,"context_lines":[{"line_number":102,"context_line":"        if \u0027network_id\u0027 in result:"},{"line_number":103,"context_line":"            # success so we update status"},{"line_number":104,"context_line":"            new_status \u003d self._get_new_status(host, port_context)"},{"line_number":105,"context_line":"            if new_status is not None:"},{"line_number":106,"context_line":"                plugin.update_port_status(rpc_context,"},{"line_number":107,"context_line":"                                          port_id,"},{"line_number":108,"context_line":"                                          new_status,"}],"source_content_type":"text/x-python","patch_set":16,"id":"7ffa3b31_7437de4e","line":105,"updated":"2017-04-20 21:12:22.000000000","message":"done","commit_id":"a59a8991c65a2ed67f85128cea71abf6af2d05b2"},{"author":{"_account_id":16688,"name":"Rodolfo Alonso","email":"ralonsoh@redhat.com","username":"rodolfo-alonso-hernandez"},"change_message_id":"ef95b4a5c11f842a104ce45ad20617d3d5252a09","unresolved":false,"context_lines":[{"line_number":102,"context_line":"        if \u0027network_id\u0027 in result:"},{"line_number":103,"context_line":"            # success so we update status"},{"line_number":104,"context_line":"            new_status \u003d self._get_new_status(host, port_context)"},{"line_number":105,"context_line":"            if new_status is not None:"},{"line_number":106,"context_line":"                plugin.update_port_status(rpc_context,"},{"line_number":107,"context_line":"                                          port_id,"},{"line_number":108,"context_line":"                                          new_status,"}],"source_content_type":"text/x-python","patch_set":16,"id":"7ffa3b31_0702b83d","line":105,"range":{"start_line":105,"start_character":12,"end_line":105,"end_character":37},"updated":"2017-04-20 14:54:41.000000000","message":"nit, this could be just:\n\n   if new_status:","commit_id":"a59a8991c65a2ed67f85128cea71abf6af2d05b2"},{"author":{"_account_id":7787,"name":"Kevin Benton","email":"kevin@benton.pub","username":"blak111"},"change_message_id":"3055804beed506a5d1cebf36ab7715eb3e122b49","unresolved":false,"context_lines":[{"line_number":193,"context_line":"        new_status_map \u003d {}"},{"line_number":194,"context_line":"        for ctxt in bound_contexts.values():"},{"line_number":195,"context_line":"            if not ctxt:"},{"line_number":196,"context_line":"                continue"},{"line_number":197,"context_line":"            new_status \u003d self._get_new_status(host, ctxt)"},{"line_number":198,"context_line":"            if not new_status:"},{"line_number":199,"context_line":"                continue"}],"source_content_type":"text/x-python","patch_set":16,"id":"7ffa3b31_544062a5","line":196,"updated":"2017-04-20 21:12:22.000000000","message":"Done","commit_id":"a59a8991c65a2ed67f85128cea71abf6af2d05b2"},{"author":{"_account_id":16688,"name":"Rodolfo Alonso","email":"ralonsoh@redhat.com","username":"rodolfo-alonso-hernandez"},"change_message_id":"ef95b4a5c11f842a104ce45ad20617d3d5252a09","unresolved":false,"context_lines":[{"line_number":191,"context_line":"                failed_devices.append(device)"},{"line_number":192,"context_line":"        host \u003d kwargs.get(\u0027host\u0027)"},{"line_number":193,"context_line":"        new_status_map \u003d {}"},{"line_number":194,"context_line":"        for ctxt in bound_contexts.values():"},{"line_number":195,"context_line":"            if not ctxt:"},{"line_number":196,"context_line":"                continue"},{"line_number":197,"context_line":"            new_status \u003d self._get_new_status(host, ctxt)"},{"line_number":198,"context_line":"            if not new_status:"},{"line_number":199,"context_line":"                continue"}],"source_content_type":"text/x-python","patch_set":16,"id":"7ffa3b31_b960ccd0","line":196,"range":{"start_line":194,"start_character":8,"end_line":196,"end_character":24},"updated":"2017-04-20 14:54:41.000000000","message":"nit:\n\nfor ctxt in (ctxt for ctxt in bound_contexts.values() if ctxt):","commit_id":"a59a8991c65a2ed67f85128cea71abf6af2d05b2"},{"author":{"_account_id":7787,"name":"Kevin Benton","email":"kevin@benton.pub","username":"blak111"},"change_message_id":"3055804beed506a5d1cebf36ab7715eb3e122b49","unresolved":false,"context_lines":[{"line_number":201,"context_line":"        try:"},{"line_number":202,"context_line":"            plugin.update_port_statuses(rpc_context, new_status_map, host)"},{"line_number":203,"context_line":"        except Exception:"},{"line_number":204,"context_line":"            LOG.exception(_LE(\"Failure updating statuses, retrying all\"))"},{"line_number":205,"context_line":"            failed_devices \u003d devices_to_fetch"},{"line_number":206,"context_line":"            devices \u003d []"},{"line_number":207,"context_line":""}],"source_content_type":"text/x-python","patch_set":16,"id":"7ffa3b31_343dd62a","line":204,"updated":"2017-04-20 21:12:22.000000000","message":"Nope, good catch","commit_id":"a59a8991c65a2ed67f85128cea71abf6af2d05b2"},{"author":{"_account_id":16688,"name":"Rodolfo Alonso","email":"ralonsoh@redhat.com","username":"rodolfo-alonso-hernandez"},"change_message_id":"ef95b4a5c11f842a104ce45ad20617d3d5252a09","unresolved":false,"context_lines":[{"line_number":201,"context_line":"        try:"},{"line_number":202,"context_line":"            plugin.update_port_statuses(rpc_context, new_status_map, host)"},{"line_number":203,"context_line":"        except Exception:"},{"line_number":204,"context_line":"            LOG.exception(_LE(\"Failure updating statuses, retrying all\"))"},{"line_number":205,"context_line":"            failed_devices \u003d devices_to_fetch"},{"line_number":206,"context_line":"            devices \u003d []"},{"line_number":207,"context_line":""}],"source_content_type":"text/x-python","patch_set":16,"id":"7ffa3b31_598ae869","line":204,"range":{"start_line":204,"start_character":26,"end_line":204,"end_character":29},"updated":"2017-04-20 14:54:41.000000000","message":"Should we translate this?","commit_id":"a59a8991c65a2ed67f85128cea71abf6af2d05b2"}]}
