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.
(cherry picked from commit 50ee9dd76e8955dd57e5a7318be023c76c462f67)
Reviewed: https:/ /review. openstack. org/173225 /git.openstack. org/cgit/ openstack/ nova/commit/ ?id=cfce73b36a3 afe4e8be889faf3 f5ec78bd19c0c7
Committed: https:/
Submitter: Jenkins
Branch: stable/juno
commit cfce73b36a3afe4 e8be889faf3f5ec 78bd19c0c7
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.
(cherry picked from commit 50ee9dd76e8955d d57e5a7318be023 c76c462f67)
Conflicts: compute/ resource_ tracker. py tests/pci/ test_pci_ manager. py
nova/
nova/
Closes-Bug: #1408480 381c03f12d8484f c90a5eb48b1
Change-Id: Id136eabacb00e4