- def xlate_conf(self, vnfr, vnf_cfg):
-
- # If configuration type is not already set, try to read from attributes
- if vnf_cfg['interface_type'] is None:
- # Prepare unique name for this VNF
- vnf_unique_name = get_vnf_unique_name(
- vnf_cfg['nsr_name'],
- vnfr['short_name'],
- vnfr['member_vnf_index_ref'],
- )
-
- # Find this particular (unique) VNF's config attributes
- if (vnf_unique_name in self.vnf_config_attributes_dict):
- vnf_cfg_config_attributes_dict = self.vnf_config_attributes_dict[vnf_unique_name]
- vnf_cfg['interface_type'] = vnf_cfg_config_attributes_dict['configuration_type']
- if 'configuration_options' in vnf_cfg_config_attributes_dict:
- cfg_opts = vnf_cfg_config_attributes_dict['configuration_options']
- for key, value in cfg_opts.items():
- vnf_cfg[key] = value
-
- cfg_path_prefix = '{}/{}/{}_{}'.format(
- self._parent._parent.cfg_dir,
- vnf_cfg['nsr_name'],
- vnfr['short_name'],
- vnfr['member_vnf_index_ref'],
- )
-
- vnf_cfg['cfg_template'] = '{}_{}_template.cfg'.format(cfg_path_prefix, vnf_cfg['interface_type'])
- vnf_cfg['cfg_file'] = '{}.cfg'.format(cfg_path_prefix)
- vnf_cfg['xlate_script'] = self._parent._parent.cfg_dir + '/xlate_cfg.py'
-
- self._log.debug("VNF endpoint so far: %s", vnf_cfg)
-
- self._log.info("Checking cfg_template %s", vnf_cfg['cfg_template'])
- if os.path.exists(vnf_cfg['cfg_template']):
- return True
- return False
-