R5.0.1 - multicloud :: global_configuration in instances.yml being read incorrectly.

Bug #1786993 reported by Ritam Gangopadhyay on 2018-08-14
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Juniper Openstack
Status tracked in Trunk
R5.0
Fix Committed
Medium
Sanju Abraham
Trunk
Fix Committed
Medium
Sanju Abraham

Bug Description

This is the failure path of the code:-

If I have ansible/contrail/common.yml like below:-

CONTRAIL_ANSIBLE_DEPLOYER: R5.0
global_configuration:
  CONTAINER_REGISTRY: hub.juniper.net/contrail-nightly
  CONTAINER_REGISTRY_USERNAME: JNPR-Customer200
  CONTAINER_REGISTRY_PASSWORD: FSg0vLW^7oM#GZy8Ju*f
CONTRAIL_VERSION: ocata-5.0-198

The code below will fail:-
cb791507d1d0:~/multicloud# grep -rn global_con transform/generate_inventories.py
295: ret['global_configuration'] = {'CONTAINER_REGISTRY': contrail_vars['CONTAINER_REGISTRY']}
296: if 'global_configuration' in contrail_vars:
297: ret['global_configuration'].update(contrail_vars['global_configuration'])
cb791507d1d0:~/multicloud#

*****************************************
*****************************************
*****************************************

This is the failure and it should not be read like this from common.yml it would be better to remove line 295 and make registry a mandatory config under global_configuration.

cb791507d1d0:~/multicloud# ./transform/generate_inventories.py -t topology.yml -s secret.yml
Traceback (most recent call last):
  File "./transform/generate_inventories.py", line 471, in <module>
    contrail_config=contrail_config)
  File "./transform/generate_inventories.py", line 424, in initialize
    return invObj.output_inventory(gateways, contrail, tor, onprem_ospf, state, contrail_config)
  File "./transform/generate_inventories.py", line 373, in output_inventory
    contrail_config = self.prepare_contrail_config(self.instances, contrail_common)
  File "./transform/generate_inventories.py", line 295, in prepare_contrail_config
    ret['global_configuration'] = {'CONTAINER_REGISTRY': contrail_vars['CONTAINER_REGISTRY']}
KeyError: 'CONTAINER_REGISTRY'
cb791507d1d0:~/multicloud#

For now, always specify CONTAINER_REGISTRY outside of global configuration in common.yml

Sanju Abraham (asanju) wrote :

This is fixed in the R5.0 - https://github.com/Juniper/contrail-multi-cloud/commit/b60954150cc416ad5df73d6a966bdec53e688339

The new structure in the contrail/common.yml is:

global_configuration:
   CONTAINER_REGISTRY: "hub.juniper.net"
   REGISTRY_PRIVATE_INSECURE: TRUE
   CONTRAIL_VERSION: 5.0.1-0.214
   #CONTAINER_REGISTRY_USERNAME: user1
   #CONTAINER_REGISTRY_PASSWORD: user1pass

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers