)]}'
{"/PATCHSET_LEVEL":[{"author":{"_account_id":4690,"name":"melanie witt","display_name":"melwitt","email":"melwittt@gmail.com","username":"melwitt"},"change_message_id":"983237bbc83042cd9d3070ba4facda59d94fd05f","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":3,"id":"6c5a8e06_b870e3be","updated":"2025-02-20 18:06:36.000000000","message":"I think I might be seeing other bugs","commit_id":"7db63c9e9c5cc606b015d89ed8866cfec8d650da"},{"author":{"_account_id":4690,"name":"melanie witt","display_name":"melwitt","email":"melwittt@gmail.com","username":"melwitt"},"change_message_id":"8a7c4557af40927930da5c8b6c25437478a771f3","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":3,"id":"21f990ec_2adb4935","in_reply_to":"6c5a8e06_b870e3be","updated":"2025-02-20 18:07:28.000000000","message":"\u003e I think I might be seeing other bugs\n\nSigh.. leftover comment I forgot to delete. I looked for other bugs related to listDevices but did not find any.","commit_id":"7db63c9e9c5cc606b015d89ed8866cfec8d650da"},{"author":{"_account_id":4690,"name":"melanie witt","display_name":"melwitt","email":"melwittt@gmail.com","username":"melwitt"},"change_message_id":"1cd0291df3d8a2898dea38f80147b6f74dab46b4","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":6,"id":"f3b8f977_8c4fc7e1","updated":"2025-02-21 01:08:48.000000000","message":"recheck openstack-tox-cover nova.tests.unit.db.main.test_migrations.TestMigrationsWalkPostgreSQL.test_single_head_revision: sqlalchemy.exc.OperationalError: (psycopg2.errors.ObjectInUse) source database \"template1\" is being accessed by other users","commit_id":"2c07aa06458a2e70d79f8b3c68960bdccd11ab57"}],"nova/tests/fixtures/libvirt.py":[{"author":{"_account_id":11604,"name":"sean mooney","email":"smooney@redhat.com","username":"sean-k-mooney"},"change_message_id":"97519414a59ed95f71649d938ff7c92663d057d4","unresolved":false,"context_lines":[{"line_number":2279,"context_line":"                    error_domain\u003dVIR_FROM_QEMU)"},{"line_number":2280,"context_line":""},{"line_number":2281,"context_line":"    def device_lookup_by_name(self, dev_name):"},{"line_number":2282,"context_line":"        return self.pci_info.get_device_by_name(dev_name)"},{"line_number":2283,"context_line":""},{"line_number":2284,"context_line":"    def nodeDeviceLookupByName(self, name):"},{"line_number":2285,"context_line":"        # See bug https://bugs.launchpad.net/nova/+bug/2098892"}],"source_content_type":"text/x-python","patch_set":3,"id":"bc056f2b_48f43994","line":2282,"updated":"2025-02-20 11:50:19.000000000","message":"as an aside it could have eqully been this that exploded hen wackamole comment below V","commit_id":"7db63c9e9c5cc606b015d89ed8866cfec8d650da"},{"author":{"_account_id":4690,"name":"melanie witt","display_name":"melwitt","email":"melwittt@gmail.com","username":"melwitt"},"change_message_id":"983237bbc83042cd9d3070ba4facda59d94fd05f","unresolved":false,"context_lines":[{"line_number":2279,"context_line":"                    error_domain\u003dVIR_FROM_QEMU)"},{"line_number":2280,"context_line":""},{"line_number":2281,"context_line":"    def device_lookup_by_name(self, dev_name):"},{"line_number":2282,"context_line":"        return self.pci_info.get_device_by_name(dev_name)"},{"line_number":2283,"context_line":""},{"line_number":2284,"context_line":"    def nodeDeviceLookupByName(self, name):"},{"line_number":2285,"context_line":"        # See bug https://bugs.launchpad.net/nova/+bug/2098892"}],"source_content_type":"text/x-python","patch_set":3,"id":"fa6433bc_c2750c7f","line":2282,"in_reply_to":"bc056f2b_48f43994","updated":"2025-02-20 18:06:36.000000000","message":"Yeah 🫤","commit_id":"7db63c9e9c5cc606b015d89ed8866cfec8d650da"},{"author":{"_account_id":11604,"name":"sean mooney","email":"smooney@redhat.com","username":"sean-k-mooney"},"change_message_id":"97519414a59ed95f71649d938ff7c92663d057d4","unresolved":false,"context_lines":[{"line_number":2288,"context_line":"        # It is excluded from test-requirements.txt and we also use the"},{"line_number":2289,"context_line":"        # ImportModulePoisonFixture in nova/test.py to prevent use of modules"},{"line_number":2290,"context_line":"        # like libvirt."},{"line_number":2291,"context_line":"        if not isinstance(name, str) and name is not None:"},{"line_number":2292,"context_line":"            raise TypeError("},{"line_number":2293,"context_line":"                \u0027virNodeDeviceLookupByName() argument 2 must be str or None, \u0027"},{"line_number":2294,"context_line":"                f\u0027not {type(name)}\u0027)"}],"source_content_type":"text/x-python","patch_set":3,"id":"1ae10394_76051740","line":2291,"updated":"2025-02-20 11:50:19.000000000","message":"this is a bit wackamole but it would have caught this\n\ni alos think mypy may have caught this but that a separate issue.\n\nim ok with configing it to this function since i do not have a generic solution","commit_id":"7db63c9e9c5cc606b015d89ed8866cfec8d650da"},{"author":{"_account_id":4690,"name":"melanie witt","display_name":"melwitt","email":"melwittt@gmail.com","username":"melwitt"},"change_message_id":"983237bbc83042cd9d3070ba4facda59d94fd05f","unresolved":false,"context_lines":[{"line_number":2288,"context_line":"        # It is excluded from test-requirements.txt and we also use the"},{"line_number":2289,"context_line":"        # ImportModulePoisonFixture in nova/test.py to prevent use of modules"},{"line_number":2290,"context_line":"        # like libvirt."},{"line_number":2291,"context_line":"        if not isinstance(name, str) and name is not None:"},{"line_number":2292,"context_line":"            raise TypeError("},{"line_number":2293,"context_line":"                \u0027virNodeDeviceLookupByName() argument 2 must be str or None, \u0027"},{"line_number":2294,"context_line":"                f\u0027not {type(name)}\u0027)"}],"source_content_type":"text/x-python","patch_set":3,"id":"699db028_776555ce","line":2291,"in_reply_to":"1ae10394_76051740","updated":"2025-02-20 18:06:36.000000000","message":"Yeah I was thinking with a fresh brain that I will want to respin to add typing annotations to the related methods.\n\nHonestly I don\u0027t like this either but I didn\u0027t find a better way to deal with this since it\u0027s not realistically possible for me to import the libvirt-python module for just this test case. That\u0027s what I would have done if I could. We have so many guards against importing libvirt-python in the test env.","commit_id":"7db63c9e9c5cc606b015d89ed8866cfec8d650da"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"6056270f02f533e5599c15cf552c80cafda4caad","unresolved":true,"context_lines":[{"line_number":2288,"context_line":"        # environment. It is excluded from test-requirements.txt and we"},{"line_number":2289,"context_line":"        # also use the ImportModulePoisonFixture in nova/test.py to prevent"},{"line_number":2290,"context_line":"        # use of modules such as libvirt."},{"line_number":2291,"context_line":"        if not isinstance(name, str) and name is not None:"},{"line_number":2292,"context_line":"            raise TypeError("},{"line_number":2293,"context_line":"                \u0027virNodeDeviceLookupByName() argument 2 must be str or \u0027"},{"line_number":2294,"context_line":"                f\u0027None, not {type(name)}\u0027)"}],"source_content_type":"text/x-python","patch_set":6,"id":"16845d7c_51e5e19b","line":2291,"updated":"2025-02-24 18:32:06.000000000","message":"Cool, I was hoping you were going to actually put this in our fixture.","commit_id":"2c07aa06458a2e70d79f8b3c68960bdccd11ab57"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"6056270f02f533e5599c15cf552c80cafda4caad","unresolved":true,"context_lines":[{"line_number":2291,"context_line":"        if not isinstance(name, str) and name is not None:"},{"line_number":2292,"context_line":"            raise TypeError("},{"line_number":2293,"context_line":"                \u0027virNodeDeviceLookupByName() argument 2 must be str or \u0027"},{"line_number":2294,"context_line":"                f\u0027None, not {type(name)}\u0027)"},{"line_number":2295,"context_line":""},{"line_number":2296,"context_line":"        if name.startswith(\u0027mdev\u0027):"},{"line_number":2297,"context_line":"            return self.mdev_info.get_device_by_name(name)"}],"source_content_type":"text/x-python","patch_set":6,"id":"b20d5177_9189e060","line":2294,"updated":"2025-02-24 18:32:06.000000000","message":"And expressions like these are why f-strings are TERRIBLE :)","commit_id":"2c07aa06458a2e70d79f8b3c68960bdccd11ab57"},{"author":{"_account_id":11604,"name":"sean mooney","email":"smooney@redhat.com","username":"sean-k-mooney"},"change_message_id":"480ad769b69adfc563df7784ba4136136a4105be","unresolved":true,"context_lines":[{"line_number":2291,"context_line":"        if not isinstance(name, str) and name is not None:"},{"line_number":2292,"context_line":"            raise TypeError("},{"line_number":2293,"context_line":"                \u0027virNodeDeviceLookupByName() argument 2 must be str or \u0027"},{"line_number":2294,"context_line":"                f\u0027None, not {type(name)}\u0027)"},{"line_number":2295,"context_line":""},{"line_number":2296,"context_line":"        if name.startswith(\u0027mdev\u0027):"},{"line_number":2297,"context_line":"            return self.mdev_info.get_device_by_name(name)"}],"source_content_type":"text/x-python","patch_set":6,"id":"47ab42d8_88ce5336","line":2294,"in_reply_to":"b20d5177_9189e060","updated":"2025-02-24 18:45:21.000000000","message":"your allowed to have an f on the first line as weell if it the indentation that you dislike.","commit_id":"2c07aa06458a2e70d79f8b3c68960bdccd11ab57"}],"nova/tests/functional/regressions/test_bug_2098892.py":[{"author":{"_account_id":11604,"name":"sean mooney","email":"smooney@redhat.com","username":"sean-k-mooney"},"change_message_id":"97519414a59ed95f71649d938ff7c92663d057d4","unresolved":true,"context_lines":[{"line_number":14,"context_line":"from nova.tests.functional.libvirt import test_vgpu"},{"line_number":15,"context_line":""},{"line_number":16,"context_line":""},{"line_number":17,"context_line":"class VGPUTestsListDevices(test_vgpu.VGPUTestBase):"},{"line_number":18,"context_line":"    \"\"\"Regression test for bug 2098892."},{"line_number":19,"context_line":""},{"line_number":20,"context_line":"    Test that nodeDeviceLookupByName() is called with valid types to prevent:"}],"source_content_type":"text/x-python","patch_set":3,"id":"88989562_bd79d56c","line":17,"updated":"2025-02-20 11:50:19.000000000","message":"if i appply the fixture change and test.py change and this regression test it fails with \n\nTraceback (most recent call last):\n  File \"/home/smooney/repos/nova-2/nova/compute/manager.py\", line 11100, in _update_available_resource_for_node\n    self.rt.update_available_resource(context, nodename,\n  File \"/home/smooney/repos/nova-2/nova/compute/resource_tracker.py\", line 935, in update_available_resource\n    self._update_available_resource(context, resources, startup\u003dstartup)\n  File \"/home/smooney/repos/nova-2/.tox/functional/lib/python3.12/site-packages/oslo_concurrency/lockutils.py\", line 412, in inner\n    return f(*args, **kwargs)\n           ^^^^^^^^^^^^^^^^^^\n  File \"/home/smooney/repos/nova-2/nova/compute/resource_tracker.py\", line 1066, in _update_available_resource\n    self._update(context, cn, startup\u003dstartup)\n  File \"/home/smooney/repos/nova-2/nova/compute/resource_tracker.py\", line 1375, in _update\n    self._update_to_placement(context, compute_node, startup)\n  File \"/home/smooney/repos/nova-2/.tox/functional/lib/python3.12/site-packages/retrying.py\", line 56, in wrapped_f\n    return Retrying(*dargs, **dkw).call(f, *args, **kw)\n           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n  File \"/home/smooney/repos/nova-2/.tox/functional/lib/python3.12/site-packages/retrying.py\", line 257, in call\n    return attempt.get(self._wrap_exception)\n           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n  File \"/home/smooney/repos/nova-2/.tox/functional/lib/python3.12/site-packages/retrying.py\", line 301, in get\n    six.reraise(self.value[0], self.value[1], self.value[2])\n  File \"/home/smooney/repos/nova-2/.tox/functional/lib/python3.12/site-packages/six.py\", line 724, in reraise\n    raise value\n  File \"/home/smooney/repos/nova-2/.tox/functional/lib/python3.12/site-packages/retrying.py\", line 251, in call\n    attempt \u003d Attempt(fn(*args, **kwargs), attempt_number, False)\n                      ^^^^^^^^^^^^^^^^^^^\n  File \"/home/smooney/repos/nova-2/nova/compute/resource_tracker.py\", line 1288, in _update_to_placement\n    self.driver.update_provider_tree(prov_tree, nodename)\n  File \"/home/smooney/repos/nova-2/nova/virt/libvirt/driver.py\", line 9478, in update_provider_tree\n    self._update_provider_tree_for_vgpu(\n  File \"/home/smooney/repos/nova-2/nova/virt/libvirt/driver.py\", line 9885, in _update_provider_tree_for_vgpu\n    inventories_dict \u003d self._get_gpu_inventories()\n       \n                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^\n  File \"/home/smooney/repos/nova-2/nova/virt/libvirt/driver.py\", line 8554, in _get_gpu_inventories\n    count_per_dev \u003d self._count_mdev_capable_devices(enabled_mdev_types)\n                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n  File \"/home/smooney/repos/nova-2/nova/virt/libvirt/driver.py\", line 8505, in _count_mdev_capable_devices\n    mdev_capable_devices \u003d self._get_mdev_capable_devices(\n                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n  File \"/home/smooney/repos/nova-2/nova/virt/libvirt/driver.py\", line 8750, in _get_mdev_capable_devices\n    device \u003d self._get_mdev_capabilities_for_dev(name, types)\n             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n  File \"/home/smooney/repos/nova-2/nova/virt/libvirt/driver.py\", line 8719, in _get_mdev_capabilities_for_dev\n    virtdev \u003d self._host.device_lookup_by_name(devname)\n              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n  File \"/home/smooney/repos/nova-2/nova/virt/libvirt/host.py\", line 1242, in device_lookup_by_name\n    return self.get_connection().nodeDeviceLookupByName(name)\n           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n  File \"/home/smooney/repos/nova-2/nova/tests/fixtures/libvirt.py\", line 2292, in nodeDeviceLookupByName\n    raise TypeError(\nTypeError: virNodeDeviceLookupByName() argument 2 must be str or None, not \u003cclass \u0027eventlet.tpool.Proxy\u0027\u003e\n\ndemonstrating the bug.\n\nso we coudl do this this in two commits if you asserted the presence of the TYPE error in the logs.\n\nyou wont be able to eaislly do assert raises but we have exampels if assertign log messages in test s so that should be ok to do.\n\n\nwoudl you mind doing that?\n\n\nif you wanted to directly assert the exception you would have to create a spy object like we do for the filters in some of the pci/numa functional test.\n\nyou can eailly do it liek this\n\n  def setUp(self):\n        super().setUp()\n\n        orig \u003d pci_placement_translator.update_provider_tree_for_pci\n\n        def wrapped_update(\n            provider_tree, nodename, pci_tracker, allocations, same_host\n        ):\n            alloc_before \u003d copy.deepcopy(allocations)\n            updated \u003d orig(\n                provider_tree, nodename, pci_tracker, allocations, same_host)\n            alloc_after \u003d copy.deepcopy(allocations)\n            self.calls.append((nodename, updated, alloc_before, alloc_after))\n            return updated\n\n        self.useFixture(\n            fixtures.MonkeyPatch(\n                \"nova.compute.pci_placement_translator.\"\n                \"update_provider_tree_for_pci\",\n                wrapped_update,\n            )\n        )\n        \nor \n\n\n    pci_filter_class \u003d host_manager.filter_cls_map[\u0027PciPassthroughFilter\u0027]\n        host_pass_mock \u003d mock.Mock(wraps\u003dpci_filter_class().host_passes)\n        self.mock_filter \u003d self.useFixture(fixtures.MockPatch(\n            \u0027nova.scheduler.filters.pci_passthrough_filter\u0027\n            \u0027.PciPassthroughFilter.host_passes\u0027,\n            side_effect\u003dhost_pass_mock)).mock\n            \n            \nyou can do the assert in wrapped_update\nbut i bleive in the second case you could do it via self.mock_filter too but i dont have a cear exampel of that.","commit_id":"7db63c9e9c5cc606b015d89ed8866cfec8d650da"},{"author":{"_account_id":4690,"name":"melanie witt","display_name":"melwitt","email":"melwittt@gmail.com","username":"melwitt"},"change_message_id":"5b957bd6e96c8344029d5526bb0d1e1318a797b0","unresolved":false,"context_lines":[{"line_number":14,"context_line":"from nova.tests.functional.libvirt import test_vgpu"},{"line_number":15,"context_line":""},{"line_number":16,"context_line":""},{"line_number":17,"context_line":"class VGPUTestsListDevices(test_vgpu.VGPUTestBase):"},{"line_number":18,"context_line":"    \"\"\"Regression test for bug 2098892."},{"line_number":19,"context_line":""},{"line_number":20,"context_line":"    Test that nodeDeviceLookupByName() is called with valid types to prevent:"}],"source_content_type":"text/x-python","patch_set":3,"id":"fe68aa8c_e5326a7e","line":17,"in_reply_to":"5fcf1b4a_fe3e91ff","updated":"2025-02-20 21:42:52.000000000","message":"Done","commit_id":"7db63c9e9c5cc606b015d89ed8866cfec8d650da"},{"author":{"_account_id":4690,"name":"melanie witt","display_name":"melwitt","email":"melwittt@gmail.com","username":"melwitt"},"change_message_id":"983237bbc83042cd9d3070ba4facda59d94fd05f","unresolved":true,"context_lines":[{"line_number":14,"context_line":"from nova.tests.functional.libvirt import test_vgpu"},{"line_number":15,"context_line":""},{"line_number":16,"context_line":""},{"line_number":17,"context_line":"class VGPUTestsListDevices(test_vgpu.VGPUTestBase):"},{"line_number":18,"context_line":"    \"\"\"Regression test for bug 2098892."},{"line_number":19,"context_line":""},{"line_number":20,"context_line":"    Test that nodeDeviceLookupByName() is called with valid types to prevent:"}],"source_content_type":"text/x-python","patch_set":3,"id":"5fcf1b4a_fe3e91ff","line":17,"in_reply_to":"88989562_bd79d56c","updated":"2025-02-20 18:06:36.000000000","message":"Sure, I can split this into two commits and use one of the ways you mentioned to assert.","commit_id":"7db63c9e9c5cc606b015d89ed8866cfec8d650da"}],"nova/virt/libvirt/host.py":[{"author":{"_account_id":11604,"name":"sean mooney","email":"smooney@redhat.com","username":"sean-k-mooney"},"change_message_id":"98f64b1eed05a97e9f6ae2bdf3c330c1ef8ff6dd","unresolved":true,"context_lines":[{"line_number":1607,"context_line":"        nodedev \u003d self.get_vdpa_nodedev_by_address(pci_address)"},{"line_number":1608,"context_line":"        return nodedev.vdpa_capability.dev_path"},{"line_number":1609,"context_line":""},{"line_number":1610,"context_line":"    def list_pci_devices(self, flags: int \u003d 0) -\u003e ty.List[str]:"},{"line_number":1611,"context_line":"        \"\"\"Lookup pci devices."},{"line_number":1612,"context_line":""},{"line_number":1613,"context_line":"        :returns: a list of strings, names of the virNodeDevice instances"}],"source_content_type":"text/x-python","patch_set":6,"id":"9bd74b15_f0472342","line":1610,"updated":"2025-02-21 00:14:37.000000000","message":"+1 for type hits :)","commit_id":"2c07aa06458a2e70d79f8b3c68960bdccd11ab57"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"6056270f02f533e5599c15cf552c80cafda4caad","unresolved":true,"context_lines":[{"line_number":1634,"context_line":"        :returns: a list of strings, names of the virNodeDevice instances"},{"line_number":1635,"context_line":"        \"\"\""},{"line_number":1636,"context_line":"        try:"},{"line_number":1637,"context_line":"            return self.get_connection().listDevices(cap, flags)"},{"line_number":1638,"context_line":"        except libvirt.libvirtError as ex:"},{"line_number":1639,"context_line":"            error_code \u003d ex.get_error_code()"},{"line_number":1640,"context_line":"            if error_code \u003d\u003d libvirt.VIR_ERR_NO_SUPPORT:"}],"source_content_type":"text/x-python","patch_set":6,"id":"87d0abc4_ff40d528","line":1637,"updated":"2025-02-24 18:32:06.000000000","message":"I\u0027m a bit confused.. the previous fix was to apply Proxy for the purposes of not blocking when we make calls to the thing we return. You\u0027re removing that but not accounting for it anywhere else with a different call.\n\nWas this always returning just a normal string and it was just wrapped in error?","commit_id":"2c07aa06458a2e70d79f8b3c68960bdccd11ab57"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"6df6c9f434d951afe928977ad3ce242d65e71583","unresolved":false,"context_lines":[{"line_number":1634,"context_line":"        :returns: a list of strings, names of the virNodeDevice instances"},{"line_number":1635,"context_line":"        \"\"\""},{"line_number":1636,"context_line":"        try:"},{"line_number":1637,"context_line":"            return self.get_connection().listDevices(cap, flags)"},{"line_number":1638,"context_line":"        except libvirt.libvirtError as ex:"},{"line_number":1639,"context_line":"            error_code \u003d ex.get_error_code()"},{"line_number":1640,"context_line":"            if error_code \u003d\u003d libvirt.VIR_ERR_NO_SUPPORT:"}],"source_content_type":"text/x-python","patch_set":6,"id":"31e3976c_33ec7df2","line":1637,"in_reply_to":"87d0abc4_ff40d528","updated":"2025-02-24 18:37:22.000000000","message":"Sorry, nevermind, confirmation of the above is in the commit message below the fold.","commit_id":"2c07aa06458a2e70d79f8b3c68960bdccd11ab57"}]}
