nova/nova/compute
Matt Riedemann 35273a844a rt: only map compute node if we created it
If ComputeNode.create() fails, the update_available_resource
periodic will not try to create it again because it will be
mapped in the compute_nodes dict and _init_compute_node will
return early but trying to save changes to that ComputeNode
object later will fail because there is no id on the object,
since we failed to create it in the DB.

This simply reverses the logic such that we only map the
compute node if we successfully created it.

Some existing _init_compute_node testing had to be changed
since it relied on the order of when the ComputeNode object
is created and put into the compute_nodes dict in order
to pass the object along to some much lower-level PCI
tracker code, which was arguably mocking too deep for a unit
test. That is changed to avoid the low-level mocking and
assertions and just assert that _setup_pci_tracker is called
as expected.

Conflicts:
      nova/compute/resource_tracker.py
      nova/tests/unit/compute/test_resource_tracker.py

NOTE(mriedem): The resource_tracker.py conflict is due to
not having I14a310b20bd9892e7b34464e6baad49bf5928ece in Rocky.
The test conflicts are due to not having change
I37e8ad5b14262d801702411c2c87e73550adda70 in Rocky.

Change-Id: I9fa1d509a3de405d6246fb8670612c65c10cc93b
Closes-Bug: #1839674
(cherry picked from commit f578146f37)
(cherry picked from commit 648770bd68)
2019-08-13 17:07:53 -04:00
..
monitors Remove translation of log messages 2017-06-09 09:06:16 +00:00
__init__.py Switch to using oslo_* instead of oslo.* 2015-02-06 06:03:10 -05:00
api.py Merge "Share snapshot image membership with instance owner" into stable/rocky 2019-06-28 19:17:19 +00:00
build_results.py Compute Add build_instance hook in compute manager 2014-12-04 10:12:00 -05:00
cells_api.py Fix missing marker functions 2018-01-25 03:37:48 +00:00
claims.py [Trivial] docstrings, typos, minor refactoring 2017-08-28 08:33:58 -05:00
flavors.py Remove unused flavor_delete_info() method 2018-08-03 12:44:52 -04:00
instance_actions.py Add instance action record for snapshot instances 2017-12-11 17:46:38 +08:00
instance_list.py Use nova.db.api directly 2018-07-10 14:56:27 +00:00
manager.py Merge "Drop source node allocations if finish_resize fails" into stable/rocky 2019-08-08 17:02:18 +00:00
migration_list.py Use nova.db.api directly 2018-07-10 14:56:27 +00:00
multi_cell_list.py Make nova list and migration-list ignore down cells 2018-06-25 17:28:57 -04:00
power_state.py Removed enum duplication from nova.compute 2016-09-02 07:30:44 +00:00
provider_tree.py Perf: Use dicts for ProviderTree roots 2019-07-10 15:19:45 -05:00
resource_tracker.py rt: only map compute node if we created it 2019-08-13 17:07:53 -04:00
rpcapi.py Make compute rpcapi version calculation check all cells 2018-12-13 16:10:05 +00:00
stats.py Change consecutive build failure limit to a weigher 2018-06-06 15:18:50 -07:00
task_states.py Fix resource tracker updates during instance evacuation 2019-03-05 19:22:14 +08:00
utils.py Replace non-nova server fault message 2019-08-06 11:35:58 -04:00
vm_states.py Removed enum duplication from nova.compute 2016-09-02 07:30:44 +00:00