)]}'
{"neutron/plugins/ml2/drivers/openvswitch/agent/extension_drivers/qos_driver.py":[{"author":{"_account_id":16688,"name":"Rodolfo Alonso","email":"ralonsoh@redhat.com","username":"rodolfo-alonso-hernandez"},"change_message_id":"20078cfd6a0e999e51626927df981f16c3b4cc73","unresolved":false,"context_lines":[{"line_number":34,"context_line":"        self.br_int_name \u003d cfg.CONF.OVS.integration_bridge"},{"line_number":35,"context_line":"        self.br_int \u003d None"},{"line_number":36,"context_line":"        self.agent_api \u003d None"},{"line_number":37,"context_line":"        self.ports \u003d {}"},{"line_number":38,"context_line":""},{"line_number":39,"context_line":"    def consume_api(self, agent_api):"},{"line_number":40,"context_line":"        self.agent_api \u003d agent_api"}],"source_content_type":"text/x-python","patch_set":1,"id":"dada55a8_350f1b30","line":37,"range":{"start_line":37,"start_character":21,"end_line":37,"end_character":23},"updated":"2016-07-22 09:44:57.000000000","message":"Comment in line 81","commit_id":"84c340fa095aff66e8b93a9beb48b801cac0d0b2"},{"author":{"_account_id":16688,"name":"Rodolfo Alonso","email":"ralonsoh@redhat.com","username":"rodolfo-alonso-hernandez"},"change_message_id":"20078cfd6a0e999e51626927df981f16c3b4cc73","unresolved":false,"context_lines":[{"line_number":78,"context_line":"        self.update_dscp_marking(port, rule)"},{"line_number":79,"context_line":""},{"line_number":80,"context_line":"    def update_dscp_marking(self, port, rule):"},{"line_number":81,"context_line":"        self.ports[port[\u0027port_id\u0027]] \u003d self.ports.get(port[\u0027port_id\u0027], {})"},{"line_number":82,"context_line":"        self.ports[port[\u0027port_id\u0027]][qos_consts.RULE_TYPE_DSCP_MARKING] \u003d port"},{"line_number":83,"context_line":"        port_name \u003d port[\u0027vif_port\u0027].port_name"},{"line_number":84,"context_line":"        port \u003d self.br_int.get_port_ofport(port_name)"}],"source_content_type":"text/x-python","patch_set":1,"id":"dada55a8_52010539","line":81,"range":{"start_line":81,"start_character":8,"end_line":81,"end_character":73},"updated":"2016-07-22 09:44:57.000000000","message":"Instead of initialize the dict of dicts in this way, could be better to declare the variable like this:\nself.ports \u003d defaultdict(dict)\n\nso that you can avoid this line.","commit_id":"84c340fa095aff66e8b93a9beb48b801cac0d0b2"},{"author":{"_account_id":16688,"name":"Rodolfo Alonso","email":"ralonsoh@redhat.com","username":"rodolfo-alonso-hernandez"},"change_message_id":"20078cfd6a0e999e51626927df981f16c3b4cc73","unresolved":false,"context_lines":[{"line_number":117,"context_line":"                              RULE_TYPE_DSCP_MARKING][\u0027vif_port\u0027].ofport"},{"line_number":118,"context_line":""},{"line_number":119,"context_line":"        self.br_int.delete_flows(in_port\u003dport_num, table\u003d0, reg2\u003d0)"},{"line_number":120,"context_line":"        self.ports[port[\u0027port_id\u0027]].pop(qos_consts.RULE_TYPE_DSCP_MARKING, 0)"}],"source_content_type":"text/x-python","patch_set":1,"id":"dada55a8_55128f59","line":120,"updated":"2016-07-22 09:44:57.000000000","message":"In this line you are removing an element, taking care of not throwing an exception. But two lines before you read the same index without any protection.\nYou can first pop the element to a variable, with default\u003dNone. If this element is not present, write a warning and don\u0027t execute the \"delete_flows\" command.","commit_id":"84c340fa095aff66e8b93a9beb48b801cac0d0b2"},{"author":{"_account_id":16688,"name":"Rodolfo Alonso","email":"ralonsoh@redhat.com","username":"rodolfo-alonso-hernandez"},"change_message_id":"581fb64b1b1d4a35f326861100701ecd6c5c9671","unresolved":false,"context_lines":[{"line_number":121,"context_line":"            self.br_int.delete_flows(in_port\u003dport_num, table\u003d0, reg2\u003d0)"},{"line_number":122,"context_line":"        else:"},{"line_number":123,"context_line":"            LOG.debug(\"delete_dscp_marking was received for port %s but \""},{"line_number":124,"context_line":"                      \"no port informtion was stored to be deleted\","},{"line_number":125,"context_line":"                      port[\u0027port_id\u0027])"}],"source_content_type":"text/x-python","patch_set":2,"id":"bacf61ea_28a34ba0","line":124,"range":{"start_line":124,"start_character":31,"end_line":124,"end_character":41},"updated":"2016-07-27 15:28:58.000000000","message":"s/informtion/information","commit_id":"464bfa959c4f11c4393b7224de7ee0cbbb89f7cf"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"change_message_id":"ce78ee66a7c21c46e6d07245b1dc736d40007983","unresolved":false,"context_lines":[{"line_number":83,"context_line":"        self.ports[port[\u0027port_id\u0027]][qos_consts.RULE_TYPE_DSCP_MARKING] \u003d port"},{"line_number":84,"context_line":"        vif_port \u003d port.get(\u0027vif_port\u0027)"},{"line_number":85,"context_line":"        if not vif_port:"},{"line_number":86,"context_line":"            port_id \u003d port.get(\u0027port_id\u0027, None)"},{"line_number":87,"context_line":"            LOG.debug(\"update_dscp_marking was received for port %s but \""},{"line_number":88,"context_line":"                      \"vif_port was not found. It seems that port is already \""},{"line_number":89,"context_line":"                      \"deleted\", port_id)"}],"source_content_type":"text/x-python","patch_set":3,"id":"fa7ab95a_e491d99a","line":86,"updated":"2016-08-29 08:47:17.000000000","message":"by default get should return None so you do not specifically need to add this","commit_id":"cf2f0ab2e2b060202527cadd6073312ae6823a12"},{"author":{"_account_id":18051,"name":"David Shaughnessy","email":"david.shaughnessy@intel.com","username":"davidsha"},"change_message_id":"7a68ec0a15fb75971906c20df5689e367cd0e838","unresolved":false,"context_lines":[{"line_number":83,"context_line":"        self.ports[port[\u0027port_id\u0027]][qos_consts.RULE_TYPE_DSCP_MARKING] \u003d port"},{"line_number":84,"context_line":"        vif_port \u003d port.get(\u0027vif_port\u0027)"},{"line_number":85,"context_line":"        if not vif_port:"},{"line_number":86,"context_line":"            port_id \u003d port.get(\u0027port_id\u0027, None)"},{"line_number":87,"context_line":"            LOG.debug(\"update_dscp_marking was received for port %s but \""},{"line_number":88,"context_line":"                      \"vif_port was not found. It seems that port is already \""},{"line_number":89,"context_line":"                      \"deleted\", port_id)"}],"source_content_type":"text/x-python","patch_set":3,"id":"fa7ab95a_3f2aee7e","line":86,"in_reply_to":"fa7ab95a_e491d99a","updated":"2016-08-29 09:00:44.000000000","message":"Done","commit_id":"cf2f0ab2e2b060202527cadd6073312ae6823a12"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"change_message_id":"ce78ee66a7c21c46e6d07245b1dc736d40007983","unresolved":false,"context_lines":[{"line_number":129,"context_line":"        else:"},{"line_number":130,"context_line":"            LOG.debug(\"delete_dscp_marking was received for port %s but \""},{"line_number":131,"context_line":"                      \"no port information was stored to be deleted\","},{"line_number":132,"context_line":"                      port[\u0027port_id\u0027])"}],"source_content_type":"text/x-python","patch_set":3,"id":"fa7ab95a_443b659c","line":132,"updated":"2016-08-29 08:47:17.000000000","message":"will the port always have the port_id here? if so then we are good","commit_id":"cf2f0ab2e2b060202527cadd6073312ae6823a12"},{"author":{"_account_id":18051,"name":"David Shaughnessy","email":"david.shaughnessy@intel.com","username":"davidsha"},"change_message_id":"7a68ec0a15fb75971906c20df5689e367cd0e838","unresolved":false,"context_lines":[{"line_number":129,"context_line":"        else:"},{"line_number":130,"context_line":"            LOG.debug(\"delete_dscp_marking was received for port %s but \""},{"line_number":131,"context_line":"                      \"no port information was stored to be deleted\","},{"line_number":132,"context_line":"                      port[\u0027port_id\u0027])"}],"source_content_type":"text/x-python","patch_set":3,"id":"fa7ab95a_84b80de7","line":132,"in_reply_to":"fa7ab95a_443b659c","updated":"2016-08-29 09:00:44.000000000","message":"Ya, the port_id is the only key available now.","commit_id":"cf2f0ab2e2b060202527cadd6073312ae6823a12"},{"author":{"_account_id":11975,"name":"Slawek Kaplonski","email":"skaplons@redhat.com","username":"slaweq"},"change_message_id":"df27220f01cfa65172a74d463964bbaf7341c241","unresolved":false,"context_lines":[{"line_number":83,"context_line":"        self.ports[port[\u0027port_id\u0027]][qos_consts.RULE_TYPE_DSCP_MARKING] \u003d port"},{"line_number":84,"context_line":"        vif_port \u003d port.get(\u0027vif_port\u0027)"},{"line_number":85,"context_line":"        if not vif_port:"},{"line_number":86,"context_line":"            port_id \u003d port.get(\u0027port_id\u0027, None)"},{"line_number":87,"context_line":"            LOG.debug(\"update_dscp_marking was received for port %s but \""},{"line_number":88,"context_line":"                      \"vif_port was not found. It seems that port is already \""},{"line_number":89,"context_line":"                      \"deleted\", port_id)"}],"source_content_type":"text/x-python","patch_set":4,"id":"fa7ab95a_18dd16e0","line":86,"updated":"2016-08-29 20:08:46.000000000","message":"nit: I think port.get(\u0027port_id\u0027) should be enough here","commit_id":"a55f8162c8bc9cb07565a6727dfaa25338db5f8c"},{"author":{"_account_id":18051,"name":"David Shaughnessy","email":"david.shaughnessy@intel.com","username":"davidsha"},"change_message_id":"5f7013c5d2d0d066d6c147cf07a7b1336723e282","unresolved":false,"context_lines":[{"line_number":83,"context_line":"        self.ports[port[\u0027port_id\u0027]][qos_consts.RULE_TYPE_DSCP_MARKING] \u003d port"},{"line_number":84,"context_line":"        vif_port \u003d port.get(\u0027vif_port\u0027)"},{"line_number":85,"context_line":"        if not vif_port:"},{"line_number":86,"context_line":"            port_id \u003d port.get(\u0027port_id\u0027, None)"},{"line_number":87,"context_line":"            LOG.debug(\"update_dscp_marking was received for port %s but \""},{"line_number":88,"context_line":"                      \"vif_port was not found. It seems that port is already \""},{"line_number":89,"context_line":"                      \"deleted\", port_id)"}],"source_content_type":"text/x-python","patch_set":4,"id":"fa7ab95a_bf37934b","line":86,"in_reply_to":"fa7ab95a_18dd16e0","updated":"2016-08-30 08:57:09.000000000","message":"I thought I removed this... I\u0027ll get onto this now.","commit_id":"a55f8162c8bc9cb07565a6727dfaa25338db5f8c"},{"author":{"_account_id":8788,"name":"Miguel Angel Ajo","email":"mangelajo@redhat.com","username":"mangelajo"},"change_message_id":"3d4d3c96190ecac45285538827f469a818decdf4","unresolved":false,"context_lines":[{"line_number":80,"context_line":"        self.update_dscp_marking(port, rule)"},{"line_number":81,"context_line":""},{"line_number":82,"context_line":"    def update_dscp_marking(self, port, rule):"},{"line_number":83,"context_line":"        self.ports[port[\u0027port_id\u0027]][qos_consts.RULE_TYPE_DSCP_MARKING] \u003d port"},{"line_number":84,"context_line":"        vif_port \u003d port.get(\u0027vif_port\u0027)"},{"line_number":85,"context_line":"        if not vif_port:"},{"line_number":86,"context_line":"            port_id \u003d port.get(\u0027port_id\u0027)"}],"source_content_type":"text/x-python","patch_set":5,"id":"9a89bdaa_95f3eb09","line":83,"updated":"2016-09-12 09:19:09.000000000","message":"I see the value on making this something more generic in QosAgentDriver base, so the ports dict is general, and available to all types of rules. (Without the need to keep per-rule type dictionaries). (the port is popped on port_delete event instead)\n\nBut I\u0027m ok with current implementation if we move to the other when we need the same thing for other rules.","commit_id":"af8ca1bca6657f7152eeb0ca55bc7f3a0aea2301"}]}
