)]}'
{"kuryr_kubernetes/cni/binding/sriov.py":[{"author":{"_account_id":28396,"name":"Alexey Perevalov","email":"alexey.perevalov@huawei.com","username":"a.perevalov"},"change_message_id":"4157268ab36b1b49ebfeb5b16c01cc6066740fea","unresolved":false,"context_lines":[{"line_number":172,"context_line":"            vf_name \u003d vf_names[0]"},{"line_number":173,"context_line":"        except OSError:"},{"line_number":174,"context_line":"            LOG.debug(\"No vf name for device %s\", pci)"},{"line_number":175,"context_line":"            if driver not in constants.USERSPACE_DRIVERS:"},{"line_number":176,"context_line":"                raise"},{"line_number":177,"context_line":"            vf_name \u003d None"},{"line_number":178,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"7faddb67_e4e216d4","line":175,"updated":"2019-09-04 06:54:00.000000000","message":"Maybe just check vf_sys_path existence and do not handle logic in exception handling block, just for readability.","commit_id":"246b01f68dc92e1d712811164f9bb60e9a71e289"},{"author":{"_account_id":28396,"name":"Alexey Perevalov","email":"alexey.perevalov@huawei.com","username":"a.perevalov"},"change_message_id":"d2b3defabe61030e8ac0816aa0dd64461d7e4fd0","unresolved":false,"context_lines":[{"line_number":172,"context_line":"            vf_name \u003d vf_names[0]"},{"line_number":173,"context_line":"        except OSError:"},{"line_number":174,"context_line":"            LOG.debug(\"No vf name for device %s\", pci)"},{"line_number":175,"context_line":"            if driver not in constants.USERSPACE_DRIVERS:"},{"line_number":176,"context_line":"                raise"},{"line_number":177,"context_line":"            vf_name \u003d None"},{"line_number":178,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"7faddb67_992aa48e","line":175,"in_reply_to":"7faddb67_127d346c","updated":"2019-09-04 15:17:01.000000000","message":"So we can handle it with if else here and raise exception. Or introduce local helper function for it, which will return correct vf_name or throw an exception.","commit_id":"246b01f68dc92e1d712811164f9bb60e9a71e289"},{"author":{"_account_id":24604,"name":"Danil Golov","email":"d.golov@samsung.com","username":"d.golov"},"change_message_id":"8befa8fa812a6515712811763638c5572916a95a","unresolved":false,"context_lines":[{"line_number":172,"context_line":"            vf_name \u003d vf_names[0]"},{"line_number":173,"context_line":"        except OSError:"},{"line_number":174,"context_line":"            LOG.debug(\"No vf name for device %s\", pci)"},{"line_number":175,"context_line":"            if driver not in constants.USERSPACE_DRIVERS:"},{"line_number":176,"context_line":"                raise"},{"line_number":177,"context_line":"            vf_name \u003d None"},{"line_number":178,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"7faddb67_127d346c","line":175,"in_reply_to":"7faddb67_e4e216d4","updated":"2019-09-04 08:39:00.000000000","message":"I agree, it would be more readable, but if vf_sys_path does not exist it means the it was binded on userspace driver and there are two ways of actions:\n\n1. If we want to rebind this device on some userspace driver, we do not need it\u0027s vf_name, so we can set it in None and do not throw an exception.\n\n2. If we want to rebind this device on some kernel driver, we need it\u0027s vf_name, but it doesn\u0027t exist. It tells about misconfiguration (between sriov-device-plugin and kuryr-kubernetes) and we should throw an exception","commit_id":"246b01f68dc92e1d712811164f9bb60e9a71e289"}]}
