)]}'
{"nova/pci/whitelist.py":[{"author":{"_account_id":11604,"name":"sean mooney","email":"smooney@redhat.com","username":"sean-k-mooney"},"change_message_id":"9e4e8807e5805bb1bd868842022a1005854d835d","unresolved":true,"context_lines":[{"line_number":33,"context_line":"    assignable."},{"line_number":34,"context_line":"    \"\"\""},{"line_number":35,"context_line":""},{"line_number":36,"context_line":"    def __init__(self, whitelist_spec: ty.List[str] \u003d None) -\u003e None:"},{"line_number":37,"context_line":"        \"\"\"White list constructor"},{"line_number":38,"context_line":""},{"line_number":39,"context_line":"        For example, the following json string specifies that devices whose"}],"source_content_type":"text/x-python","patch_set":2,"id":"7e63d3b3_18512a6a","line":36,"range":{"start_line":36,"start_character":39,"end_line":36,"end_character":51},"updated":"2022-07-12 09:12:16.000000000","message":"this I think is wrong\n\nits a string not a list\n\nI think the confusion here is because we allow the whitelist to both be a mutltiStrOpt filed and each filed can contain a json list of values\n\nso the input type of the whitelist_sepc is a json encoded string but\nthat json string can contain a list of whitelists.\n\nso the data type should be str, but we can parse multiple device specs form it","commit_id":"3a6198c8fb6b00daf6429bcb672f4db45f023505"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"9fdcbd9c57804c85059d1d6d5fa328bd93e8a9c4","unresolved":true,"context_lines":[{"line_number":33,"context_line":"    assignable."},{"line_number":34,"context_line":"    \"\"\""},{"line_number":35,"context_line":""},{"line_number":36,"context_line":"    def __init__(self, whitelist_spec: ty.List[str] \u003d None) -\u003e None:"},{"line_number":37,"context_line":"        \"\"\"White list constructor"},{"line_number":38,"context_line":""},{"line_number":39,"context_line":"        For example, the following json string specifies that devices whose"}],"source_content_type":"text/x-python","patch_set":2,"id":"00c0426f_65fc0387","line":36,"range":{"start_line":36,"start_character":39,"end_line":36,"end_character":51},"in_reply_to":"7e63d3b3_18512a6a","updated":"2022-07-25 16:12:56.000000000","message":"look at _parse_white_list_from_config[1] where the value is used, it iterates the value like:\n\n    for jsonspec in whitelists:\n    \nso if \u0027whitelists\u0027 would be string then jsonspec would be char in each iteration.\n\n\nAlso if you look at the oslo.config MultiOpt defined[2] as:\n\n    Multi opt values are typed opts which may be specified multiple times.\n    The opt value is a list containing all the values specified.\n    \nSo a MultiOpt is always a list. \n\nOur special handling for the whitelist / device_spec is in _parse_white_list_from_config where we check if each item in that list (provided by oslo) is dict or a list[3]. If it is a list then we do one more round of iteration on that list and expect that there can only be dict now. This is how we can handle both a json encoded list of dicts, or simply a list of json encoded dicts. :) I know it is crazy.\n\nBottom line. I think the type hint here is correct per the oslo doc and our usage of the value.\n\n[1] https://github.com/openstack/nova/blob/bcb96f362ab12e297f125daa5189fb66345b4976/nova/pci/whitelist.py#L61\n[2] https://github.com/openstack/oslo.config/blob/9eaae044534cbe015217019781c4c0d97f0402df/oslo_config/cfg.py#L1229-L1230\n[3] https://github.com/openstack/nova/blob/bcb96f362ab12e297f125daa5189fb66345b4976/nova/pci/whitelist.py#L63-L74","commit_id":"3a6198c8fb6b00daf6429bcb672f4db45f023505"}]}
