Browse Source

Fix network environment validation

Network environment validation fails when accessing value
with the key 'os_net_config' from the nic-config files.
Fix the dictionary keys needed to fetch the network
config from nic_data.

Signed-off-by: Yadnesh Kulkarni <ykulkarn@redhat.com>
Change-Id: I2ec628dd9c9cf14c0cd9d8ba30f53ac18efe115f
changes/46/788046/1
Yadnesh Kulkarni 2 months ago
parent
commit
930abb12b3
2 changed files with 7 additions and 3 deletions
  1. +6
    -2
      tripleoclient/tests/v1/overcloud_netenv_validate/test_overcloud_netenv_validate.py
  2. +1
    -1
      tripleoclient/v1/overcloud_netenv_validate.py

+ 6
- 2
tripleoclient/tests/v1/overcloud_netenv_validate/test_overcloud_netenv_validate.py View File

@ -46,8 +46,12 @@ class TestValidateOvercloudNetenv(fakes.TestValidateOvercloudNetenv):
'OsNetConfigImpl': {
'properties': {
'config': {
'os_net_config': {
'network_config': bridges,
'str_replace': {
'params': {
'$network_config': {
'network_config': bridges,
}
}
}
}
}


+ 1
- 1
tripleoclient/v1/overcloud_netenv_validate.py View File

@ -175,7 +175,7 @@ class ValidateOvercloudNetenv(command.Command):
# no bonds.
for item in nic_data['resources']:
bridges = nic_data['resources'][item]['properties']['config'][
'os_net_config']['network_config']
'str_replace']['params']['$network_config']['network_config']
for bridge in bridges:
if bridge['type'] == 'ovs_bridge':
bond_count = 0


Loading…
Cancel
Save