Merge "Fix missing node facts with BIFROST_INVENTORY_SOURCE=ironic"

This commit is contained in:
Zuul 2020-12-03 22:34:44 +00:00 committed by Gerrit Code Review
commit 7b0ec19256
3 changed files with 36 additions and 14 deletions

View File

@ -231,8 +231,7 @@ def _process_sdk(groups, hostvars):
node_names = node_names.split(',')
for machine in machines:
if 'properties' not in machine:
machine = cloud.get_machine(machine['uuid'])
machine = cloud.get_machine(machine['uuid'])
if machine['name'] is None:
name = machine['uuid']
else:

View File

@ -44,18 +44,26 @@ class TestBifrostInventoryUnit(base.TestCase):
mock_cloud = mock_sdk.return_value
mock_cloud.list_machines.return_value = [
{
'driver_info': {
'ipmi_address': '1.2.3.4',
},
'driver_info': None,
'links': [],
'name': 'node1',
'ports': [],
'properties': {
'cpus': 42,
},
'properties': None,
'uuid': 'f3fbf7c6-b4e9-4dd2-8ca0-c74a50f8be45',
},
]
mock_cloud.get_machine.return_value = {
'driver_info': {
'ipmi_address': '1.2.3.4',
},
'links': [],
'name': 'node1',
'ports': [],
'properties': {
'cpus': 42,
},
'uuid': 'f3fbf7c6-b4e9-4dd2-8ca0-c74a50f8be45',
}
mock_cloud.list_nics_for_machine.return_value = [
{
'address': '00:11:22:33:44:55',
@ -94,18 +102,26 @@ class TestBifrostInventoryUnit(base.TestCase):
mock_cloud = mock_sdk.return_value
mock_cloud.list_machines.return_value = [
{
'driver_info': {
'ipmi_address': '1.2.3.4',
},
'driver_info': None,
'links': [],
'name': 'node1',
'ports': [],
'properties': {
'cpus': 42,
},
'properties': None,
'uuid': 'f3fbf7c6-b4e9-4dd2-8ca0-c74a50f8be45',
},
]
mock_cloud.get_machine.return_value = {
'driver_info': {
'ipmi_address': '1.2.3.4',
},
'links': [],
'name': 'node1',
'ports': [],
'properties': {
'cpus': 42,
},
'uuid': 'f3fbf7c6-b4e9-4dd2-8ca0-c74a50f8be45',
}
mock_cloud.list_nics_for_machine.return_value = [
{
'address': '00:11:22:33:44:55',

View File

@ -0,0 +1,7 @@
---
fixes:
- |
Fixes an issue with the Bifrost inventory plugin when used with
``BIFROST_INVENTORY_SOURCE=ironic``. All node fields are now returned as
facts, as in Ussuri and earlier releases. See `story 2008394
<https://storyboard.openstack.org/#!/story/2008394>`__ for details.