)]}'
{"/PATCHSET_LEVEL":[{"author":{"_account_id":9531,"name":"liuyulong","display_name":"LIU Yulong","email":"i@liuyulong.me","username":"LIU-Yulong"},"change_message_id":"58ac9d9266f749ffed2638a6f87cf2fabd61eefc","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":3,"id":"0ca6517f_0d14b51a","updated":"2021-11-11 01:13:04.000000000","message":"recheck","commit_id":"a68d581da0568ebb9edea5b4eab11ebff7819e19"},{"author":{"_account_id":9531,"name":"liuyulong","display_name":"LIU Yulong","email":"i@liuyulong.me","username":"LIU-Yulong"},"change_message_id":"ddaf59c683ee09fd6b6533d0f4b4ea1f16215411","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":3,"id":"8ec8e1ff_8bc216e1","updated":"2021-11-10 01:21:56.000000000","message":"recheck","commit_id":"a68d581da0568ebb9edea5b4eab11ebff7819e19"},{"author":{"_account_id":9531,"name":"liuyulong","display_name":"LIU Yulong","email":"i@liuyulong.me","username":"LIU-Yulong"},"change_message_id":"36ea44dd216dfa18e6f3b63c6f6884a75ee5565e","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":5,"id":"4d4e5a23_4c82054b","updated":"2021-11-29 01:04:21.000000000","message":"recheck","commit_id":"85defc0a626dea719a1edbfd8c27b030789c9b45"},{"author":{"_account_id":11975,"name":"Slawek Kaplonski","email":"skaplons@redhat.com","username":"slaweq"},"change_message_id":"f863c63a8214848905fd337daea8fbadcad11b44","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":6,"id":"7912e07c_83ee4c34","updated":"2022-02-22 20:52:29.000000000","message":"Looks ok but I would like also Rodolfo to check it","commit_id":"7225d82a538e0f903882391fb0f9a571e4380190"},{"author":{"_account_id":11975,"name":"Slawek Kaplonski","email":"skaplons@redhat.com","username":"slaweq"},"change_message_id":"b2d67573bc587286966b95d7a4ff53b0e8d33728","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":8,"id":"fd447e71_70c26ff3","updated":"2022-03-01 14:02:37.000000000","message":"As we missed feature freeze deadline for Yoga, I think we should hold this patch until master will be opened for Zed release. So temporary -1 only for that","commit_id":"fde870ec2cd755e8f9bcf5787928fecf7e83b0ba"},{"author":{"_account_id":9531,"name":"liuyulong","display_name":"LIU Yulong","email":"i@liuyulong.me","username":"LIU-Yulong"},"change_message_id":"1bb7977d36c5276ac55df957c58de21bacb5a530","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":8,"id":"91587aa5_c3f908a9","updated":"2022-02-28 06:41:22.000000000","message":"recheck","commit_id":"fde870ec2cd755e8f9bcf5787928fecf7e83b0ba"},{"author":{"_account_id":8313,"name":"Lajos Katona","display_name":"lajoskatona","email":"katonalala@gmail.com","username":"elajkat","status":"Ericsson Software Technology"},"change_message_id":"2a6f60b585eb10653ee50881dff58424945815c8","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":15,"id":"6cd71da0_39b7ae69","updated":"2022-04-25 07:47:52.000000000","message":"Looks ok, I try to allocate time to test it in my env","commit_id":"76da3eb6c9fb882783af1d1386145db33f97ef0c"},{"author":{"_account_id":9531,"name":"liuyulong","display_name":"LIU Yulong","email":"i@liuyulong.me","username":"LIU-Yulong"},"change_message_id":"3aa81885c6189dbc83e1f5c94adf53e30dea9bee","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":16,"id":"fbcbc836_3880242d","updated":"2022-05-26 15:52:34.000000000","message":"++","commit_id":"0232ead2c33eccc2ccd67f96a12381f2ce7fb470"}],"neutron/agent/common/ovs_lib.py":[{"author":{"_account_id":5948,"name":"Oleg Bondarev","email":"obondarev@mirantis.com","username":"obondarev"},"change_message_id":"c11c54cf436f89af848dfa3c00c7aba9e270193e","unresolved":true,"context_lines":[{"line_number":681,"context_line":""},{"line_number":682,"context_line":"    def get_port_tag_by_name(self, port_name):"},{"line_number":683,"context_line":""},{"line_number":684,"context_line":"        ports \u003d self.ovsdb.db_find("},{"line_number":685,"context_line":"            \u0027Port\u0027, (\u0027name\u0027, \u0027\u003d\u0027, port_name),"},{"line_number":686,"context_line":"            columns\u003d[\u0027name\u0027, \u0027tag\u0027]).execute()"},{"line_number":687,"context_line":"        for p in ports:"},{"line_number":688,"context_line":"            if p[\u0027name\u0027] \u003d\u003d port_name:"},{"line_number":689,"context_line":"                return p[\u0027tag\u0027]"},{"line_number":690,"context_line":""},{"line_number":691,"context_line":"    def get_vifs_by_ids(self, port_ids):"},{"line_number":692,"context_line":"        interface_info \u003d self.get_ports_attributes("},{"line_number":693,"context_line":"            \"Interface\", columns\u003d[\"name\", \"external_ids\", \"ofport\"],"}],"source_content_type":"text/x-python","patch_set":3,"id":"634970d9_387ceb2c","line":690,"range":{"start_line":684,"start_character":7,"end_line":690,"end_character":0},"updated":"2021-11-11 07:43:40.000000000","message":"why not \n \"tag \u003d self.db_get_val(\u0027Port\u0027, port_name, \u0027tag\u0027)\"\n?\nlike done at #1212","commit_id":"a68d581da0568ebb9edea5b4eab11ebff7819e19"},{"author":{"_account_id":9531,"name":"liuyulong","display_name":"LIU Yulong","email":"i@liuyulong.me","username":"LIU-Yulong"},"change_message_id":"7fefd47cf9642b745adf51e95ac1d24c8f53dee5","unresolved":false,"context_lines":[{"line_number":681,"context_line":""},{"line_number":682,"context_line":"    def get_port_tag_by_name(self, port_name):"},{"line_number":683,"context_line":""},{"line_number":684,"context_line":"        ports \u003d self.ovsdb.db_find("},{"line_number":685,"context_line":"            \u0027Port\u0027, (\u0027name\u0027, \u0027\u003d\u0027, port_name),"},{"line_number":686,"context_line":"            columns\u003d[\u0027name\u0027, \u0027tag\u0027]).execute()"},{"line_number":687,"context_line":"        for p in ports:"},{"line_number":688,"context_line":"            if p[\u0027name\u0027] \u003d\u003d port_name:"},{"line_number":689,"context_line":"                return p[\u0027tag\u0027]"},{"line_number":690,"context_line":""},{"line_number":691,"context_line":"    def get_vifs_by_ids(self, port_ids):"},{"line_number":692,"context_line":"        interface_info \u003d self.get_ports_attributes("},{"line_number":693,"context_line":"            \"Interface\", columns\u003d[\"name\", \"external_ids\", \"ofport\"],"}],"source_content_type":"text/x-python","patch_set":3,"id":"c6f7867a_6bedb8fc","line":690,"range":{"start_line":684,"start_character":7,"end_line":690,"end_character":0},"in_reply_to":"634970d9_387ceb2c","updated":"2021-11-12 02:52:28.000000000","message":"Done","commit_id":"a68d581da0568ebb9edea5b4eab11ebff7819e19"},{"author":{"_account_id":5948,"name":"Oleg Bondarev","email":"obondarev@mirantis.com","username":"obondarev"},"change_message_id":"bc94fe59beee86c94f3fef529ebb3fd180ab558d","unresolved":true,"context_lines":[{"line_number":1217,"context_line":"            raise ovs_exc.OVSDBPortNotFound(port\u003dport_name)"},{"line_number":1218,"context_line":""},{"line_number":1219,"context_line":"    def set_value_to_other_config(self, port_name, key, value):"},{"line_number":1220,"context_line":"        other_config \u003d self.db_get_val("},{"line_number":1221,"context_line":"            \u0027Port\u0027, port_name, \u0027other_config\u0027)"},{"line_number":1222,"context_line":"        other_config[key] \u003d str(value)"},{"line_number":1223,"context_line":"        # set_db_attribute does not work"},{"line_number":1224,"context_line":"        with self.ovsdb.transaction() as txn:"}],"source_content_type":"text/x-python","patch_set":4,"id":"d55bd27d_4dbc98e4","line":1221,"range":{"start_line":1220,"start_character":8,"end_line":1221,"end_character":46},"updated":"2021-11-12 07:52:21.000000000","message":"seems should be also covered with try/except","commit_id":"d8bd9923710dd5003174834da6e42e6b44228ef7"},{"author":{"_account_id":9531,"name":"liuyulong","display_name":"LIU Yulong","email":"i@liuyulong.me","username":"LIU-Yulong"},"change_message_id":"866a101cae59c8e1d78e494a2d828c7e72142d07","unresolved":true,"context_lines":[{"line_number":1217,"context_line":"            raise ovs_exc.OVSDBPortNotFound(port\u003dport_name)"},{"line_number":1218,"context_line":""},{"line_number":1219,"context_line":"    def set_value_to_other_config(self, port_name, key, value):"},{"line_number":1220,"context_line":"        other_config \u003d self.db_get_val("},{"line_number":1221,"context_line":"            \u0027Port\u0027, port_name, \u0027other_config\u0027)"},{"line_number":1222,"context_line":"        other_config[key] \u003d str(value)"},{"line_number":1223,"context_line":"        # set_db_attribute does not work"},{"line_number":1224,"context_line":"        with self.ovsdb.transaction() as txn:"}],"source_content_type":"text/x-python","patch_set":4,"id":"38e6303c_1b865826","line":1221,"range":{"start_line":1220,"start_character":8,"end_line":1221,"end_character":46},"in_reply_to":"17beeb22_9f9ca336","updated":"2021-11-25 05:19:53.000000000","message":"Thanks, renamed.","commit_id":"d8bd9923710dd5003174834da6e42e6b44228ef7"},{"author":{"_account_id":9531,"name":"liuyulong","display_name":"LIU Yulong","email":"i@liuyulong.me","username":"LIU-Yulong"},"change_message_id":"984b6d3ee20311f1cd2f846dc34bc865065df35e","unresolved":false,"context_lines":[{"line_number":1217,"context_line":"            raise ovs_exc.OVSDBPortNotFound(port\u003dport_name)"},{"line_number":1218,"context_line":""},{"line_number":1219,"context_line":"    def set_value_to_other_config(self, port_name, key, value):"},{"line_number":1220,"context_line":"        other_config \u003d self.db_get_val("},{"line_number":1221,"context_line":"            \u0027Port\u0027, port_name, \u0027other_config\u0027)"},{"line_number":1222,"context_line":"        other_config[key] \u003d str(value)"},{"line_number":1223,"context_line":"        # set_db_attribute does not work"},{"line_number":1224,"context_line":"        with self.ovsdb.transaction() as txn:"}],"source_content_type":"text/x-python","patch_set":4,"id":"9263362a_32cd9239","line":1221,"range":{"start_line":1220,"start_character":8,"end_line":1221,"end_character":46},"in_reply_to":"38e6303c_1b865826","updated":"2022-02-09 14:34:16.000000000","message":"Done","commit_id":"d8bd9923710dd5003174834da6e42e6b44228ef7"},{"author":{"_account_id":9531,"name":"liuyulong","display_name":"LIU Yulong","email":"i@liuyulong.me","username":"LIU-Yulong"},"change_message_id":"b22a445ed25faa716a2be925fb1fc92317a3b34f","unresolved":true,"context_lines":[{"line_number":1217,"context_line":"            raise ovs_exc.OVSDBPortNotFound(port\u003dport_name)"},{"line_number":1218,"context_line":""},{"line_number":1219,"context_line":"    def set_value_to_other_config(self, port_name, key, value):"},{"line_number":1220,"context_line":"        other_config \u003d self.db_get_val("},{"line_number":1221,"context_line":"            \u0027Port\u0027, port_name, \u0027other_config\u0027)"},{"line_number":1222,"context_line":"        other_config[key] \u003d str(value)"},{"line_number":1223,"context_line":"        # set_db_attribute does not work"},{"line_number":1224,"context_line":"        with self.ovsdb.transaction() as txn:"}],"source_content_type":"text/x-python","patch_set":4,"id":"e05ea665_3ec1782b","line":1221,"range":{"start_line":1220,"start_character":8,"end_line":1221,"end_character":46},"in_reply_to":"d55bd27d_4dbc98e4","updated":"2021-11-13 07:59:48.000000000","message":"try-catch is for type casting. And all ports have other_config.","commit_id":"d8bd9923710dd5003174834da6e42e6b44228ef7"},{"author":{"_account_id":5948,"name":"Oleg Bondarev","email":"obondarev@mirantis.com","username":"obondarev"},"change_message_id":"1adf4828810b06ab43f82b79ec77faedf7534ab9","unresolved":true,"context_lines":[{"line_number":1217,"context_line":"            raise ovs_exc.OVSDBPortNotFound(port\u003dport_name)"},{"line_number":1218,"context_line":""},{"line_number":1219,"context_line":"    def set_value_to_other_config(self, port_name, key, value):"},{"line_number":1220,"context_line":"        other_config \u003d self.db_get_val("},{"line_number":1221,"context_line":"            \u0027Port\u0027, port_name, \u0027other_config\u0027)"},{"line_number":1222,"context_line":"        other_config[key] \u003d str(value)"},{"line_number":1223,"context_line":"        # set_db_attribute does not work"},{"line_number":1224,"context_line":"        with self.ovsdb.transaction() as txn:"}],"source_content_type":"text/x-python","patch_set":4,"id":"17beeb22_9f9ca336","line":1221,"range":{"start_line":1220,"start_character":8,"end_line":1221,"end_character":46},"in_reply_to":"e05ea665_3ec1782b","updated":"2021-11-15 06:29:43.000000000","message":"I thought it handles port not found, according to exc name and message (OVSDBPortNotFound) - should it be changed then?","commit_id":"d8bd9923710dd5003174834da6e42e6b44228ef7"},{"author":{"_account_id":5948,"name":"Oleg Bondarev","email":"obondarev@mirantis.com","username":"obondarev"},"change_message_id":"bc94fe59beee86c94f3fef529ebb3fd180ab558d","unresolved":true,"context_lines":[{"line_number":1227,"context_line":"                                  (\u0027other_config\u0027, other_config)))"},{"line_number":1228,"context_line":""},{"line_number":1229,"context_line":"    def remove_value_from_other_config(self, port_name, key):"},{"line_number":1230,"context_line":"        other_config \u003d self.db_get_val("},{"line_number":1231,"context_line":"            \u0027Port\u0027, port_name, \u0027other_config\u0027)"},{"line_number":1232,"context_line":"        other_config.pop(key, None)"},{"line_number":1233,"context_line":"        # set_db_attribute does not work"},{"line_number":1234,"context_line":"        with self.ovsdb.transaction() as txn:"}],"source_content_type":"text/x-python","patch_set":4,"id":"586207a5_4f08e330","line":1231,"range":{"start_line":1230,"start_character":8,"end_line":1231,"end_character":46},"updated":"2021-11-12 07:52:21.000000000","message":"ditto","commit_id":"d8bd9923710dd5003174834da6e42e6b44228ef7"},{"author":{"_account_id":9531,"name":"liuyulong","display_name":"LIU Yulong","email":"i@liuyulong.me","username":"LIU-Yulong"},"change_message_id":"984b6d3ee20311f1cd2f846dc34bc865065df35e","unresolved":false,"context_lines":[{"line_number":1227,"context_line":"                                  (\u0027other_config\u0027, other_config)))"},{"line_number":1228,"context_line":""},{"line_number":1229,"context_line":"    def remove_value_from_other_config(self, port_name, key):"},{"line_number":1230,"context_line":"        other_config \u003d self.db_get_val("},{"line_number":1231,"context_line":"            \u0027Port\u0027, port_name, \u0027other_config\u0027)"},{"line_number":1232,"context_line":"        other_config.pop(key, None)"},{"line_number":1233,"context_line":"        # set_db_attribute does not work"},{"line_number":1234,"context_line":"        with self.ovsdb.transaction() as txn:"}],"source_content_type":"text/x-python","patch_set":4,"id":"4af8dbfb_bbc7eb14","line":1231,"range":{"start_line":1230,"start_character":8,"end_line":1231,"end_character":46},"in_reply_to":"586207a5_4f08e330","updated":"2022-02-09 14:34:16.000000000","message":"Done","commit_id":"d8bd9923710dd5003174834da6e42e6b44228ef7"},{"author":{"_account_id":8313,"name":"Lajos Katona","display_name":"lajoskatona","email":"katonalala@gmail.com","username":"elajkat","status":"Ericsson Software Technology"},"change_message_id":"7688b94b35d0ca0e3c9b62df996ae5db54d4362e","unresolved":false,"context_lines":[{"line_number":1219,"context_line":"        # other_config."},{"line_number":1220,"context_line":"        return self.get_value_from_other_config(port_name, \u0027tag\u0027, int)"},{"line_number":1221,"context_line":""},{"line_number":1222,"context_line":"    def get_value_from_other_config(self, port_name,"},{"line_number":1223,"context_line":"                                    key, value_type\u003dNone):"},{"line_number":1224,"context_line":"        try:"},{"line_number":1225,"context_line":"            other_config \u003d self.db_get_val("}],"source_content_type":"text/x-python","patch_set":6,"id":"0bfbb49b_80800f93","line":1222,"range":{"start_line":1222,"start_character":8,"end_line":1222,"end_character":35},"updated":"2022-02-18 13:35:01.000000000","message":"yeah there\u0027s only specific get_something_from_other_config methods (https://opendev.org/openstack/neutron/src/branch/master/neutron/agent/linux/openvswitch_firewall/firewall.py#L76-L112 )","commit_id":"7225d82a538e0f903882391fb0f9a571e4380190"},{"author":{"_account_id":1131,"name":"Brian Haley","email":"haleyb.dev@gmail.com","username":"brian-haley"},"change_message_id":"b37952c7c9dd51b4a52fc640db739037108da305","unresolved":true,"context_lines":[{"line_number":1223,"context_line":"                                    key, value_type\u003dNone):"},{"line_number":1224,"context_line":"        try:"},{"line_number":1225,"context_line":"            other_config \u003d self.db_get_val("},{"line_number":1226,"context_line":"                \u0027Port\u0027, port_name, \u0027other_config\u0027)"},{"line_number":1227,"context_line":"            value \u003d other_config.get(key)"},{"line_number":1228,"context_line":"            if value is not None:"},{"line_number":1229,"context_line":"                if value_type:"}],"source_content_type":"text/x-python","patch_set":8,"id":"34a3498f_355f74dc","line":1226,"updated":"2022-03-18 21:28:45.000000000","message":"Can this fail here? Calls below imply it can\u0027t but perhaps can return None or []?\n\nI realize Oleg asked about this in a previous version, so please ignore if I\u0027m wrong.","commit_id":"fde870ec2cd755e8f9bcf5787928fecf7e83b0ba"},{"author":{"_account_id":1131,"name":"Brian Haley","email":"haleyb.dev@gmail.com","username":"brian-haley"},"change_message_id":"75d1b1801703dd1a923f1a30e6d6dcb04c90836f","unresolved":true,"context_lines":[{"line_number":1223,"context_line":"                                    key, value_type\u003dNone):"},{"line_number":1224,"context_line":"        try:"},{"line_number":1225,"context_line":"            other_config \u003d self.db_get_val("},{"line_number":1226,"context_line":"                \u0027Port\u0027, port_name, \u0027other_config\u0027)"},{"line_number":1227,"context_line":"            value \u003d other_config.get(key)"},{"line_number":1228,"context_line":"            if value is not None:"},{"line_number":1229,"context_line":"                if value_type:"}],"source_content_type":"text/x-python","patch_set":8,"id":"99602a60_509479b6","line":1226,"in_reply_to":"144ac8cd_fee33043","updated":"2022-03-21 15:09:26.000000000","message":"Ok, just trying to minimize code under try/except that doesn\u0027t need to be there.","commit_id":"fde870ec2cd755e8f9bcf5787928fecf7e83b0ba"},{"author":{"_account_id":9531,"name":"liuyulong","display_name":"LIU Yulong","email":"i@liuyulong.me","username":"LIU-Yulong"},"change_message_id":"4972f01ea2f64754b958ee098537298d63882c0e","unresolved":true,"context_lines":[{"line_number":1223,"context_line":"                                    key, value_type\u003dNone):"},{"line_number":1224,"context_line":"        try:"},{"line_number":1225,"context_line":"            other_config \u003d self.db_get_val("},{"line_number":1226,"context_line":"                \u0027Port\u0027, port_name, \u0027other_config\u0027)"},{"line_number":1227,"context_line":"            value \u003d other_config.get(key)"},{"line_number":1228,"context_line":"            if value is not None:"},{"line_number":1229,"context_line":"                if value_type:"}],"source_content_type":"text/x-python","patch_set":8,"id":"144ac8cd_fee33043","line":1226,"in_reply_to":"34a3498f_355f74dc","updated":"2022-03-21 01:22:26.000000000","message":"`other_config` is always a dict in ovsdb, so it will not.","commit_id":"fde870ec2cd755e8f9bcf5787928fecf7e83b0ba"},{"author":{"_account_id":9531,"name":"liuyulong","display_name":"LIU Yulong","email":"i@liuyulong.me","username":"LIU-Yulong"},"change_message_id":"3ac2e1d3d559f59630d13e0a0edbca286b5f574d","unresolved":false,"context_lines":[{"line_number":1223,"context_line":"                                    key, value_type\u003dNone):"},{"line_number":1224,"context_line":"        try:"},{"line_number":1225,"context_line":"            other_config \u003d self.db_get_val("},{"line_number":1226,"context_line":"                \u0027Port\u0027, port_name, \u0027other_config\u0027)"},{"line_number":1227,"context_line":"            value \u003d other_config.get(key)"},{"line_number":1228,"context_line":"            if value is not None:"},{"line_number":1229,"context_line":"                if value_type:"}],"source_content_type":"text/x-python","patch_set":8,"id":"26e7626f_ca054c64","line":1226,"in_reply_to":"99602a60_509479b6","updated":"2022-04-08 00:27:51.000000000","message":"Ack","commit_id":"fde870ec2cd755e8f9bcf5787928fecf7e83b0ba"},{"author":{"_account_id":1131,"name":"Brian Haley","email":"haleyb.dev@gmail.com","username":"brian-haley"},"change_message_id":"b37952c7c9dd51b4a52fc640db739037108da305","unresolved":true,"context_lines":[{"line_number":1225,"context_line":"            other_config \u003d self.db_get_val("},{"line_number":1226,"context_line":"                \u0027Port\u0027, port_name, \u0027other_config\u0027)"},{"line_number":1227,"context_line":"            value \u003d other_config.get(key)"},{"line_number":1228,"context_line":"            if value is not None:"},{"line_number":1229,"context_line":"                if value_type:"},{"line_number":1230,"context_line":"                    return value_type(value)"},{"line_number":1231,"context_line":"                return value"},{"line_number":1232,"context_line":"        except (TypeError, ValueError):"},{"line_number":1233,"context_line":"            raise ovs_exc.OVSDBPortError(port\u003dport_name)"},{"line_number":1234,"context_line":""}],"source_content_type":"text/x-python","patch_set":8,"id":"307fc728_11835f68","line":1231,"range":{"start_line":1228,"start_character":12,"end_line":1231,"end_character":28},"updated":"2022-03-18 21:28:45.000000000","message":"Can this ever trigger a TypeError? I can see ValueError with int(\u0027foo\u0027) but int(None) can\u0027t ever happen. Also technically \u0027return value\u0027 can be un-indented since returning None is going to happen regardless.","commit_id":"fde870ec2cd755e8f9bcf5787928fecf7e83b0ba"},{"author":{"_account_id":9531,"name":"liuyulong","display_name":"LIU Yulong","email":"i@liuyulong.me","username":"LIU-Yulong"},"change_message_id":"4972f01ea2f64754b958ee098537298d63882c0e","unresolved":true,"context_lines":[{"line_number":1225,"context_line":"            other_config \u003d self.db_get_val("},{"line_number":1226,"context_line":"                \u0027Port\u0027, port_name, \u0027other_config\u0027)"},{"line_number":1227,"context_line":"            value \u003d other_config.get(key)"},{"line_number":1228,"context_line":"            if value is not None:"},{"line_number":1229,"context_line":"                if value_type:"},{"line_number":1230,"context_line":"                    return value_type(value)"},{"line_number":1231,"context_line":"                return value"},{"line_number":1232,"context_line":"        except (TypeError, ValueError):"},{"line_number":1233,"context_line":"            raise ovs_exc.OVSDBPortError(port\u003dport_name)"},{"line_number":1234,"context_line":""}],"source_content_type":"text/x-python","patch_set":8,"id":"d400910f_717ec000","line":1231,"range":{"start_line":1228,"start_character":12,"end_line":1231,"end_character":28},"in_reply_to":"307fc728_11835f68","updated":"2022-03-21 01:22:26.000000000","message":"Just in case some unconscious input, for instance:\n\n\u003e\u003e\u003e a \u003d 1\n\u003e\u003e\u003e a(\u00272\u0027)\nTraceback (most recent call last):\n  File \"\u003cstdin\u003e\", line 1, in \u003cmodule\u003e\nTypeError: \u0027int\u0027 object is not callable","commit_id":"fde870ec2cd755e8f9bcf5787928fecf7e83b0ba"},{"author":{"_account_id":9531,"name":"liuyulong","display_name":"LIU Yulong","email":"i@liuyulong.me","username":"LIU-Yulong"},"change_message_id":"3ac2e1d3d559f59630d13e0a0edbca286b5f574d","unresolved":false,"context_lines":[{"line_number":1225,"context_line":"            other_config \u003d self.db_get_val("},{"line_number":1226,"context_line":"                \u0027Port\u0027, port_name, \u0027other_config\u0027)"},{"line_number":1227,"context_line":"            value \u003d other_config.get(key)"},{"line_number":1228,"context_line":"            if value is not None:"},{"line_number":1229,"context_line":"                if value_type:"},{"line_number":1230,"context_line":"                    return value_type(value)"},{"line_number":1231,"context_line":"                return value"},{"line_number":1232,"context_line":"        except (TypeError, ValueError):"},{"line_number":1233,"context_line":"            raise ovs_exc.OVSDBPortError(port\u003dport_name)"},{"line_number":1234,"context_line":""}],"source_content_type":"text/x-python","patch_set":8,"id":"6d8b0f8d_1f78532d","line":1231,"range":{"start_line":1228,"start_character":12,"end_line":1231,"end_character":28},"in_reply_to":"d400910f_717ec000","updated":"2022-04-08 00:27:51.000000000","message":"Ack","commit_id":"fde870ec2cd755e8f9bcf5787928fecf7e83b0ba"},{"author":{"_account_id":1131,"name":"Brian Haley","email":"haleyb.dev@gmail.com","username":"brian-haley"},"change_message_id":"b37952c7c9dd51b4a52fc640db739037108da305","unresolved":true,"context_lines":[{"line_number":1230,"context_line":"                    return value_type(value)"},{"line_number":1231,"context_line":"                return value"},{"line_number":1232,"context_line":"        except (TypeError, ValueError):"},{"line_number":1233,"context_line":"            raise ovs_exc.OVSDBPortError(port\u003dport_name)"},{"line_number":1234,"context_line":""},{"line_number":1235,"context_line":"    def set_value_to_other_config(self, port_name, key, value):"},{"line_number":1236,"context_line":"        other_config \u003d self.db_get_val("}],"source_content_type":"text/x-python","patch_set":8,"id":"7954d420_7afc4471","line":1233,"updated":"2022-03-18 21:28:45.000000000","message":"And looking in the next patch in the series the caller catches all exceptions, do you even need this try/except?","commit_id":"fde870ec2cd755e8f9bcf5787928fecf7e83b0ba"},{"author":{"_account_id":9531,"name":"liuyulong","display_name":"LIU Yulong","email":"i@liuyulong.me","username":"LIU-Yulong"},"change_message_id":"3ac2e1d3d559f59630d13e0a0edbca286b5f574d","unresolved":false,"context_lines":[{"line_number":1230,"context_line":"                    return value_type(value)"},{"line_number":1231,"context_line":"                return value"},{"line_number":1232,"context_line":"        except (TypeError, ValueError):"},{"line_number":1233,"context_line":"            raise ovs_exc.OVSDBPortError(port\u003dport_name)"},{"line_number":1234,"context_line":""},{"line_number":1235,"context_line":"    def set_value_to_other_config(self, port_name, key, value):"},{"line_number":1236,"context_line":"        other_config \u003d self.db_get_val("}],"source_content_type":"text/x-python","patch_set":8,"id":"d0469cea_9188d583","line":1233,"in_reply_to":"155f89ca_7decbeea","updated":"2022-04-08 00:27:51.000000000","message":"Ack","commit_id":"fde870ec2cd755e8f9bcf5787928fecf7e83b0ba"},{"author":{"_account_id":1131,"name":"Brian Haley","email":"haleyb.dev@gmail.com","username":"brian-haley"},"change_message_id":"75d1b1801703dd1a923f1a30e6d6dcb04c90836f","unresolved":true,"context_lines":[{"line_number":1230,"context_line":"                    return value_type(value)"},{"line_number":1231,"context_line":"                return value"},{"line_number":1232,"context_line":"        except (TypeError, ValueError):"},{"line_number":1233,"context_line":"            raise ovs_exc.OVSDBPortError(port\u003dport_name)"},{"line_number":1234,"context_line":""},{"line_number":1235,"context_line":"    def set_value_to_other_config(self, port_name, key, value):"},{"line_number":1236,"context_line":"        other_config \u003d self.db_get_val("}],"source_content_type":"text/x-python","patch_set":8,"id":"f7be0c7c_dadd5ea8","line":1233,"in_reply_to":"6b835339_acc1ccf5","updated":"2022-03-21 15:09:26.000000000","message":"So it gets back to my question - if the caller catches all exceptions why do anything here?","commit_id":"fde870ec2cd755e8f9bcf5787928fecf7e83b0ba"},{"author":{"_account_id":9531,"name":"liuyulong","display_name":"LIU Yulong","email":"i@liuyulong.me","username":"LIU-Yulong"},"change_message_id":"4972f01ea2f64754b958ee098537298d63882c0e","unresolved":true,"context_lines":[{"line_number":1230,"context_line":"                    return value_type(value)"},{"line_number":1231,"context_line":"                return value"},{"line_number":1232,"context_line":"        except (TypeError, ValueError):"},{"line_number":1233,"context_line":"            raise ovs_exc.OVSDBPortError(port\u003dport_name)"},{"line_number":1234,"context_line":""},{"line_number":1235,"context_line":"    def set_value_to_other_config(self, port_name, key, value):"},{"line_number":1236,"context_line":"        other_config \u003d self.db_get_val("}],"source_content_type":"text/x-python","patch_set":8,"id":"6b835339_acc1ccf5","line":1233,"in_reply_to":"7954d420_7afc4471","updated":"2022-03-21 01:22:26.000000000","message":"ValueError can happen if call this with wrong value_type, for instance:\n\u003e\u003e\u003e int(\"a_string\")\nTraceback (most recent call last):\n  File \"\u003cstdin\u003e\", line 1, in \u003cmodule\u003e\nValueError: invalid literal for int() with base 10: \u0027a_string\u0027\n\nTypeError can happen when the with wrong value_type which is not callable, for instance:\n\u003e\u003e\u003e a \u003d 1\n\u003e\u003e\u003e a(\u00272\u0027)\nTraceback (most recent call last):\n  File \"\u003cstdin\u003e\", line 1, in \u003cmodule\u003e\nTypeError: \u0027int\u0027 object is not callable\n\nTypeError may not happen, or it is in a very small probability, but just in case someone use wrong value_type.","commit_id":"fde870ec2cd755e8f9bcf5787928fecf7e83b0ba"},{"author":{"_account_id":9531,"name":"liuyulong","display_name":"LIU Yulong","email":"i@liuyulong.me","username":"LIU-Yulong"},"change_message_id":"b946ad39556d89937c8c3b9c26335f6b6eca8ab0","unresolved":true,"context_lines":[{"line_number":1230,"context_line":"                    return value_type(value)"},{"line_number":1231,"context_line":"                return value"},{"line_number":1232,"context_line":"        except (TypeError, ValueError):"},{"line_number":1233,"context_line":"            raise ovs_exc.OVSDBPortError(port\u003dport_name)"},{"line_number":1234,"context_line":""},{"line_number":1235,"context_line":"    def set_value_to_other_config(self, port_name, key, value):"},{"line_number":1236,"context_line":"        other_config \u003d self.db_get_val("}],"source_content_type":"text/x-python","patch_set":8,"id":"155f89ca_7decbeea","line":1233,"in_reply_to":"f7be0c7c_dadd5ea8","updated":"2022-03-22 00:54:59.000000000","message":"OK, make sense, will remove the try-catch all exception in follow-up patch.","commit_id":"fde870ec2cd755e8f9bcf5787928fecf7e83b0ba"},{"author":{"_account_id":9531,"name":"liuyulong","display_name":"LIU Yulong","email":"i@liuyulong.me","username":"LIU-Yulong"},"change_message_id":"b09482d8306d2b9665841649784ae399d838cfa9","unresolved":true,"context_lines":[{"line_number":1210,"context_line":"                                    key, value_type\u003dNone):"},{"line_number":1211,"context_line":"        try:"},{"line_number":1212,"context_line":"            other_config \u003d self.db_get_val("},{"line_number":1213,"context_line":"                \u0027Port\u0027, port_name, \u0027other_config\u0027) or {}"},{"line_number":1214,"context_line":"            value \u003d other_config.get(key)"},{"line_number":1215,"context_line":"            if value is not None:"},{"line_number":1216,"context_line":"                if value_type:"}],"source_content_type":"text/x-python","patch_set":12,"id":"0e00bd43_2ff90183","line":1213,"range":{"start_line":1213,"start_character":51,"end_line":1213,"end_character":56},"updated":"2022-03-22 00:56:28.000000000","message":"Added this just in case some unexpected version of ovsdb DB schema.","commit_id":"ea1f59e81847f153e8a218deede96bb8ddd401be"},{"author":{"_account_id":9531,"name":"liuyulong","display_name":"LIU Yulong","email":"i@liuyulong.me","username":"LIU-Yulong"},"change_message_id":"3ac2e1d3d559f59630d13e0a0edbca286b5f574d","unresolved":false,"context_lines":[{"line_number":1210,"context_line":"                                    key, value_type\u003dNone):"},{"line_number":1211,"context_line":"        try:"},{"line_number":1212,"context_line":"            other_config \u003d self.db_get_val("},{"line_number":1213,"context_line":"                \u0027Port\u0027, port_name, \u0027other_config\u0027) or {}"},{"line_number":1214,"context_line":"            value \u003d other_config.get(key)"},{"line_number":1215,"context_line":"            if value is not None:"},{"line_number":1216,"context_line":"                if value_type:"}],"source_content_type":"text/x-python","patch_set":12,"id":"3a86eeb5_5bc4aa8f","line":1213,"range":{"start_line":1213,"start_character":51,"end_line":1213,"end_character":56},"in_reply_to":"0e00bd43_2ff90183","updated":"2022-04-08 00:27:51.000000000","message":"Ack","commit_id":"ea1f59e81847f153e8a218deede96bb8ddd401be"}],"neutron/plugins/ml2/drivers/openvswitch/agent/common/exceptions.py":[{"author":{"_account_id":11975,"name":"Slawek Kaplonski","email":"skaplons@redhat.com","username":"slaweq"},"change_message_id":"6a0797e1ae39d11fb37dbf5140f59ac7c8e136d0","unresolved":true,"context_lines":[{"line_number":18,"context_line":""},{"line_number":19,"context_line":"class OVSDBPortError(exceptions.NeutronException):"},{"line_number":20,"context_line":"    message \u003d _(\"Port %(port)s is not found in ovsdb. \""},{"line_number":21,"context_line":"                \"Or the request value type is invalid.\")"}],"source_content_type":"text/x-python","patch_set":13,"id":"b5035fe6_2e72893f","line":21,"range":{"start_line":21,"start_character":24,"end_line":21,"end_character":31},"updated":"2022-04-20 14:33:27.000000000","message":"nit: requested","commit_id":"bb5ef1fcba4ccf910c0d5d789e5f3c7bba878eb8"},{"author":{"_account_id":9531,"name":"liuyulong","display_name":"LIU Yulong","email":"i@liuyulong.me","username":"LIU-Yulong"},"change_message_id":"96fa19f6ea2ecf6a364095db1b3b99a7eb05872d","unresolved":false,"context_lines":[{"line_number":18,"context_line":""},{"line_number":19,"context_line":"class OVSDBPortError(exceptions.NeutronException):"},{"line_number":20,"context_line":"    message \u003d _(\"Port %(port)s is not found in ovsdb. \""},{"line_number":21,"context_line":"                \"Or the request value type is invalid.\")"}],"source_content_type":"text/x-python","patch_set":13,"id":"d02196f5_20049f47","line":21,"range":{"start_line":21,"start_character":24,"end_line":21,"end_character":31},"in_reply_to":"b5035fe6_2e72893f","updated":"2022-04-20 15:41:21.000000000","message":"Ack","commit_id":"bb5ef1fcba4ccf910c0d5d789e5f3c7bba878eb8"},{"author":{"_account_id":9531,"name":"liuyulong","display_name":"LIU Yulong","email":"i@liuyulong.me","username":"LIU-Yulong"},"change_message_id":"f0cf297a6224c6677662797f8df61d665875c5ad","unresolved":false,"context_lines":[{"line_number":18,"context_line":""},{"line_number":19,"context_line":"class OVSDBPortError(exceptions.NeutronException):"},{"line_number":20,"context_line":"    message \u003d _(\"Port %(port)s is not found in ovsdb. \""},{"line_number":21,"context_line":"                \"Or the request value type is invalid.\")"}],"source_content_type":"text/x-python","patch_set":13,"id":"65e2dfa4_aa1add93","line":21,"range":{"start_line":21,"start_character":24,"end_line":21,"end_character":31},"in_reply_to":"d02196f5_20049f47","updated":"2022-04-21 07:59:20.000000000","message":"Done","commit_id":"bb5ef1fcba4ccf910c0d5d789e5f3c7bba878eb8"}],"neutron/plugins/ml2/drivers/openvswitch/agent/openflow/native/br_int.py":[{"author":{"_account_id":16688,"name":"Rodolfo Alonso","email":"ralonsoh@redhat.com","username":"rodolfo-alonso-hernandez"},"change_message_id":"c32d759588a1e04573fdc90320944d646b52f869","unresolved":true,"context_lines":[{"line_number":453,"context_line":""},{"line_number":454,"context_line":"        bands \u003d ["},{"line_number":455,"context_line":"            ofpp.OFPMeterBandDrop(rate\u003drate, burst_size\u003dburst,"},{"line_number":456,"context_line":"                                  type_\u003dofp.OFPMBT_DROP)]"},{"line_number":457,"context_line":"        req \u003d ofpp.OFPMeterMod(datapath\u003ddp, command\u003dofp.OFPMC_ADD,"},{"line_number":458,"context_line":"                               flags\u003dofp.OFPMF_PKTPS, meter_id\u003dmeter_id,"},{"line_number":459,"context_line":"                               bands\u003dbands)"}],"source_content_type":"text/x-python","patch_set":7,"id":"dcada917_c0b4de77","line":456,"range":{"start_line":456,"start_character":34,"end_line":456,"end_character":55},"updated":"2022-02-23 15:47:45.000000000","message":"\"type_\" is not used in os-ken, \"OFPMBT_DROP\" is used by default always.","commit_id":"9c721e17d77449733cc59cb42685e9204d77df6c"},{"author":{"_account_id":9531,"name":"liuyulong","display_name":"LIU Yulong","email":"i@liuyulong.me","username":"LIU-Yulong"},"change_message_id":"3ac2e1d3d559f59630d13e0a0edbca286b5f574d","unresolved":false,"context_lines":[{"line_number":453,"context_line":""},{"line_number":454,"context_line":"        bands \u003d ["},{"line_number":455,"context_line":"            ofpp.OFPMeterBandDrop(rate\u003drate, burst_size\u003dburst,"},{"line_number":456,"context_line":"                                  type_\u003dofp.OFPMBT_DROP)]"},{"line_number":457,"context_line":"        req \u003d ofpp.OFPMeterMod(datapath\u003ddp, command\u003dofp.OFPMC_ADD,"},{"line_number":458,"context_line":"                               flags\u003dofp.OFPMF_PKTPS, meter_id\u003dmeter_id,"},{"line_number":459,"context_line":"                               bands\u003dbands)"}],"source_content_type":"text/x-python","patch_set":7,"id":"82407e29_e1816f66","line":456,"range":{"start_line":456,"start_character":34,"end_line":456,"end_character":55},"in_reply_to":"31761c29_f8352888","updated":"2022-04-08 00:27:51.000000000","message":"Ack","commit_id":"9c721e17d77449733cc59cb42685e9204d77df6c"},{"author":{"_account_id":9531,"name":"liuyulong","display_name":"LIU Yulong","email":"i@liuyulong.me","username":"LIU-Yulong"},"change_message_id":"81edbb07531744e97d7f6c1971bc78b1f85673a3","unresolved":true,"context_lines":[{"line_number":453,"context_line":""},{"line_number":454,"context_line":"        bands \u003d ["},{"line_number":455,"context_line":"            ofpp.OFPMeterBandDrop(rate\u003drate, burst_size\u003dburst,"},{"line_number":456,"context_line":"                                  type_\u003dofp.OFPMBT_DROP)]"},{"line_number":457,"context_line":"        req \u003d ofpp.OFPMeterMod(datapath\u003ddp, command\u003dofp.OFPMC_ADD,"},{"line_number":458,"context_line":"                               flags\u003dofp.OFPMF_PKTPS, meter_id\u003dmeter_id,"},{"line_number":459,"context_line":"                               bands\u003dbands)"}],"source_content_type":"text/x-python","patch_set":7,"id":"31761c29_f8352888","line":456,"range":{"start_line":456,"start_character":34,"end_line":456,"end_character":55},"in_reply_to":"dcada917_c0b4de77","updated":"2022-03-15 02:36:05.000000000","message":"Thanks, removed.","commit_id":"9c721e17d77449733cc59cb42685e9204d77df6c"},{"author":{"_account_id":11975,"name":"Slawek Kaplonski","email":"skaplons@redhat.com","username":"slaweq"},"change_message_id":"6a0797e1ae39d11fb37dbf5140f59ac7c8e136d0","unresolved":true,"context_lines":[{"line_number":487,"context_line":"            match \u003d ofpp.OFPMatch(vlan_vid\u003dvlan_vid, eth_dst\u003dmac)"},{"line_number":488,"context_line":"        else:"},{"line_number":489,"context_line":"            LOG.warning(\"Invalid inputs to add meter flows to port.\")"},{"line_number":490,"context_line":"            return"},{"line_number":491,"context_line":""},{"line_number":492,"context_line":"        instructions \u003d ["},{"line_number":493,"context_line":"            ofpp.OFPInstructionMeter(meter_id, type_\u003dofp.OFPIT_METER),"}],"source_content_type":"text/x-python","patch_set":13,"id":"b1b20293_3dc5d7fc","line":490,"updated":"2022-04-20 14:33:27.000000000","message":"personally it seems a bit confusing for me to have optional parameters which are really required together with some of the direction set. Maybe it would be better to have 2 methods like:\n\n    apply_ingress_meter_to_port(self, meter_id, mac, local_vlan)\n\n    apply_egress_meter_to_port(self, meter_id, mac, in_port)\n\nwould be better?","commit_id":"bb5ef1fcba4ccf910c0d5d789e5f3c7bba878eb8"},{"author":{"_account_id":9531,"name":"liuyulong","display_name":"LIU Yulong","email":"i@liuyulong.me","username":"LIU-Yulong"},"change_message_id":"8951f386f906f78616356af72975faf8b4cd1be6","unresolved":true,"context_lines":[{"line_number":487,"context_line":"            match \u003d ofpp.OFPMatch(vlan_vid\u003dvlan_vid, eth_dst\u003dmac)"},{"line_number":488,"context_line":"        else:"},{"line_number":489,"context_line":"            LOG.warning(\"Invalid inputs to add meter flows to port.\")"},{"line_number":490,"context_line":"            return"},{"line_number":491,"context_line":""},{"line_number":492,"context_line":"        instructions \u003d ["},{"line_number":493,"context_line":"            ofpp.OFPInstructionMeter(meter_id, type_\u003dofp.OFPIT_METER),"}],"source_content_type":"text/x-python","patch_set":13,"id":"e3154df9_32aa46b8","line":490,"in_reply_to":"b1b20293_3dc5d7fc","updated":"2022-04-20 15:40:18.000000000","message":"Many duplicated code for two separated funtions.\nI guess you have distinguished the parameters, because you are right for the parameters of your suggested functions. 😊","commit_id":"bb5ef1fcba4ccf910c0d5d789e5f3c7bba878eb8"},{"author":{"_account_id":9531,"name":"liuyulong","display_name":"LIU Yulong","email":"i@liuyulong.me","username":"LIU-Yulong"},"change_message_id":"96fa19f6ea2ecf6a364095db1b3b99a7eb05872d","unresolved":false,"context_lines":[{"line_number":487,"context_line":"            match \u003d ofpp.OFPMatch(vlan_vid\u003dvlan_vid, eth_dst\u003dmac)"},{"line_number":488,"context_line":"        else:"},{"line_number":489,"context_line":"            LOG.warning(\"Invalid inputs to add meter flows to port.\")"},{"line_number":490,"context_line":"            return"},{"line_number":491,"context_line":""},{"line_number":492,"context_line":"        instructions \u003d ["},{"line_number":493,"context_line":"            ofpp.OFPInstructionMeter(meter_id, type_\u003dofp.OFPIT_METER),"}],"source_content_type":"text/x-python","patch_set":13,"id":"447dd9d7_ada1be47","line":490,"in_reply_to":"e3154df9_32aa46b8","updated":"2022-04-20 15:41:21.000000000","message":"Ack","commit_id":"bb5ef1fcba4ccf910c0d5d789e5f3c7bba878eb8"},{"author":{"_account_id":11975,"name":"Slawek Kaplonski","email":"skaplons@redhat.com","username":"slaweq"},"change_message_id":"6a0797e1ae39d11fb37dbf5140f59ac7c8e136d0","unresolved":true,"context_lines":[{"line_number":509,"context_line":"            match \u003d ofpp.OFPMatch(vlan_vid\u003dvlan_vid, eth_dst\u003dmac)"},{"line_number":510,"context_line":"        else:"},{"line_number":511,"context_line":"            LOG.warning(\"Invalid inputs to remove meter flows from port.\")"},{"line_number":512,"context_line":"            return"},{"line_number":513,"context_line":""},{"line_number":514,"context_line":"        self.uninstall_flows(table_id\u003dconstants.PACKET_RATE_LIMIT,"},{"line_number":515,"context_line":"                             match\u003dmatch)"}],"source_content_type":"text/x-python","patch_set":13,"id":"7b4cad12_4a4f203f","line":512,"updated":"2022-04-20 14:33:27.000000000","message":"same here","commit_id":"bb5ef1fcba4ccf910c0d5d789e5f3c7bba878eb8"},{"author":{"_account_id":9531,"name":"liuyulong","display_name":"LIU Yulong","email":"i@liuyulong.me","username":"LIU-Yulong"},"change_message_id":"96fa19f6ea2ecf6a364095db1b3b99a7eb05872d","unresolved":false,"context_lines":[{"line_number":509,"context_line":"            match \u003d ofpp.OFPMatch(vlan_vid\u003dvlan_vid, eth_dst\u003dmac)"},{"line_number":510,"context_line":"        else:"},{"line_number":511,"context_line":"            LOG.warning(\"Invalid inputs to remove meter flows from port.\")"},{"line_number":512,"context_line":"            return"},{"line_number":513,"context_line":""},{"line_number":514,"context_line":"        self.uninstall_flows(table_id\u003dconstants.PACKET_RATE_LIMIT,"},{"line_number":515,"context_line":"                             match\u003dmatch)"}],"source_content_type":"text/x-python","patch_set":13,"id":"e73ebc6d_2785c5e3","line":512,"in_reply_to":"7b4cad12_4a4f203f","updated":"2022-04-20 15:41:21.000000000","message":"I will add some comments to these two funtions.","commit_id":"bb5ef1fcba4ccf910c0d5d789e5f3c7bba878eb8"}]}
