A recent change to the PciDevTracker class allowed for the passing of
the compute node ID to the __init__() method, where
PciDevsList.get_by_compute_node() was called with a 'context' parameter,
which wasn't defined, resulting in the imported context module being
passed instead.
This change requires that the context be passed in to the __init__() for
the PciDevTracker class, and that that be used to create the
PciDevsList. The existing import of the context module is no longer
needed in the pci/manager.py file, so the conflict is no longer a
problem. The only place in the code that currently instantiates a
PciDevTracker object is in the ResourceTracker, so that has been updated
to pass in the context. A unit test to check for context has also been
added.
Reviewed: https:/ /review. openstack. org/145619 /git.openstack. org/cgit/ openstack/ nova/commit/ ?id=50ee9dd76e8 955dd57e5a7318b e023c76c462f67
Committed: https:/
Submitter: Jenkins
Branch: master
commit 50ee9dd76e8955d d57e5a7318be023 c76c462f67
Author: EdLeafe <email address hidden>
Date: Mon Jan 12 15:56:21 2015 +0000
Pass correct context to get_by_ compute_ node()
A recent change to the PciDevTracker class allowed for the passing of .get_by_ compute_ node() was called with a 'context' parameter,
the compute node ID to the __init__() method, where
PciDevsList
which wasn't defined, resulting in the imported context module being
passed instead.
This change requires that the context be passed in to the __init__() for
the PciDevTracker class, and that that be used to create the
PciDevsList. The existing import of the context module is no longer
needed in the pci/manager.py file, so the conflict is no longer a
problem. The only place in the code that currently instantiates a
PciDevTracker object is in the ResourceTracker, so that has been updated
to pass in the context. A unit test to check for context has also been
added.
Change-Id: Id136eabacb00e4 381c03f12d8484f c90a5eb48b1
Closes-Bug: #1408480