openstack overcloud netenv validate fails due to missing key "os_net_config"

Bug #1923612 reported by Yadnesh Kulkarni
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
tripleo
Fix Committed
Undecided
Yadnesh Kulkarni

Bug Description

Description:

Validating network-environment file fails due to missing "os_net_config" key in nic-configs files
~~~
(overcloud) [stack@nfv-undercloud-0 ~]$ openstack overcloud netenv validate -f templates/network-environment.yaml
Exception occured while running the command
Traceback (most recent call last):
  File "/usr/lib/python3.6/site-packages/tripleoclient/command.py", line 32, in run
    super(Command, self).run(parsed_args)
  File "/usr/lib/python3.6/site-packages/osc_lib/command/command.py", line 41, in run
    return super(Command, self).run(parsed_args)
  File "/usr/lib/python3.6/site-packages/cliff/command.py", line 185, in run
    return_code = self.take_action(parsed_args) or 0
  File "/usr/lib/python3.6/site-packages/tripleoclient/v1/overcloud_netenv_validate.py", line 61, in take_action
    self.NIC_validate(item, data_path)
  File "/usr/lib/python3.6/site-packages/tripleoclient/v1/overcloud_netenv_validate.py", line 179, in NIC_validate
    'os_net_config']['network_config']
KeyError: 'os_net_config'
'os_net_config'
~~~

For a sample nic-config like this, to iterate over the interfaces and bridges, it should be
['config']['str_replace']['params']['$network_config']['network_config'] rather than [1]
~~~
      config:
        str_replace:
          template:
                  get_file: /usr/share/openstack-tripleo-heat-templates/network/scripts/run-os-net-config.sh
          params:
            $network_config:
              network_config:
              - type: interface

~~~

[1] https://opendev.org/openstack/python-tripleoclient/src/branch/master/tripleoclient/v1/overcloud_netenv_validate.py#L177-L178

Changed in tripleo:
assignee: nobody → Yadnesh Kulkarni (ykulkarn)
Revision history for this message
Yadnesh Kulkarni (ykulkarn) wrote :
Changed in tripleo:
status: New → Fix Committed
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.