)]}'
{"nova/pci/devspec.py":[{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"e57612460dc562947d193901d35025e4105a24a1","unresolved":true,"context_lines":[{"line_number":86,"context_line":""},{"line_number":87,"context_line":"    def __init__(self, pci_addr: PCISpecAddressType) -\u003e None:"},{"line_number":88,"context_line":"        try:"},{"line_number":89,"context_line":"            # TODO(stephenfin): Is this ever actually a string?"},{"line_number":90,"context_line":"            if isinstance(pci_addr, dict):"},{"line_number":91,"context_line":"                self.domain \u003d pci_addr[\u0027domain\u0027]"},{"line_number":92,"context_line":"                self.bus \u003d pci_addr[\u0027bus\u0027]"}],"source_content_type":"text/x-python","patch_set":19,"id":"4df3c841_98a57964","line":89,"updated":"2021-02-03 14:05:14.000000000","message":"I think it could be. When this ctor is called from WhitelistPciAddress._init_address_fields() as the Whitelist is coming from the config it is probably a string. Also PciDeviceSpec.match() has a comment about being it a string","commit_id":"dbb7901530d848596202315db1f4701b4eef8ed3"},{"author":{"_account_id":15334,"name":"Stephen Finucane","display_name":"stephenfin","email":"stephenfin@redhat.com","username":"sfinucan"},"change_message_id":"1f7bd7ff7007bfac48cb623ab5fba3c49b2cdd05","unresolved":true,"context_lines":[{"line_number":86,"context_line":""},{"line_number":87,"context_line":"    def __init__(self, pci_addr: PCISpecAddressType) -\u003e None:"},{"line_number":88,"context_line":"        try:"},{"line_number":89,"context_line":"            # TODO(stephenfin): Is this ever actually a string?"},{"line_number":90,"context_line":"            if isinstance(pci_addr, dict):"},{"line_number":91,"context_line":"                self.domain \u003d pci_addr[\u0027domain\u0027]"},{"line_number":92,"context_line":"                self.bus \u003d pci_addr[\u0027bus\u0027]"}],"source_content_type":"text/x-python","patch_set":19,"id":"e32ba702_8c09430a","line":89,"in_reply_to":"4df3c841_98a57964","updated":"2021-02-19 18:26:46.000000000","message":"Yeah, investigated this today are you are correct. That means this type hint is incorrect. We can fix this is a follow-up.","commit_id":"dbb7901530d848596202315db1f4701b4eef8ed3"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"e57612460dc562947d193901d35025e4105a24a1","unresolved":true,"context_lines":[{"line_number":280,"context_line":"            raise exception.PciDeviceInvalidDeviceName()"},{"line_number":281,"context_line":""},{"line_number":282,"context_line":"        if not self.dev_name:"},{"line_number":283,"context_line":"            address \u003d address or \"*:*:*.*\""},{"line_number":284,"context_line":"            self.address \u003d WhitelistPciAddress(address, False)"},{"line_number":285,"context_line":""},{"line_number":286,"context_line":"    def match(self, dev_dict: ty.Dict[str, str]) -\u003e bool:"}],"source_content_type":"text/x-python","patch_set":19,"id":"edf7ce0c_3a3f914a","line":283,"range":{"start_line":283,"start_character":12,"end_line":283,"end_character":42},"updated":"2021-02-03 14:05:14.000000000","message":"you can even fold this into the next line to avoid redefining the address variable","commit_id":"dbb7901530d848596202315db1f4701b4eef8ed3"},{"author":{"_account_id":15334,"name":"Stephen Finucane","display_name":"stephenfin","email":"stephenfin@redhat.com","username":"sfinucan"},"change_message_id":"30af81a0291beee6b28e478cea425002302181f9","unresolved":false,"context_lines":[{"line_number":280,"context_line":"            raise exception.PciDeviceInvalidDeviceName()"},{"line_number":281,"context_line":""},{"line_number":282,"context_line":"        if not self.dev_name:"},{"line_number":283,"context_line":"            address \u003d address or \"*:*:*.*\""},{"line_number":284,"context_line":"            self.address \u003d WhitelistPciAddress(address, False)"},{"line_number":285,"context_line":""},{"line_number":286,"context_line":"    def match(self, dev_dict: ty.Dict[str, str]) -\u003e bool:"}],"source_content_type":"text/x-python","patch_set":19,"id":"a3a16b7c_ed8673a5","line":283,"range":{"start_line":283,"start_character":12,"end_line":283,"end_character":42},"in_reply_to":"edf7ce0c_3a3f914a","updated":"2021-02-08 18:06:17.000000000","message":"Done","commit_id":"dbb7901530d848596202315db1f4701b4eef8ed3"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"e57612460dc562947d193901d35025e4105a24a1","unresolved":true,"context_lines":[{"line_number":284,"context_line":"            self.address \u003d WhitelistPciAddress(address, False)"},{"line_number":285,"context_line":""},{"line_number":286,"context_line":"    def match(self, dev_dict: ty.Dict[str, str]) -\u003e bool:"},{"line_number":287,"context_line":"        address_obj: ty.Optional[WhitelistPciAddress]"},{"line_number":288,"context_line":""},{"line_number":289,"context_line":"        if self.dev_name:"},{"line_number":290,"context_line":"            address_str, pf \u003d utils.get_function_by_ifname(self.dev_name)"}],"source_content_type":"text/x-python","patch_set":19,"id":"e04f49d6_8e2aae6e","line":287,"range":{"start_line":287,"start_character":24,"end_line":287,"end_character":32},"updated":"2021-02-03 14:05:14.000000000","message":"I don\u0027t like the optionality here but I don\u0027t see an easy way out","commit_id":"dbb7901530d848596202315db1f4701b4eef8ed3"},{"author":{"_account_id":15334,"name":"Stephen Finucane","display_name":"stephenfin","email":"stephenfin@redhat.com","username":"sfinucan"},"change_message_id":"30af81a0291beee6b28e478cea425002302181f9","unresolved":false,"context_lines":[{"line_number":284,"context_line":"            self.address \u003d WhitelistPciAddress(address, False)"},{"line_number":285,"context_line":""},{"line_number":286,"context_line":"    def match(self, dev_dict: ty.Dict[str, str]) -\u003e bool:"},{"line_number":287,"context_line":"        address_obj: ty.Optional[WhitelistPciAddress]"},{"line_number":288,"context_line":""},{"line_number":289,"context_line":"        if self.dev_name:"},{"line_number":290,"context_line":"            address_str, pf \u003d utils.get_function_by_ifname(self.dev_name)"}],"source_content_type":"text/x-python","patch_set":19,"id":"03521e74_1975632a","line":287,"range":{"start_line":287,"start_character":24,"end_line":287,"end_character":32},"in_reply_to":"e04f49d6_8e2aae6e","updated":"2021-02-08 18:06:17.000000000","message":"Ack","commit_id":"dbb7901530d848596202315db1f4701b4eef8ed3"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"66ce2f118278bc209c49c1f766546a3d13e1158f","unresolved":true,"context_lines":[{"line_number":40,"context_line":"    This class checks the address fields of the pci.passthrough_whitelist"},{"line_number":41,"context_line":"    \"\"\""},{"line_number":42,"context_line":""},{"line_number":43,"context_line":"    def __init__(self, pci_addr: str) -\u003e None:"},{"line_number":44,"context_line":"        self.domain \u003d \u0027\u0027"},{"line_number":45,"context_line":"        self.bus \u003d \u0027\u0027"},{"line_number":46,"context_line":"        self.slot \u003d \u0027\u0027"}],"source_content_type":"text/x-python","patch_set":20,"id":"ac77e015_56e98f7e","line":43,"range":{"start_line":43,"start_character":23,"end_line":43,"end_character":36},"updated":"2021-02-09 13:15:06.000000000","message":"hm, it is an unused param, in an class with abstract methods. So meh this is probably OK.","commit_id":"7b5a2069a21903889766e5ea656bb2c3eca53f1a"},{"author":{"_account_id":11604,"name":"sean mooney","email":"smooney@redhat.com","username":"sean-k-mooney"},"change_message_id":"3b454d00f43a4dc337b51fbda6122f3046aaae9b","unresolved":true,"context_lines":[{"line_number":266,"context_line":"        self.vendor_id \u003d self.tags.pop(\"vendor_id\", ANY)"},{"line_number":267,"context_line":"        self.product_id \u003d self.tags.pop(\"product_id\", ANY)"},{"line_number":268,"context_line":"        self.dev_name \u003d self.tags.pop(\"devname\", None)"},{"line_number":269,"context_line":"        self.address: ty.Optional[WhitelistPciAddress] \u003d None"},{"line_number":270,"context_line":"        # Note(moshele): The address attribute can be a string or a dict."},{"line_number":271,"context_line":"        # For glob syntax or specific pci it is a string and for regex syntax"},{"line_number":272,"context_line":"        # it is a dict. The WhitelistPciAddress class handles both types."},{"line_number":273,"context_line":"        address \u003d self.tags.pop(\"address\", None)"},{"line_number":274,"context_line":""},{"line_number":275,"context_line":"        self.vendor_id \u003d self.vendor_id.strip()"},{"line_number":276,"context_line":"        self._set_pci_dev_info(\u0027vendor_id\u0027, MAX_VENDOR_ID, \u0027%04x\u0027)"}],"source_content_type":"text/x-python","patch_set":22,"id":"0cb501f4_168452cb","line":273,"range":{"start_line":269,"start_character":7,"end_line":273,"end_character":48},"updated":"2021-04-27 12:03:49.000000000","message":"why are you making this change.\ni hope its not because of line lenght.\n\ndont we have the ablity to declare the type of instance vaiables in the body of the class.\nhttps://mypy.readthedocs.io/en/stable/class_basics.html#instance-and-class-attributes\n\ni would prefer if we did that espcially since you have not declared the types or the others inline.\n\nalternitivly you could just forawd declare the type instaed","commit_id":"51d16adda6c3324b95693c852232988b7bb2a781"},{"author":{"_account_id":15334,"name":"Stephen Finucane","display_name":"stephenfin","email":"stephenfin@redhat.com","username":"sfinucan"},"change_message_id":"0dfaf675caefe24543100050a688846450705414","unresolved":false,"context_lines":[{"line_number":266,"context_line":"        self.vendor_id \u003d self.tags.pop(\"vendor_id\", ANY)"},{"line_number":267,"context_line":"        self.product_id \u003d self.tags.pop(\"product_id\", ANY)"},{"line_number":268,"context_line":"        self.dev_name \u003d self.tags.pop(\"devname\", None)"},{"line_number":269,"context_line":"        self.address: ty.Optional[WhitelistPciAddress] \u003d None"},{"line_number":270,"context_line":"        # Note(moshele): The address attribute can be a string or a dict."},{"line_number":271,"context_line":"        # For glob syntax or specific pci it is a string and for regex syntax"},{"line_number":272,"context_line":"        # it is a dict. The WhitelistPciAddress class handles both types."},{"line_number":273,"context_line":"        address \u003d self.tags.pop(\"address\", None)"},{"line_number":274,"context_line":""},{"line_number":275,"context_line":"        self.vendor_id \u003d self.vendor_id.strip()"},{"line_number":276,"context_line":"        self._set_pci_dev_info(\u0027vendor_id\u0027, MAX_VENDOR_ID, \u0027%04x\u0027)"}],"source_content_type":"text/x-python","patch_set":22,"id":"754d67d4_2568efa0","line":273,"range":{"start_line":269,"start_character":7,"end_line":273,"end_character":48},"in_reply_to":"0cb501f4_168452cb","updated":"2021-04-28 09:50:02.000000000","message":"The \u0027address\u0027 attribute of \u0027self.tags\u0027 will be a string if it\u0027s present. However, we\u0027ll never use this string form. Instead, we\u0027ll always parse this (via the \u0027WhitelistPciAddress\u0027 constructor) and use the *parsed* form. If we continued to save this unparsed form to \u0027self.address\u0027 before updating it with the parsed form, our type hint would need to be:\n\n  ty.Union[WhitelistPciAddress, str, None]\n\nand everything that uses this attribute would need to start handling strings, even though at runtime they will never see a string here. This kind of thing affect us elsewhere. Take this example:\n\n  keep_going \u003d input(\u0027Enter yes to continue: \u0027)\n  keep_going \u003d keep_going \u003d\u003d \u0027yes\u0027\n\nIncluding type hints, we\u0027d get\n\n  keep_going: ty.Union[str, bool] \u003d input(\u0027Enter yes to continue: \u0027)\n  keep_going \u003d keep_going \u003d\u003d \u0027yes\u0027\n\nBut we\u0027ll never actually see a string after initial processing, so we can instead do:\n\n  _keep_going \u003d input(\u0027Enter yes to continue: \u0027)\n  keep_going: bool \u003d keep_going \u003d\u003d \u0027yes\u0027","commit_id":"51d16adda6c3324b95693c852232988b7bb2a781"},{"author":{"_account_id":11604,"name":"sean mooney","email":"smooney@redhat.com","username":"sean-k-mooney"},"change_message_id":"c22b5d68024b495be8b5a140af3b1a888c70da8c","unresolved":false,"context_lines":[{"line_number":266,"context_line":"        self.vendor_id \u003d self.tags.pop(\"vendor_id\", ANY)"},{"line_number":267,"context_line":"        self.product_id \u003d self.tags.pop(\"product_id\", ANY)"},{"line_number":268,"context_line":"        self.dev_name \u003d self.tags.pop(\"devname\", None)"},{"line_number":269,"context_line":"        self.address: ty.Optional[WhitelistPciAddress] \u003d None"},{"line_number":270,"context_line":"        # Note(moshele): The address attribute can be a string or a dict."},{"line_number":271,"context_line":"        # For glob syntax or specific pci it is a string and for regex syntax"},{"line_number":272,"context_line":"        # it is a dict. The WhitelistPciAddress class handles both types."},{"line_number":273,"context_line":"        address \u003d self.tags.pop(\"address\", None)"},{"line_number":274,"context_line":""},{"line_number":275,"context_line":"        self.vendor_id \u003d self.vendor_id.strip()"},{"line_number":276,"context_line":"        self._set_pci_dev_info(\u0027vendor_id\u0027, MAX_VENDOR_ID, \u0027%04x\u0027)"}],"source_content_type":"text/x-python","patch_set":22,"id":"03e109a9_13878a75","line":273,"range":{"start_line":269,"start_character":7,"end_line":273,"end_character":48},"in_reply_to":"754d67d4_2568efa0","updated":"2021-04-28 10:40:42.000000000","message":"ah ok yes tags is the raw dict we get back form calling loads i forgot that.","commit_id":"51d16adda6c3324b95693c852232988b7bb2a781"},{"author":{"_account_id":11604,"name":"sean mooney","email":"smooney@redhat.com","username":"sean-k-mooney"},"change_message_id":"3b454d00f43a4dc337b51fbda6122f3046aaae9b","unresolved":true,"context_lines":[{"line_number":279,"context_line":"        if address and self.dev_name:"},{"line_number":280,"context_line":"            raise exception.PciDeviceInvalidDeviceName()"},{"line_number":281,"context_line":""},{"line_number":282,"context_line":"        if not self.dev_name:"},{"line_number":283,"context_line":"            self.address \u003d WhitelistPciAddress(address or \u0027*:*:*.*\u0027, False)"},{"line_number":284,"context_line":""},{"line_number":285,"context_line":"    def match(self, dev_dict: ty.Dict[str, str]) -\u003e bool:"},{"line_number":286,"context_line":"        address_obj: ty.Optional[WhitelistPciAddress]"}],"source_content_type":"text/x-python","patch_set":22,"id":"b942cedc_4dd75048","line":283,"range":{"start_line":282,"start_character":1,"end_line":283,"end_character":75},"updated":"2021-04-27 12:03:49.000000000","message":"again you have refactored this.\n\nits logcialy the same behavior mor or less but it would have been better not to mix the too or at least call it out in the commit message.","commit_id":"51d16adda6c3324b95693c852232988b7bb2a781"},{"author":{"_account_id":11604,"name":"sean mooney","email":"smooney@redhat.com","username":"sean-k-mooney"},"change_message_id":"c22b5d68024b495be8b5a140af3b1a888c70da8c","unresolved":false,"context_lines":[{"line_number":279,"context_line":"        if address and self.dev_name:"},{"line_number":280,"context_line":"            raise exception.PciDeviceInvalidDeviceName()"},{"line_number":281,"context_line":""},{"line_number":282,"context_line":"        if not self.dev_name:"},{"line_number":283,"context_line":"            self.address \u003d WhitelistPciAddress(address or \u0027*:*:*.*\u0027, False)"},{"line_number":284,"context_line":""},{"line_number":285,"context_line":"    def match(self, dev_dict: ty.Dict[str, str]) -\u003e bool:"},{"line_number":286,"context_line":"        address_obj: ty.Optional[WhitelistPciAddress]"}],"source_content_type":"text/x-python","patch_set":22,"id":"ce9382a4_db3e3cae","line":283,"range":{"start_line":282,"start_character":1,"end_line":283,"end_character":75},"in_reply_to":"abf349cc_6dd8fbfe","updated":"2021-04-28 10:40:42.000000000","message":"ya makes sense","commit_id":"51d16adda6c3324b95693c852232988b7bb2a781"},{"author":{"_account_id":15334,"name":"Stephen Finucane","display_name":"stephenfin","email":"stephenfin@redhat.com","username":"sfinucan"},"change_message_id":"0dfaf675caefe24543100050a688846450705414","unresolved":false,"context_lines":[{"line_number":279,"context_line":"        if address and self.dev_name:"},{"line_number":280,"context_line":"            raise exception.PciDeviceInvalidDeviceName()"},{"line_number":281,"context_line":""},{"line_number":282,"context_line":"        if not self.dev_name:"},{"line_number":283,"context_line":"            self.address \u003d WhitelistPciAddress(address or \u0027*:*:*.*\u0027, False)"},{"line_number":284,"context_line":""},{"line_number":285,"context_line":"    def match(self, dev_dict: ty.Dict[str, str]) -\u003e bool:"},{"line_number":286,"context_line":"        address_obj: ty.Optional[WhitelistPciAddress]"}],"source_content_type":"text/x-python","patch_set":22,"id":"abf349cc_6dd8fbfe","line":283,"range":{"start_line":282,"start_character":1,"end_line":283,"end_character":75},"in_reply_to":"b942cedc_4dd75048","updated":"2021-04-28 09:50:02.000000000","message":"As above, I need to use two different variables which means I\u0027d have to change the assignment to \u0027pci_address\u0027 anyway. Since things can now fit on one line, I decided to do just that. I think that\u0027s reasonable.","commit_id":"51d16adda6c3324b95693c852232988b7bb2a781"},{"author":{"_account_id":11604,"name":"sean mooney","email":"smooney@redhat.com","username":"sean-k-mooney"},"change_message_id":"3b454d00f43a4dc337b51fbda6122f3046aaae9b","unresolved":true,"context_lines":[{"line_number":292,"context_line":"            # Note(moshele): In this case we always passing a string"},{"line_number":293,"context_line":"            # of the PF pci address"},{"line_number":294,"context_line":"            address_obj \u003d WhitelistPciAddress(address_str, pf)"},{"line_number":295,"context_line":"        else:  # use self.address"},{"line_number":296,"context_line":"            address_obj \u003d self.address"},{"line_number":297,"context_line":""},{"line_number":298,"context_line":"        if not address_obj:"}],"source_content_type":"text/x-python","patch_set":22,"id":"a7d346cc_d3eedd09","line":295,"range":{"start_line":295,"start_character":8,"end_line":295,"end_character":33},"updated":"2021-04-27 12:03:49.000000000","message":"this is also changing the  logic slightly but it may have been a bug before.\n\nits valid to not set devname or address and just define vendor id and product id.\n\nif neither self.address or self.address name was set before \n\naddress_obj woudl be undefined when its used on line 303 causing an attibute error.\n\nwhich you  have guarded against with the new if on line 298.\n\ni kind of feel like this refactoring and maybe the previous one should be pulled out into a seperate patch so we can backport them","commit_id":"51d16adda6c3324b95693c852232988b7bb2a781"},{"author":{"_account_id":11604,"name":"sean mooney","email":"smooney@redhat.com","username":"sean-k-mooney"},"change_message_id":"c22b5d68024b495be8b5a140af3b1a888c70da8c","unresolved":true,"context_lines":[{"line_number":292,"context_line":"            # Note(moshele): In this case we always passing a string"},{"line_number":293,"context_line":"            # of the PF pci address"},{"line_number":294,"context_line":"            address_obj \u003d WhitelistPciAddress(address_str, pf)"},{"line_number":295,"context_line":"        else:  # use self.address"},{"line_number":296,"context_line":"            address_obj \u003d self.address"},{"line_number":297,"context_line":""},{"line_number":298,"context_line":"        if not address_obj:"}],"source_content_type":"text/x-python","patch_set":22,"id":"895a2817_0d0172b6","line":295,"range":{"start_line":295,"start_character":8,"end_line":295,"end_character":33},"in_reply_to":"49ebd488_48e120d3","updated":"2021-04-28 10:40:42.000000000","message":"ya i think there was no current code path that would have triggered the bug and now it cant happen so i guess im ok with this and ya doing a stable only patch if it is needed.","commit_id":"51d16adda6c3324b95693c852232988b7bb2a781"},{"author":{"_account_id":15334,"name":"Stephen Finucane","display_name":"stephenfin","email":"stephenfin@redhat.com","username":"sfinucan"},"change_message_id":"0dfaf675caefe24543100050a688846450705414","unresolved":true,"context_lines":[{"line_number":292,"context_line":"            # Note(moshele): In this case we always passing a string"},{"line_number":293,"context_line":"            # of the PF pci address"},{"line_number":294,"context_line":"            address_obj \u003d WhitelistPciAddress(address_str, pf)"},{"line_number":295,"context_line":"        else:  # use self.address"},{"line_number":296,"context_line":"            address_obj \u003d self.address"},{"line_number":297,"context_line":""},{"line_number":298,"context_line":"        if not address_obj:"}],"source_content_type":"text/x-python","patch_set":22,"id":"49ebd488_48e120d3","line":295,"range":{"start_line":295,"start_character":8,"end_line":295,"end_character":33},"in_reply_to":"a7d346cc_d3eedd09","updated":"2021-04-28 09:50:02.000000000","message":"I could pull this particular one out, but this change has been around for so long that I really don\u0027t want to rework it any further /o\\ We can do a stable-only patch if anyone ever hits this (so far, no reports)","commit_id":"51d16adda6c3324b95693c852232988b7bb2a781"}],"nova/pci/manager.py":[{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"e57612460dc562947d193901d35025e4105a24a1","unresolved":true,"context_lines":[{"line_number":312,"context_line":"        instance_numa_topology: \u0027objects.InstanceNUMATopology\u0027,"},{"line_number":313,"context_line":"    ) -\u003e ty.Optional[ty.List[\u0027objects.PciDevice\u0027]]:"},{"line_number":314,"context_line":""},{"line_number":315,"context_line":"        devs: ty.Optional[ty.List[objects.PciDevice]] \u003d []"},{"line_number":316,"context_line":""},{"line_number":317,"context_line":"        if self.pci_devs and pci_requests.requests:"},{"line_number":318,"context_line":"            instance_uuid \u003d pci_requests.instance_uuid"}],"source_content_type":"text/x-python","patch_set":19,"id":"16898307_3db459c1","line":315,"updated":"2021-02-03 14:05:14.000000000","message":"I\u0027ve tried and I think mypy capable of deducing this from the definition of the return value of _claim_instance","commit_id":"dbb7901530d848596202315db1f4701b4eef8ed3"},{"author":{"_account_id":15334,"name":"Stephen Finucane","display_name":"stephenfin","email":"stephenfin@redhat.com","username":"sfinucan"},"change_message_id":"30af81a0291beee6b28e478cea425002302181f9","unresolved":false,"context_lines":[{"line_number":312,"context_line":"        instance_numa_topology: \u0027objects.InstanceNUMATopology\u0027,"},{"line_number":313,"context_line":"    ) -\u003e ty.Optional[ty.List[\u0027objects.PciDevice\u0027]]:"},{"line_number":314,"context_line":""},{"line_number":315,"context_line":"        devs: ty.Optional[ty.List[objects.PciDevice]] \u003d []"},{"line_number":316,"context_line":""},{"line_number":317,"context_line":"        if self.pci_devs and pci_requests.requests:"},{"line_number":318,"context_line":"            instance_uuid \u003d pci_requests.instance_uuid"}],"source_content_type":"text/x-python","patch_set":19,"id":"e17d8101_d7322d63","line":315,"in_reply_to":"16898307_3db459c1","updated":"2021-02-08 18:06:17.000000000","message":"Done","commit_id":"dbb7901530d848596202315db1f4701b4eef8ed3"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"e57612460dc562947d193901d35025e4105a24a1","unresolved":true,"context_lines":[{"line_number":323,"context_line":"        return devs"},{"line_number":324,"context_line":""},{"line_number":325,"context_line":"    def _allocate_instance("},{"line_number":326,"context_line":"        self, instance: \u0027objects.Instance\u0027, devs: \u0027objects.PciDevice\u0027"},{"line_number":327,"context_line":"    ) -\u003e None:"},{"line_number":328,"context_line":"        for dev in devs:"},{"line_number":329,"context_line":"            dev.allocate(instance)"}],"source_content_type":"text/x-python","patch_set":19,"id":"cc066739_db9af287","line":326,"range":{"start_line":326,"start_character":44,"end_line":326,"end_character":69},"updated":"2021-02-03 14:05:14.000000000","message":"this seems wrong, as below the code iterates it. I\u0027m wondering why mypy does not detect it","commit_id":"dbb7901530d848596202315db1f4701b4eef8ed3"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"66ce2f118278bc209c49c1f766546a3d13e1158f","unresolved":false,"context_lines":[{"line_number":323,"context_line":"        return devs"},{"line_number":324,"context_line":""},{"line_number":325,"context_line":"    def _allocate_instance("},{"line_number":326,"context_line":"        self, instance: \u0027objects.Instance\u0027, devs: \u0027objects.PciDevice\u0027"},{"line_number":327,"context_line":"    ) -\u003e None:"},{"line_number":328,"context_line":"        for dev in devs:"},{"line_number":329,"context_line":"            dev.allocate(instance)"}],"source_content_type":"text/x-python","patch_set":19,"id":"af02ad22_31fcb4ba","line":326,"range":{"start_line":326,"start_character":44,"end_line":326,"end_character":69},"in_reply_to":"c8ac68e7_2a03e51f","updated":"2021-02-09 13:15:06.000000000","message":"hm, that explains it. My brain had a hint about what objects.PciDevice is, but mypy does not have it.","commit_id":"dbb7901530d848596202315db1f4701b4eef8ed3"},{"author":{"_account_id":15334,"name":"Stephen Finucane","display_name":"stephenfin","email":"stephenfin@redhat.com","username":"sfinucan"},"change_message_id":"30af81a0291beee6b28e478cea425002302181f9","unresolved":false,"context_lines":[{"line_number":323,"context_line":"        return devs"},{"line_number":324,"context_line":""},{"line_number":325,"context_line":"    def _allocate_instance("},{"line_number":326,"context_line":"        self, instance: \u0027objects.Instance\u0027, devs: \u0027objects.PciDevice\u0027"},{"line_number":327,"context_line":"    ) -\u003e None:"},{"line_number":328,"context_line":"        for dev in devs:"},{"line_number":329,"context_line":"            dev.allocate(instance)"}],"source_content_type":"text/x-python","patch_set":19,"id":"c8ac68e7_2a03e51f","line":326,"range":{"start_line":326,"start_character":44,"end_line":326,"end_character":69},"in_reply_to":"cc066739_db9af287","updated":"2021-02-08 18:06:17.000000000","message":"Anything we don\u0027t have type hints for is effectively typing.ANY and isn\u0027t really inspected. It has to be that way since mypy has no idea what it actually is (\u0027objects.PciDevice\u0027 could be a subclass of a str, dict, object, whatever...)","commit_id":"dbb7901530d848596202315db1f4701b4eef8ed3"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"e57612460dc562947d193901d35025e4105a24a1","unresolved":true,"context_lines":[{"line_number":329,"context_line":"            dev.allocate(instance)"},{"line_number":330,"context_line":""},{"line_number":331,"context_line":"    def allocate_instance(self, instance: \u0027objects.Instance\u0027) -\u003e None:"},{"line_number":332,"context_line":"        devs \u003d self.claims.pop(instance[\u0027uuid\u0027], [])"},{"line_number":333,"context_line":"        self._allocate_instance(instance, devs)"},{"line_number":334,"context_line":"        if devs:"},{"line_number":335,"context_line":"            self.allocations[instance[\u0027uuid\u0027]] +\u003d devs"}],"source_content_type":"text/x-python","patch_set":19,"id":"17eff0eb_3c222155","line":332,"range":{"start_line":332,"start_character":8,"end_line":332,"end_character":52},"updated":"2021-02-03 14:05:14.000000000","message":"self.claims is ty.DefaultDict[str, ty.List[\u0027objects.PciDevice\u0027]] so devs here ty.List[\u0027objects.PciDevice\u0027] but then passing it to _allocate_instance() should raise a mypy error as that call does not take a list but takes a single device. Do we have a mypy bug here?","commit_id":"dbb7901530d848596202315db1f4701b4eef8ed3"},{"author":{"_account_id":15334,"name":"Stephen Finucane","display_name":"stephenfin","email":"stephenfin@redhat.com","username":"sfinucan"},"change_message_id":"30af81a0291beee6b28e478cea425002302181f9","unresolved":true,"context_lines":[{"line_number":329,"context_line":"            dev.allocate(instance)"},{"line_number":330,"context_line":""},{"line_number":331,"context_line":"    def allocate_instance(self, instance: \u0027objects.Instance\u0027) -\u003e None:"},{"line_number":332,"context_line":"        devs \u003d self.claims.pop(instance[\u0027uuid\u0027], [])"},{"line_number":333,"context_line":"        self._allocate_instance(instance, devs)"},{"line_number":334,"context_line":"        if devs:"},{"line_number":335,"context_line":"            self.allocations[instance[\u0027uuid\u0027]] +\u003d devs"}],"source_content_type":"text/x-python","patch_set":19,"id":"3706472b_c7ad7165","line":332,"range":{"start_line":332,"start_character":8,"end_line":332,"end_character":52},"in_reply_to":"17eff0eb_3c222155","updated":"2021-02-08 18:06:17.000000000","message":"Yeah, this is weird. I\u0027m not sure why it can\u0027t tell that at least what we\u0027re popping is a list","commit_id":"dbb7901530d848596202315db1f4701b4eef8ed3"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"e57612460dc562947d193901d35025e4105a24a1","unresolved":true,"context_lines":[{"line_number":371,"context_line":"                pci_mapping.pop(instance_uuid, None)"},{"line_number":372,"context_line":""},{"line_number":373,"context_line":"    def _free_device("},{"line_number":374,"context_line":"        self, dev: \u0027objects.PciDevice\u0027, instance: \u0027objects.Instance\u0027 \u003d None,"},{"line_number":375,"context_line":"    ) -\u003e None:"},{"line_number":376,"context_line":"        freed_devs \u003d dev.free(instance)"},{"line_number":377,"context_line":"        stale \u003d self.stale.pop(dev.address, None)"}],"source_content_type":"text/x-python","patch_set":19,"id":"af61fe23_dcaf65c2","line":374,"range":{"start_line":374,"start_character":40,"end_line":374,"end_character":75},"updated":"2021-02-03 14:05:14.000000000","message":"so this is a shorthand for : ty.Optional[\u0027objects.Intance\u0027]","commit_id":"dbb7901530d848596202315db1f4701b4eef8ed3"},{"author":{"_account_id":15334,"name":"Stephen Finucane","display_name":"stephenfin","email":"stephenfin@redhat.com","username":"sfinucan"},"change_message_id":"30af81a0291beee6b28e478cea425002302181f9","unresolved":false,"context_lines":[{"line_number":371,"context_line":"                pci_mapping.pop(instance_uuid, None)"},{"line_number":372,"context_line":""},{"line_number":373,"context_line":"    def _free_device("},{"line_number":374,"context_line":"        self, dev: \u0027objects.PciDevice\u0027, instance: \u0027objects.Instance\u0027 \u003d None,"},{"line_number":375,"context_line":"    ) -\u003e None:"},{"line_number":376,"context_line":"        freed_devs \u003d dev.free(instance)"},{"line_number":377,"context_line":"        stale \u003d self.stale.pop(dev.address, None)"}],"source_content_type":"text/x-python","patch_set":19,"id":"2ad185b6_31204b67","line":374,"range":{"start_line":374,"start_character":40,"end_line":374,"end_character":75},"in_reply_to":"af61fe23_dcaf65c2","updated":"2021-02-08 18:06:17.000000000","message":"Indeed","commit_id":"dbb7901530d848596202315db1f4701b4eef8ed3"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"e57612460dc562947d193901d35025e4105a24a1","unresolved":true,"context_lines":[{"line_number":470,"context_line":""},{"line_number":471,"context_line":""},{"line_number":472,"context_line":"def get_instance_pci_devs("},{"line_number":473,"context_line":"    inst: \u0027objects.Instance\u0027, request_id: ty.Optional[str] \u003d None,"},{"line_number":474,"context_line":") -\u003e ty.List[\u0027objects.PciDevice\u0027]:"},{"line_number":475,"context_line":"    \"\"\"Get the devices allocated to one or all requests for an instance."},{"line_number":476,"context_line":""}],"source_content_type":"text/x-python","patch_set":19,"id":"fb134df4_4def9fa9","line":473,"range":{"start_line":473,"start_character":42,"end_line":473,"end_character":65},"updated":"2021-02-03 14:05:14.000000000","message":"I saw somewhere before that in this case \u003cparam\u003e: str \u003d None was valid too","commit_id":"dbb7901530d848596202315db1f4701b4eef8ed3"},{"author":{"_account_id":15334,"name":"Stephen Finucane","display_name":"stephenfin","email":"stephenfin@redhat.com","username":"sfinucan"},"change_message_id":"30af81a0291beee6b28e478cea425002302181f9","unresolved":false,"context_lines":[{"line_number":470,"context_line":""},{"line_number":471,"context_line":""},{"line_number":472,"context_line":"def get_instance_pci_devs("},{"line_number":473,"context_line":"    inst: \u0027objects.Instance\u0027, request_id: ty.Optional[str] \u003d None,"},{"line_number":474,"context_line":") -\u003e ty.List[\u0027objects.PciDevice\u0027]:"},{"line_number":475,"context_line":"    \"\"\"Get the devices allocated to one or all requests for an instance."},{"line_number":476,"context_line":""}],"source_content_type":"text/x-python","patch_set":19,"id":"3a0e658d_34dc97ec","line":473,"range":{"start_line":473,"start_character":42,"end_line":473,"end_character":65},"in_reply_to":"fb134df4_4def9fa9","updated":"2021-02-08 18:06:17.000000000","message":"Done","commit_id":"dbb7901530d848596202315db1f4701b4eef8ed3"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"66ce2f118278bc209c49c1f766546a3d13e1158f","unresolved":true,"context_lines":[{"line_number":59,"context_line":"        and the resource tracker will update the node_id information later."},{"line_number":60,"context_line":"        \"\"\""},{"line_number":61,"context_line":""},{"line_number":62,"context_line":"        super(PciDevTracker, self).__init__()"},{"line_number":63,"context_line":"        self.stale \u003d {}"},{"line_number":64,"context_line":"        self.node_id \u003d node_id"},{"line_number":65,"context_line":"        self.dev_filter \u003d whitelist.Whitelist(CONF.pci.passthrough_whitelist)"}],"source_content_type":"text/x-python","patch_set":20,"id":"b3a9fb79_feac6942","side":"PARENT","line":62,"updated":"2021-02-09 13:15:06.000000000","message":"ack, this was noop anyhow as the base class is just obj","commit_id":"66eb8e4e24b1866a01257ff28164f430cfd67f03"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"66ce2f118278bc209c49c1f766546a3d13e1158f","unresolved":true,"context_lines":[{"line_number":293,"context_line":"        devs \u003d self.stats.consume_requests(pci_requests.requests,"},{"line_number":294,"context_line":"                                           instance_cells)"},{"line_number":295,"context_line":"        if not devs:"},{"line_number":296,"context_line":"            return []"},{"line_number":297,"context_line":""},{"line_number":298,"context_line":"        instance_uuid \u003d pci_requests.instance_uuid"},{"line_number":299,"context_line":"        for dev in devs:"}],"source_content_type":"text/x-python","patch_set":20,"id":"95766a3f_3c691169","line":296,"updated":"2021-02-09 13:15:06.000000000","message":"it is a small logic change that is well handled by the caller claim_instance() so it is OK","commit_id":"7b5a2069a21903889766e5ea656bb2c3eca53f1a"},{"author":{"_account_id":11604,"name":"sean mooney","email":"smooney@redhat.com","username":"sean-k-mooney"},"change_message_id":"3b454d00f43a4dc337b51fbda6122f3046aaae9b","unresolved":true,"context_lines":[{"line_number":67,"context_line":"        :param compute_node: The object.ComputeNode whose PCI devices we\u0027re"},{"line_number":68,"context_line":"                             tracking."},{"line_number":69,"context_line":"        \"\"\""},{"line_number":70,"context_line":"        self.stale: ty.Dict[str, objects.PciDevice] \u003d {}"},{"line_number":71,"context_line":"        self.node_id: str \u003d compute_node.id"},{"line_number":72,"context_line":"        self.dev_filter \u003d whitelist.Whitelist(CONF.pci.passthrough_whitelist)"},{"line_number":73,"context_line":"        numa_topology \u003d compute_node.numa_topology"}],"source_content_type":"text/x-python","patch_set":22,"id":"c3ee9426_ff36b0cd","line":70,"range":{"start_line":70,"start_character":33,"end_line":70,"end_character":50},"updated":"2021-04-27 12:03:49.000000000","message":"does this actully work?\ni was expecting you to have to do somethign like \nty.Dict[str, \u0027objects.PciDevice\u0027]","commit_id":"51d16adda6c3324b95693c852232988b7bb2a781"},{"author":{"_account_id":11604,"name":"sean mooney","email":"smooney@redhat.com","username":"sean-k-mooney"},"change_message_id":"c22b5d68024b495be8b5a140af3b1a888c70da8c","unresolved":false,"context_lines":[{"line_number":67,"context_line":"        :param compute_node: The object.ComputeNode whose PCI devices we\u0027re"},{"line_number":68,"context_line":"                             tracking."},{"line_number":69,"context_line":"        \"\"\""},{"line_number":70,"context_line":"        self.stale: ty.Dict[str, objects.PciDevice] \u003d {}"},{"line_number":71,"context_line":"        self.node_id: str \u003d compute_node.id"},{"line_number":72,"context_line":"        self.dev_filter \u003d whitelist.Whitelist(CONF.pci.passthrough_whitelist)"},{"line_number":73,"context_line":"        numa_topology \u003d compute_node.numa_topology"}],"source_content_type":"text/x-python","patch_set":22,"id":"5034b004_6e701429","line":70,"range":{"start_line":70,"start_character":33,"end_line":70,"end_character":50},"in_reply_to":"62f8cf4f_5362ceb0","updated":"2021-04-28 10:40:42.000000000","message":"oh because its in the body of the function not in its signture so its not parsed wehn teh module is loaded im guessing ok","commit_id":"51d16adda6c3324b95693c852232988b7bb2a781"},{"author":{"_account_id":15334,"name":"Stephen Finucane","display_name":"stephenfin","email":"stephenfin@redhat.com","username":"sfinucan"},"change_message_id":"0dfaf675caefe24543100050a688846450705414","unresolved":false,"context_lines":[{"line_number":67,"context_line":"        :param compute_node: The object.ComputeNode whose PCI devices we\u0027re"},{"line_number":68,"context_line":"                             tracking."},{"line_number":69,"context_line":"        \"\"\""},{"line_number":70,"context_line":"        self.stale: ty.Dict[str, objects.PciDevice] \u003d {}"},{"line_number":71,"context_line":"        self.node_id: str \u003d compute_node.id"},{"line_number":72,"context_line":"        self.dev_filter \u003d whitelist.Whitelist(CONF.pci.passthrough_whitelist)"},{"line_number":73,"context_line":"        numa_topology \u003d compute_node.numa_topology"}],"source_content_type":"text/x-python","patch_set":22,"id":"62f8cf4f_5362ceb0","line":70,"range":{"start_line":70,"start_character":33,"end_line":70,"end_character":50},"in_reply_to":"c3ee9426_ff36b0cd","updated":"2021-04-28 09:50:02.000000000","message":"Weirdly, yes. To the best of my knowledge, this is because this type hint is only executed at \"runtime\" rather than \"compile time\". At runtime, \u0027nova.objects.register_all\u0027 will have been called.","commit_id":"51d16adda6c3324b95693c852232988b7bb2a781"},{"author":{"_account_id":11604,"name":"sean mooney","email":"smooney@redhat.com","username":"sean-k-mooney"},"change_message_id":"3b454d00f43a4dc337b51fbda6122f3046aaae9b","unresolved":true,"context_lines":[{"line_number":169,"context_line":"        self._set_hvdevs(devices)"},{"line_number":170,"context_line":""},{"line_number":171,"context_line":"    @staticmethod"},{"line_number":172,"context_line":"    def _build_device_tree(all_devs: ty.List[\u0027objects.PciDevice\u0027]) -\u003e None:"},{"line_number":173,"context_line":"        \"\"\"Build a tree of devices that represents parent-child relationships."},{"line_number":174,"context_line":""},{"line_number":175,"context_line":"        We need to have the relationships set up so that we can easily make"}],"source_content_type":"text/x-python","patch_set":22,"id":"9412e686_800ed6ee","line":172,"range":{"start_line":172,"start_character":37,"end_line":172,"end_character":65},"updated":"2021-04-27 12:03:49.000000000","message":"maybe forward declare this too as a PciDeviceListType\nwhich you can reuse in your other forward declartions","commit_id":"51d16adda6c3324b95693c852232988b7bb2a781"},{"author":{"_account_id":11604,"name":"sean mooney","email":"smooney@redhat.com","username":"sean-k-mooney"},"change_message_id":"c22b5d68024b495be8b5a140af3b1a888c70da8c","unresolved":true,"context_lines":[{"line_number":169,"context_line":"        self._set_hvdevs(devices)"},{"line_number":170,"context_line":""},{"line_number":171,"context_line":"    @staticmethod"},{"line_number":172,"context_line":"    def _build_device_tree(all_devs: ty.List[\u0027objects.PciDevice\u0027]) -\u003e None:"},{"line_number":173,"context_line":"        \"\"\"Build a tree of devices that represents parent-child relationships."},{"line_number":174,"context_line":""},{"line_number":175,"context_line":"        We need to have the relationships set up so that we can easily make"}],"source_content_type":"text/x-python","patch_set":22,"id":"70c690fe_1a32f8da","line":172,"range":{"start_line":172,"start_character":37,"end_line":172,"end_character":65},"in_reply_to":"0f9db15a_c4ded028","updated":"2021-04-28 10:40:42.000000000","message":"ya it can be in a followup the -1 was mainly for the possible bug but i agree its unlikely anyone will hit that so we can do a stable only patch if needed.\nthis was more of a nit then anything else so im ok with this as is.","commit_id":"51d16adda6c3324b95693c852232988b7bb2a781"},{"author":{"_account_id":15334,"name":"Stephen Finucane","display_name":"stephenfin","email":"stephenfin@redhat.com","username":"sfinucan"},"change_message_id":"0dfaf675caefe24543100050a688846450705414","unresolved":true,"context_lines":[{"line_number":169,"context_line":"        self._set_hvdevs(devices)"},{"line_number":170,"context_line":""},{"line_number":171,"context_line":"    @staticmethod"},{"line_number":172,"context_line":"    def _build_device_tree(all_devs: ty.List[\u0027objects.PciDevice\u0027]) -\u003e None:"},{"line_number":173,"context_line":"        \"\"\"Build a tree of devices that represents parent-child relationships."},{"line_number":174,"context_line":""},{"line_number":175,"context_line":"        We need to have the relationships set up so that we can easily make"}],"source_content_type":"text/x-python","patch_set":22,"id":"0f9db15a_c4ded028","line":172,"range":{"start_line":172,"start_character":37,"end_line":172,"end_character":65},"in_reply_to":"9412e686_800ed6ee","updated":"2021-04-28 09:50:02.000000000","message":"Not a bad idea, though this is arguably simple enough to keep standalone. Let\u0027s tackle it in a follow-up?","commit_id":"51d16adda6c3324b95693c852232988b7bb2a781"},{"author":{"_account_id":11604,"name":"sean mooney","email":"smooney@redhat.com","username":"sean-k-mooney"},"change_message_id":"3b454d00f43a4dc337b51fbda6122f3046aaae9b","unresolved":true,"context_lines":[{"line_number":292,"context_line":"        context: ctx.RequestContext,"},{"line_number":293,"context_line":"        pci_requests: \u0027objects.InstancePCIRequests\u0027,"},{"line_number":294,"context_line":"        instance_numa_topology: \u0027objects.InstanceNUMATopology\u0027,"},{"line_number":295,"context_line":"    ) -\u003e ty.List[\u0027objects.PciDevice\u0027]:"},{"line_number":296,"context_line":"        instance_cells \u003d None"},{"line_number":297,"context_line":"        if instance_numa_topology:"},{"line_number":298,"context_line":"            instance_cells \u003d instance_numa_topology.cells"}],"source_content_type":"text/x-python","patch_set":22,"id":"6afe6c03_d0cc3a9c","line":295,"range":{"start_line":295,"start_character":9,"end_line":295,"end_character":37},"updated":"2021-04-27 12:03:49.000000000","message":"PciDeviceListType","commit_id":"51d16adda6c3324b95693c852232988b7bb2a781"},{"author":{"_account_id":11604,"name":"sean mooney","email":"smooney@redhat.com","username":"sean-k-mooney"},"change_message_id":"c22b5d68024b495be8b5a140af3b1a888c70da8c","unresolved":true,"context_lines":[{"line_number":292,"context_line":"        context: ctx.RequestContext,"},{"line_number":293,"context_line":"        pci_requests: \u0027objects.InstancePCIRequests\u0027,"},{"line_number":294,"context_line":"        instance_numa_topology: \u0027objects.InstanceNUMATopology\u0027,"},{"line_number":295,"context_line":"    ) -\u003e ty.List[\u0027objects.PciDevice\u0027]:"},{"line_number":296,"context_line":"        instance_cells \u003d None"},{"line_number":297,"context_line":"        if instance_numa_topology:"},{"line_number":298,"context_line":"            instance_cells \u003d instance_numa_topology.cells"}],"source_content_type":"text/x-python","patch_set":22,"id":"56caa56c_2db69778","line":295,"range":{"start_line":295,"start_character":9,"end_line":295,"end_character":37},"in_reply_to":"5e5fd220_580a97f8","updated":"2021-04-28 10:40:42.000000000","message":"yep","commit_id":"51d16adda6c3324b95693c852232988b7bb2a781"},{"author":{"_account_id":15334,"name":"Stephen Finucane","display_name":"stephenfin","email":"stephenfin@redhat.com","username":"sfinucan"},"change_message_id":"0dfaf675caefe24543100050a688846450705414","unresolved":true,"context_lines":[{"line_number":292,"context_line":"        context: ctx.RequestContext,"},{"line_number":293,"context_line":"        pci_requests: \u0027objects.InstancePCIRequests\u0027,"},{"line_number":294,"context_line":"        instance_numa_topology: \u0027objects.InstanceNUMATopology\u0027,"},{"line_number":295,"context_line":"    ) -\u003e ty.List[\u0027objects.PciDevice\u0027]:"},{"line_number":296,"context_line":"        instance_cells \u003d None"},{"line_number":297,"context_line":"        if instance_numa_topology:"},{"line_number":298,"context_line":"            instance_cells \u003d instance_numa_topology.cells"}],"source_content_type":"text/x-python","patch_set":22,"id":"5e5fd220_580a97f8","line":295,"range":{"start_line":295,"start_character":9,"end_line":295,"end_character":37},"in_reply_to":"6afe6c03_d0cc3a9c","updated":"2021-04-28 09:50:02.000000000","message":"Ditto. Follow-up okay?","commit_id":"51d16adda6c3324b95693c852232988b7bb2a781"},{"author":{"_account_id":11604,"name":"sean mooney","email":"smooney@redhat.com","username":"sean-k-mooney"},"change_message_id":"3b454d00f43a4dc337b51fbda6122f3046aaae9b","unresolved":true,"context_lines":[{"line_number":317,"context_line":"        context: ctx.RequestContext,"},{"line_number":318,"context_line":"        pci_requests: \u0027objects.InstancePCIRequests\u0027,"},{"line_number":319,"context_line":"        instance_numa_topology: \u0027objects.InstanceNUMATopology\u0027,"},{"line_number":320,"context_line":"    ) -\u003e ty.List[\u0027objects.PciDevice\u0027]:"},{"line_number":321,"context_line":""},{"line_number":322,"context_line":"        devs \u003d []"},{"line_number":323,"context_line":""}],"source_content_type":"text/x-python","patch_set":22,"id":"8d27b3fc_ef807082","line":320,"range":{"start_line":320,"start_character":8,"end_line":320,"end_character":37},"updated":"2021-04-27 12:03:49.000000000","message":"PciDeviceListType\n\nyou get the idea. this is one of the voclary type we use in lots of places in this module so it proably makes sense to have it defiend. ill stop commenting on it.","commit_id":"51d16adda6c3324b95693c852232988b7bb2a781"},{"author":{"_account_id":15334,"name":"Stephen Finucane","display_name":"stephenfin","email":"stephenfin@redhat.com","username":"sfinucan"},"change_message_id":"0dfaf675caefe24543100050a688846450705414","unresolved":false,"context_lines":[{"line_number":317,"context_line":"        context: ctx.RequestContext,"},{"line_number":318,"context_line":"        pci_requests: \u0027objects.InstancePCIRequests\u0027,"},{"line_number":319,"context_line":"        instance_numa_topology: \u0027objects.InstanceNUMATopology\u0027,"},{"line_number":320,"context_line":"    ) -\u003e ty.List[\u0027objects.PciDevice\u0027]:"},{"line_number":321,"context_line":""},{"line_number":322,"context_line":"        devs \u003d []"},{"line_number":323,"context_line":""}],"source_content_type":"text/x-python","patch_set":22,"id":"d08a8194_775c9e99","line":320,"range":{"start_line":320,"start_character":8,"end_line":320,"end_character":37},"in_reply_to":"8d27b3fc_ef807082","updated":"2021-04-28 09:50:02.000000000","message":"Ack","commit_id":"51d16adda6c3324b95693c852232988b7bb2a781"}],"nova/pci/request.py":[{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"e57612460dc562947d193901d35025e4105a24a1","unresolved":true,"context_lines":[{"line_number":107,"context_line":"    \"\"\"Parse and validate PCI aliases from the nova config."},{"line_number":108,"context_line":""},{"line_number":109,"context_line":"    :returns: A dictionary where the keys are device names and the values are"},{"line_number":110,"context_line":"        tuples of form ``(numa_policy, specs)``. ``numa_policy`` describes the"},{"line_number":111,"context_line":"        required NUMA affinity of the device(s), while ``specs`` is a list of"},{"line_number":112,"context_line":"        PCI device specs."},{"line_number":113,"context_line":"    :raises: exception.PciInvalidAlias if two aliases with the same name have"}],"source_content_type":"text/x-python","patch_set":19,"id":"337fb900_445a717b","line":110,"range":{"start_line":110,"start_character":24,"end_line":110,"end_character":47},"updated":"2021-02-03 14:05:14.000000000","message":"good catch!","commit_id":"dbb7901530d848596202315db1f4701b4eef8ed3"},{"author":{"_account_id":15334,"name":"Stephen Finucane","display_name":"stephenfin","email":"stephenfin@redhat.com","username":"sfinucan"},"change_message_id":"30af81a0291beee6b28e478cea425002302181f9","unresolved":false,"context_lines":[{"line_number":107,"context_line":"    \"\"\"Parse and validate PCI aliases from the nova config."},{"line_number":108,"context_line":""},{"line_number":109,"context_line":"    :returns: A dictionary where the keys are device names and the values are"},{"line_number":110,"context_line":"        tuples of form ``(numa_policy, specs)``. ``numa_policy`` describes the"},{"line_number":111,"context_line":"        required NUMA affinity of the device(s), while ``specs`` is a list of"},{"line_number":112,"context_line":"        PCI device specs."},{"line_number":113,"context_line":"    :raises: exception.PciInvalidAlias if two aliases with the same name have"}],"source_content_type":"text/x-python","patch_set":19,"id":"dfcb8a4d_e028248d","line":110,"range":{"start_line":110,"start_character":24,"end_line":110,"end_character":47},"in_reply_to":"337fb900_445a717b","updated":"2021-02-08 18:06:17.000000000","message":"Ack","commit_id":"dbb7901530d848596202315db1f4701b4eef8ed3"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"e57612460dc562947d193901d35025e4105a24a1","unresolved":true,"context_lines":[{"line_number":154,"context_line":""},{"line_number":155,"context_line":""},{"line_number":156,"context_line":"def _translate_alias_to_requests("},{"line_number":157,"context_line":"    alias_spec: str, affinity_policy: ty.Optional[str] \u003d None,"},{"line_number":158,"context_line":") -\u003e ty.List[\u0027objects.InstancePCIRequest\u0027]:"},{"line_number":159,"context_line":"    \"\"\"Generate complete pci requests from pci aliases in extra_spec.\"\"\""},{"line_number":160,"context_line":"    pci_aliases \u003d _get_alias_from_config()"}],"source_content_type":"text/x-python","patch_set":19,"id":"eed3705c_609cbb69","line":157,"range":{"start_line":157,"start_character":38,"end_line":157,"end_character":49},"updated":"2021-02-03 14:05:14.000000000","message":"I think we can drop Optional here as it is deduced from the default value","commit_id":"dbb7901530d848596202315db1f4701b4eef8ed3"},{"author":{"_account_id":15334,"name":"Stephen Finucane","display_name":"stephenfin","email":"stephenfin@redhat.com","username":"sfinucan"},"change_message_id":"30af81a0291beee6b28e478cea425002302181f9","unresolved":false,"context_lines":[{"line_number":154,"context_line":""},{"line_number":155,"context_line":""},{"line_number":156,"context_line":"def _translate_alias_to_requests("},{"line_number":157,"context_line":"    alias_spec: str, affinity_policy: ty.Optional[str] \u003d None,"},{"line_number":158,"context_line":") -\u003e ty.List[\u0027objects.InstancePCIRequest\u0027]:"},{"line_number":159,"context_line":"    \"\"\"Generate complete pci requests from pci aliases in extra_spec.\"\"\""},{"line_number":160,"context_line":"    pci_aliases \u003d _get_alias_from_config()"}],"source_content_type":"text/x-python","patch_set":19,"id":"ef370792_ccde27f4","line":157,"range":{"start_line":157,"start_character":38,"end_line":157,"end_character":49},"in_reply_to":"eed3705c_609cbb69","updated":"2021-02-08 18:06:17.000000000","message":"Done","commit_id":"dbb7901530d848596202315db1f4701b4eef8ed3"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"e57612460dc562947d193901d35025e4105a24a1","unresolved":true,"context_lines":[{"line_number":239,"context_line":""},{"line_number":240,"context_line":""},{"line_number":241,"context_line":"def get_pci_requests_from_flavor("},{"line_number":242,"context_line":"    flavor: \u0027objects.Flavor\u0027, affinity_policy: ty.Optional[str] \u003d None,"},{"line_number":243,"context_line":") -\u003e \u0027objects.InstancePCIRequests\u0027:"},{"line_number":244,"context_line":"    \"\"\"Validate and return PCI requests."},{"line_number":245,"context_line":""}],"source_content_type":"text/x-python","patch_set":19,"id":"8b727e94_f6ce1c87","line":242,"range":{"start_line":242,"start_character":50,"end_line":242,"end_character":58},"updated":"2021-02-03 14:05:14.000000000","message":"ditto","commit_id":"dbb7901530d848596202315db1f4701b4eef8ed3"},{"author":{"_account_id":15334,"name":"Stephen Finucane","display_name":"stephenfin","email":"stephenfin@redhat.com","username":"sfinucan"},"change_message_id":"30af81a0291beee6b28e478cea425002302181f9","unresolved":false,"context_lines":[{"line_number":239,"context_line":""},{"line_number":240,"context_line":""},{"line_number":241,"context_line":"def get_pci_requests_from_flavor("},{"line_number":242,"context_line":"    flavor: \u0027objects.Flavor\u0027, affinity_policy: ty.Optional[str] \u003d None,"},{"line_number":243,"context_line":") -\u003e \u0027objects.InstancePCIRequests\u0027:"},{"line_number":244,"context_line":"    \"\"\"Validate and return PCI requests."},{"line_number":245,"context_line":""}],"source_content_type":"text/x-python","patch_set":19,"id":"7af5b0e1_b661fcd2","line":242,"range":{"start_line":242,"start_character":50,"end_line":242,"end_character":58},"in_reply_to":"8b727e94_f6ce1c87","updated":"2021-02-08 18:06:17.000000000","message":"Done","commit_id":"dbb7901530d848596202315db1f4701b4eef8ed3"}],"nova/pci/stats.py":[{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"e57612460dc562947d193901d35025e4105a24a1","unresolved":true,"context_lines":[{"line_number":76,"context_line":"            CONF.pci.passthrough_whitelist)"},{"line_number":77,"context_line":""},{"line_number":78,"context_line":"    def _equal_properties("},{"line_number":79,"context_line":"        self, dev: Pool, entry: Pool, matching_keys: ty.List,"},{"line_number":80,"context_line":"    ) -\u003e bool:"},{"line_number":81,"context_line":"        return all(dev.get(prop) \u003d\u003d entry.get(prop)"},{"line_number":82,"context_line":"                   for prop in matching_keys)"}],"source_content_type":"text/x-python","patch_set":19,"id":"6323dd9e_afc145b5","line":79,"range":{"start_line":79,"start_character":56,"end_line":79,"end_character":60},"updated":"2021-02-03 14:05:14.000000000","message":"could this be ty.List[str] ?","commit_id":"dbb7901530d848596202315db1f4701b4eef8ed3"},{"author":{"_account_id":15334,"name":"Stephen Finucane","display_name":"stephenfin","email":"stephenfin@redhat.com","username":"sfinucan"},"change_message_id":"30af81a0291beee6b28e478cea425002302181f9","unresolved":false,"context_lines":[{"line_number":76,"context_line":"            CONF.pci.passthrough_whitelist)"},{"line_number":77,"context_line":""},{"line_number":78,"context_line":"    def _equal_properties("},{"line_number":79,"context_line":"        self, dev: Pool, entry: Pool, matching_keys: ty.List,"},{"line_number":80,"context_line":"    ) -\u003e bool:"},{"line_number":81,"context_line":"        return all(dev.get(prop) \u003d\u003d entry.get(prop)"},{"line_number":82,"context_line":"                   for prop in matching_keys)"}],"source_content_type":"text/x-python","patch_set":19,"id":"9f6fbc5f_450ace46","line":79,"range":{"start_line":79,"start_character":56,"end_line":79,"end_character":60},"in_reply_to":"6323dd9e_afc145b5","updated":"2021-02-08 18:06:17.000000000","message":"Oh, so it can. Done","commit_id":"dbb7901530d848596202315db1f4701b4eef8ed3"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"e57612460dc562947d193901d35025e4105a24a1","unresolved":true,"context_lines":[{"line_number":122,"context_line":""},{"line_number":123,"context_line":"    def _get_pool_with_device_type_mismatch("},{"line_number":124,"context_line":"        self, dev: \u0027objects.PciDevice\u0027,"},{"line_number":125,"context_line":"    ) -\u003e ty.Optional[ty.Tuple[ty.Dict, \u0027objects.PciDevice\u0027]]:"},{"line_number":126,"context_line":"        \"\"\"Check for device type mismatch in the pools for a given device."},{"line_number":127,"context_line":""},{"line_number":128,"context_line":"        Return (pool, device) if device type does not match or a single None"}],"source_content_type":"text/x-python","patch_set":19,"id":"73d4c99e_c4f7e157","line":125,"range":{"start_line":125,"start_character":30,"end_line":125,"end_character":37},"updated":"2021-02-03 14:05:14.000000000","message":"is it a Pool?","commit_id":"dbb7901530d848596202315db1f4701b4eef8ed3"},{"author":{"_account_id":15334,"name":"Stephen Finucane","display_name":"stephenfin","email":"stephenfin@redhat.com","username":"sfinucan"},"change_message_id":"30af81a0291beee6b28e478cea425002302181f9","unresolved":false,"context_lines":[{"line_number":122,"context_line":""},{"line_number":123,"context_line":"    def _get_pool_with_device_type_mismatch("},{"line_number":124,"context_line":"        self, dev: \u0027objects.PciDevice\u0027,"},{"line_number":125,"context_line":"    ) -\u003e ty.Optional[ty.Tuple[ty.Dict, \u0027objects.PciDevice\u0027]]:"},{"line_number":126,"context_line":"        \"\"\"Check for device type mismatch in the pools for a given device."},{"line_number":127,"context_line":""},{"line_number":128,"context_line":"        Return (pool, device) if device type does not match or a single None"}],"source_content_type":"text/x-python","patch_set":19,"id":"649b96cc_2d392660","line":125,"range":{"start_line":125,"start_character":30,"end_line":125,"end_character":37},"in_reply_to":"73d4c99e_c4f7e157","updated":"2021-02-08 18:06:17.000000000","message":"Yes, it is. Good catch","commit_id":"dbb7901530d848596202315db1f4701b4eef8ed3"},{"author":{"_account_id":10135,"name":"Lee Yarwood","display_name":"Lee Yarwood","email":"lyarwood@redhat.com","username":"lyarwood"},"change_message_id":"8baca0776a4d17712adf79b6012c0b44ac3edbd8","unresolved":false,"context_lines":[{"line_number":32,"context_line":""},{"line_number":33,"context_line":""},{"line_number":34,"context_line":"# TODO(stephenfin): We might want to use TypedDict here. Refer to"},{"line_number":35,"context_line":"# https://mypy.readthedocs.io/en/latest/kinds_of_types.html#typeddict for"},{"line_number":36,"context_line":"# more information."},{"line_number":37,"context_line":"Pool \u003d ty.Dict[str, ty.Any]"},{"line_number":38,"context_line":""}],"source_content_type":"text/x-python","patch_set":22,"id":"66540f06_94a6bc6c","line":35,"range":{"start_line":35,"start_character":2,"end_line":35,"end_character":69},"updated":"2021-05-13 13:44:35.000000000","message":"There\u0027s no typeddict anchor on this page AFAICT? Did you mean https://mypy.readthedocs.io/en/latest/more_types.html#typeddict? Either way fup if you would.","commit_id":"51d16adda6c3324b95693c852232988b7bb2a781"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"0663180cb39616ff34d8ed7dff0792699eb303dd","unresolved":true,"context_lines":[{"line_number":660,"context_line":""},{"line_number":661,"context_line":"    def __eq__(self, other: object) -\u003e bool:"},{"line_number":662,"context_line":"        if not isinstance(other, PciDeviceStats):"},{"line_number":663,"context_line":"            return NotImplemented"},{"line_number":664,"context_line":"        return self.pools \u003d\u003d other.pools"},{"line_number":665,"context_line":""},{"line_number":666,"context_line":"    def to_device_pools_obj(self) -\u003e \u0027objects.PciDevicePoolList\u0027:"}],"source_content_type":"text/x-python","patch_set":22,"id":"f7f48921_bb880932","line":663,"updated":"2021-04-28 11:36:18.000000000","message":"yepp this is needed as \"\u003d\u003d\" can take any object.","commit_id":"51d16adda6c3324b95693c852232988b7bb2a781"}],"nova/pci/utils.py":[{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"e57612460dc562947d193901d35025e4105a24a1","unresolved":true,"context_lines":[{"line_number":192,"context_line":"        for vf_path in glob.iglob(virtfns_path):"},{"line_number":193,"context_line":"            if re.search(pci_addr, os.readlink(vf_path)):"},{"line_number":194,"context_line":"                t \u003d VIRTFN_RE.search(vf_path)"},{"line_number":195,"context_line":"                vf_num \u003d t.group(1)"},{"line_number":196,"context_line":"                break"},{"line_number":197,"context_line":"    except Exception:"},{"line_number":198,"context_line":"        pass"}],"source_content_type":"text/x-python","patch_set":19,"id":"f7f46953_2303ab52","side":"PARENT","line":195,"range":{"start_line":195,"start_character":32,"end_line":195,"end_character":35},"updated":"2021-02-03 14:05:14.000000000","message":"so this is why we had an expect Exception","commit_id":"66eb8e4e24b1866a01257ff28164f430cfd67f03"},{"author":{"_account_id":15334,"name":"Stephen Finucane","display_name":"stephenfin","email":"stephenfin@redhat.com","username":"sfinucan"},"change_message_id":"30af81a0291beee6b28e478cea425002302181f9","unresolved":false,"context_lines":[{"line_number":192,"context_line":"        for vf_path in glob.iglob(virtfns_path):"},{"line_number":193,"context_line":"            if re.search(pci_addr, os.readlink(vf_path)):"},{"line_number":194,"context_line":"                t \u003d VIRTFN_RE.search(vf_path)"},{"line_number":195,"context_line":"                vf_num \u003d t.group(1)"},{"line_number":196,"context_line":"                break"},{"line_number":197,"context_line":"    except Exception:"},{"line_number":198,"context_line":"        pass"}],"source_content_type":"text/x-python","patch_set":19,"id":"851117f0_4a9f37da","side":"PARENT","line":195,"range":{"start_line":195,"start_character":32,"end_line":195,"end_character":35},"in_reply_to":"f7f46953_2303ab52","updated":"2021-02-08 18:06:17.000000000","message":"Yes, and it\u0027s handled by simply checking if we have a return value now as you can see","commit_id":"66eb8e4e24b1866a01257ff28164f430cfd67f03"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"e57612460dc562947d193901d35025e4105a24a1","unresolved":true,"context_lines":[{"line_number":37,"context_line":""},{"line_number":38,"context_line":"# TODO(stephenfin): Figure out the type for this"},{"line_number":39,"context_line":"def pci_device_prop_match("},{"line_number":40,"context_line":"    pci_dev: ty.Dict[str, ty.Any], specs: ty.List[ty.Dict[str, str]],"},{"line_number":41,"context_line":") -\u003e bool:"},{"line_number":42,"context_line":"    \"\"\"Check if the pci_dev meet spec requirement"},{"line_number":43,"context_line":""}],"source_content_type":"text/x-python","patch_set":19,"id":"932208b2_321ce171","line":40,"range":{"start_line":40,"start_character":13,"end_line":40,"end_character":33},"updated":"2021-02-03 14:05:14.000000000","message":"isn\u0027t it stats.Pool?","commit_id":"dbb7901530d848596202315db1f4701b4eef8ed3"},{"author":{"_account_id":15334,"name":"Stephen Finucane","display_name":"stephenfin","email":"stephenfin@redhat.com","username":"sfinucan"},"change_message_id":"30af81a0291beee6b28e478cea425002302181f9","unresolved":false,"context_lines":[{"line_number":37,"context_line":""},{"line_number":38,"context_line":"# TODO(stephenfin): Figure out the type for this"},{"line_number":39,"context_line":"def pci_device_prop_match("},{"line_number":40,"context_line":"    pci_dev: ty.Dict[str, ty.Any], specs: ty.List[ty.Dict[str, str]],"},{"line_number":41,"context_line":") -\u003e bool:"},{"line_number":42,"context_line":"    \"\"\"Check if the pci_dev meet spec requirement"},{"line_number":43,"context_line":""}],"source_content_type":"text/x-python","patch_set":19,"id":"4e4ae322_205a5097","line":40,"range":{"start_line":40,"start_character":13,"end_line":40,"end_character":33},"in_reply_to":"932208b2_321ce171","updated":"2021-02-08 18:06:17.000000000","message":"It is. Done.","commit_id":"dbb7901530d848596202315db1f4701b4eef8ed3"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"e57612460dc562947d193901d35025e4105a24a1","unresolved":true,"context_lines":[{"line_number":52,"context_line":""},{"line_number":53,"context_line":"    \"\"\""},{"line_number":54,"context_line":""},{"line_number":55,"context_line":"    def _matching_devices(spec: ty.Dict[str, str]):"},{"line_number":56,"context_line":"        for k, v in spec.items():"},{"line_number":57,"context_line":"            pci_dev_v \u003d pci_dev.get(k)"},{"line_number":58,"context_line":"            if isinstance(v, list) and isinstance(pci_dev_v, list):"}],"source_content_type":"text/x-python","patch_set":19,"id":"a4c50687_ebd458ae","line":55,"range":{"start_line":55,"start_character":50,"end_line":55,"end_character":51},"updated":"2021-02-03 14:05:14.000000000","message":"-\u003e bool:","commit_id":"dbb7901530d848596202315db1f4701b4eef8ed3"},{"author":{"_account_id":15334,"name":"Stephen Finucane","display_name":"stephenfin","email":"stephenfin@redhat.com","username":"sfinucan"},"change_message_id":"30af81a0291beee6b28e478cea425002302181f9","unresolved":false,"context_lines":[{"line_number":52,"context_line":""},{"line_number":53,"context_line":"    \"\"\""},{"line_number":54,"context_line":""},{"line_number":55,"context_line":"    def _matching_devices(spec: ty.Dict[str, str]):"},{"line_number":56,"context_line":"        for k, v in spec.items():"},{"line_number":57,"context_line":"            pci_dev_v \u003d pci_dev.get(k)"},{"line_number":58,"context_line":"            if isinstance(v, list) and isinstance(pci_dev_v, list):"}],"source_content_type":"text/x-python","patch_set":19,"id":"f8f735f3_ac9d9119","line":55,"range":{"start_line":55,"start_character":50,"end_line":55,"end_character":51},"in_reply_to":"a4c50687_ebd458ae","updated":"2021-02-08 18:06:17.000000000","message":"Done","commit_id":"dbb7901530d848596202315db1f4701b4eef8ed3"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"e57612460dc562947d193901d35025e4105a24a1","unresolved":true,"context_lines":[{"line_number":207,"context_line":"                if t:"},{"line_number":208,"context_line":"                    vf_num \u003d t.group(1)"},{"line_number":209,"context_line":"                    break"},{"line_number":210,"context_line":"        except OSError:  # file doesn\u0027t exist"},{"line_number":211,"context_line":"            pass"},{"line_number":212,"context_line":""},{"line_number":213,"context_line":"    if vf_num is None:"}],"source_content_type":"text/x-python","patch_set":19,"id":"a7b5bd0d_62eb7f1c","line":210,"range":{"start_line":210,"start_character":15,"end_line":210,"end_character":22},"updated":"2021-02-03 14:05:14.000000000","message":"is it or.readlink that raises this?","commit_id":"dbb7901530d848596202315db1f4701b4eef8ed3"},{"author":{"_account_id":15334,"name":"Stephen Finucane","display_name":"stephenfin","email":"stephenfin@redhat.com","username":"sfinucan"},"change_message_id":"30af81a0291beee6b28e478cea425002302181f9","unresolved":false,"context_lines":[{"line_number":207,"context_line":"                if t:"},{"line_number":208,"context_line":"                    vf_num \u003d t.group(1)"},{"line_number":209,"context_line":"                    break"},{"line_number":210,"context_line":"        except OSError:  # file doesn\u0027t exist"},{"line_number":211,"context_line":"            pass"},{"line_number":212,"context_line":""},{"line_number":213,"context_line":"    if vf_num is None:"}],"source_content_type":"text/x-python","patch_set":19,"id":"dbd54b39_3b288d15","line":210,"range":{"start_line":210,"start_character":15,"end_line":210,"end_character":22},"in_reply_to":"a7b5bd0d_62eb7f1c","updated":"2021-02-08 18:06:17.000000000","message":"Yes.\n\n  \u003e\u003e\u003e os.readlink(\u0027setup.cfg\u0027)\n  Traceback (most recent call last):\n    File \"\u003cstdin\u003e\", line 1, in \u003cmodule\u003e\n  OSError: [Errno 22] Invalid argument: \u0027setup.cfg\u0027\n\nThis can also raise \u0027FileNotFoundError\u0027 but I don\u0027t think that\u0027s worth worrying about since it would imply something had disappeared between when we did the glob and tried to access things. Then again, we could also remove OSError since that implies sysfs is somewhat borked.\n\nLater: yeah, I\u0027m going to get rid of this.","commit_id":"dbb7901530d848596202315db1f4701b4eef8ed3"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"66ce2f118278bc209c49c1f766546a3d13e1158f","unresolved":true,"context_lines":[{"line_number":194,"context_line":"                t \u003d VIRTFN_RE.search(vf_path)"},{"line_number":195,"context_line":"                vf_num \u003d t.group(1)"},{"line_number":196,"context_line":"                break"},{"line_number":197,"context_line":"    except Exception:"},{"line_number":198,"context_line":"        pass"},{"line_number":199,"context_line":"    if vf_num is None:"},{"line_number":200,"context_line":"        raise exception.PciDeviceNotFoundById(id\u003dpci_addr)"}],"source_content_type":"text/x-python","patch_set":20,"id":"b5a06057_640eaf27","side":"PARENT","line":197,"updated":"2021-02-09 13:15:06.000000000","message":"this change makes some weird edge case errors more explicit by not translating the exception to PciDeviceNotFoundById. But also in those case we might not clean up properly. This function is used in vif plug / unplug scenario. I don\u0027t see much explicit catch of PciDeviceNotFoundById but it inherits from NotFound that might be handled somewhere in the call stack. I don\u0027t think this is a huge issue but it might be safer to simply keep the catchall and translate by\n    \n    except Exception as e:\n        raise exception.PciDeviceNotFoundById(id\u003dpci_addr) from e\n\nThis way the specific exception information is not lost but we can keep relaying on the PciDeviceNotFoundById exception type.\n\nI won\u0027t block on this.","commit_id":"66eb8e4e24b1866a01257ff28164f430cfd67f03"},{"author":{"_account_id":11604,"name":"sean mooney","email":"smooney@redhat.com","username":"sean-k-mooney"},"change_message_id":"3b454d00f43a4dc337b51fbda6122f3046aaae9b","unresolved":true,"context_lines":[{"line_number":188,"context_line":"    VIRTFN_RE \u003d re.compile(r\"virtfn(\\d+)\")"},{"line_number":189,"context_line":"    virtfns_path \u003d \"/sys/bus/pci/devices/%s/physfn/virtfn*\" % (pci_addr)"},{"line_number":190,"context_line":"    vf_num \u003d None"},{"line_number":191,"context_line":"    try:"},{"line_number":192,"context_line":"        for vf_path in glob.iglob(virtfns_path):"},{"line_number":193,"context_line":"            if re.search(pci_addr, os.readlink(vf_path)):"},{"line_number":194,"context_line":"                t \u003d VIRTFN_RE.search(vf_path)"}],"source_content_type":"text/x-python","patch_set":22,"id":"538542e4_89a260a2","side":"PARENT","line":191,"range":{"start_line":191,"start_character":4,"end_line":191,"end_character":7},"updated":"2021-04-27 12:03:49.000000000","message":"i dont think this is valid to remove\ni think we can get excptions form os.readlink\n\nso this i think is a behavior change and should not be included in this patch.","commit_id":"eba9d596daa91d8f702b719afb88cb89f2d5bb32"},{"author":{"_account_id":15334,"name":"Stephen Finucane","display_name":"stephenfin","email":"stephenfin@redhat.com","username":"sfinucan"},"change_message_id":"0dfaf675caefe24543100050a688846450705414","unresolved":false,"context_lines":[{"line_number":188,"context_line":"    VIRTFN_RE \u003d re.compile(r\"virtfn(\\d+)\")"},{"line_number":189,"context_line":"    virtfns_path \u003d \"/sys/bus/pci/devices/%s/physfn/virtfn*\" % (pci_addr)"},{"line_number":190,"context_line":"    vf_num \u003d None"},{"line_number":191,"context_line":"    try:"},{"line_number":192,"context_line":"        for vf_path in glob.iglob(virtfns_path):"},{"line_number":193,"context_line":"            if re.search(pci_addr, os.readlink(vf_path)):"},{"line_number":194,"context_line":"                t \u003d VIRTFN_RE.search(vf_path)"}],"source_content_type":"text/x-python","patch_set":22,"id":"a0756d55_2b37e8b3","side":"PARENT","line":191,"range":{"start_line":191,"start_character":4,"end_line":191,"end_character":7},"in_reply_to":"538542e4_89a260a2","updated":"2021-04-28 09:50:02.000000000","message":"I experimented with this extensively. It will only fail if I pass an invalid symlink. Unless sysfs is malformed, the \u0027virtfn*\u0027 will _always_ be symbolic links. As such, this is useless code.","commit_id":"eba9d596daa91d8f702b719afb88cb89f2d5bb32"},{"author":{"_account_id":11604,"name":"sean mooney","email":"smooney@redhat.com","username":"sean-k-mooney"},"change_message_id":"c22b5d68024b495be8b5a140af3b1a888c70da8c","unresolved":false,"context_lines":[{"line_number":188,"context_line":"    VIRTFN_RE \u003d re.compile(r\"virtfn(\\d+)\")"},{"line_number":189,"context_line":"    virtfns_path \u003d \"/sys/bus/pci/devices/%s/physfn/virtfn*\" % (pci_addr)"},{"line_number":190,"context_line":"    vf_num \u003d None"},{"line_number":191,"context_line":"    try:"},{"line_number":192,"context_line":"        for vf_path in glob.iglob(virtfns_path):"},{"line_number":193,"context_line":"            if re.search(pci_addr, os.readlink(vf_path)):"},{"line_number":194,"context_line":"                t \u003d VIRTFN_RE.search(vf_path)"}],"source_content_type":"text/x-python","patch_set":22,"id":"3fc9b279_3573e010","side":"PARENT","line":191,"range":{"start_line":191,"start_character":4,"end_line":191,"end_character":7},"in_reply_to":"a0756d55_2b37e8b3","updated":"2021-04-28 10:40:42.000000000","message":"hum i would still have prefered this to be in a spereat patch so we coudl revert it independetly if need but ok if you have tested it and could not trigger it then i guess im ok with this.","commit_id":"eba9d596daa91d8f702b719afb88cb89f2d5bb32"},{"author":{"_account_id":11604,"name":"sean mooney","email":"smooney@redhat.com","username":"sean-k-mooney"},"change_message_id":"3b454d00f43a4dc337b51fbda6122f3046aaae9b","unresolved":true,"context_lines":[{"line_number":26,"context_line":"if ty.TYPE_CHECKING:"},{"line_number":27,"context_line":"    # avoid circular import"},{"line_number":28,"context_line":"    from nova.pci import stats"},{"line_number":29,"context_line":""},{"line_number":30,"context_line":"LOG \u003d logging.getLogger(__name__)"},{"line_number":31,"context_line":""},{"line_number":32,"context_line":"PCI_VENDOR_PATTERN \u003d \"^(hex{4})$\".replace(\"hex\", r\"[\\da-fA-F]\")"}],"source_content_type":"text/x-python","patch_set":22,"id":"7bc34abd_b778e6c6","line":29,"updated":"2021-04-27 12:03:49.000000000","message":"+1 for comment","commit_id":"51d16adda6c3324b95693c852232988b7bb2a781"},{"author":{"_account_id":15334,"name":"Stephen Finucane","display_name":"stephenfin","email":"stephenfin@redhat.com","username":"sfinucan"},"change_message_id":"0dfaf675caefe24543100050a688846450705414","unresolved":false,"context_lines":[{"line_number":26,"context_line":"if ty.TYPE_CHECKING:"},{"line_number":27,"context_line":"    # avoid circular import"},{"line_number":28,"context_line":"    from nova.pci import stats"},{"line_number":29,"context_line":""},{"line_number":30,"context_line":"LOG \u003d logging.getLogger(__name__)"},{"line_number":31,"context_line":""},{"line_number":32,"context_line":"PCI_VENDOR_PATTERN \u003d \"^(hex{4})$\".replace(\"hex\", r\"[\\da-fA-F]\")"}],"source_content_type":"text/x-python","patch_set":22,"id":"885c4fa4_ca29180b","line":29,"in_reply_to":"7bc34abd_b778e6c6","updated":"2021-04-28 09:50:02.000000000","message":"Ack","commit_id":"51d16adda6c3324b95693c852232988b7bb2a781"},{"author":{"_account_id":11604,"name":"sean mooney","email":"smooney@redhat.com","username":"sean-k-mooney"},"change_message_id":"3b454d00f43a4dc337b51fbda6122f3046aaae9b","unresolved":true,"context_lines":[{"line_number":75,"context_line":"    return any(_matching_devices(spec) for spec in specs)"},{"line_number":76,"context_line":""},{"line_number":77,"context_line":""},{"line_number":78,"context_line":"def parse_address(address: str) -\u003e ty.Sequence[str]:"},{"line_number":79,"context_line":"    \"\"\"Parse a PCI address."},{"line_number":80,"context_line":""},{"line_number":81,"context_line":"    Returns (domain, bus, slot, function) from PCI address that is stored in"}],"source_content_type":"text/x-python","patch_set":22,"id":"af9d3d28_563aa512","line":78,"range":{"start_line":78,"start_character":35,"end_line":78,"end_character":51},"updated":"2021-04-27 12:03:49.000000000","message":"is this actully ty.Tuple[str, str, str, str]?\n\nim fine with ty.Sequence[str] too","commit_id":"51d16adda6c3324b95693c852232988b7bb2a781"},{"author":{"_account_id":15334,"name":"Stephen Finucane","display_name":"stephenfin","email":"stephenfin@redhat.com","username":"sfinucan"},"change_message_id":"0dfaf675caefe24543100050a688846450705414","unresolved":false,"context_lines":[{"line_number":75,"context_line":"    return any(_matching_devices(spec) for spec in specs)"},{"line_number":76,"context_line":""},{"line_number":77,"context_line":""},{"line_number":78,"context_line":"def parse_address(address: str) -\u003e ty.Sequence[str]:"},{"line_number":79,"context_line":"    \"\"\"Parse a PCI address."},{"line_number":80,"context_line":""},{"line_number":81,"context_line":"    Returns (domain, bus, slot, function) from PCI address that is stored in"}],"source_content_type":"text/x-python","patch_set":22,"id":"f68c1e95_b2879758","line":78,"range":{"start_line":78,"start_character":35,"end_line":78,"end_character":51},"in_reply_to":"af9d3d28_563aa512","updated":"2021-04-28 09:50:02.000000000","message":"I did try that. No dice. You can\u0027t make the type returned from an existing typed function more specific. \u0027groups()\u0027 returns \u0027ty.Option[ty.Sequence[str]]\u0027. We\u0027re handling the None values via the \u0027if not m:\u0027 value. If we wanted to return a tuple value, we\u0027d have to manually explode this out.","commit_id":"51d16adda6c3324b95693c852232988b7bb2a781"},{"author":{"_account_id":11604,"name":"sean mooney","email":"smooney@redhat.com","username":"sean-k-mooney"},"change_message_id":"c22b5d68024b495be8b5a140af3b1a888c70da8c","unresolved":false,"context_lines":[{"line_number":75,"context_line":"    return any(_matching_devices(spec) for spec in specs)"},{"line_number":76,"context_line":""},{"line_number":77,"context_line":""},{"line_number":78,"context_line":"def parse_address(address: str) -\u003e ty.Sequence[str]:"},{"line_number":79,"context_line":"    \"\"\"Parse a PCI address."},{"line_number":80,"context_line":""},{"line_number":81,"context_line":"    Returns (domain, bus, slot, function) from PCI address that is stored in"}],"source_content_type":"text/x-python","patch_set":22,"id":"c572d513_592b304c","line":78,"range":{"start_line":78,"start_character":35,"end_line":78,"end_character":51},"in_reply_to":"f68c1e95_b2879758","updated":"2021-04-28 10:40:42.000000000","message":"ah groups is typed got it.\nya exploding this out and repacking is not worth it +1","commit_id":"51d16adda6c3324b95693c852232988b7bb2a781"}]}
