X-Git-Url: https://osm.etsi.org/gitweb/?a=blobdiff_plain;f=rwcm%2Fplugins%2Frwconman%2Frift%2Ftasklets%2Frwconmantasklet%2Frwconman_config.py;h=435ba06d42b1f61cc7dc0ac672d134813d544d0d;hb=7295f64eb5dd9d75b1dd272567c99304b65a7d0a;hp=26af0564874b6974a16fb5072bcf59ce4f4ab421;hpb=e5e7200b0d281203a77ec6e92cdd2f2c6e696275;p=osm%2FSO.git diff --git a/rwcm/plugins/rwconman/rift/tasklets/rwconmantasklet/rwconman_config.py b/rwcm/plugins/rwconman/rift/tasklets/rwconmantasklet/rwconman_config.py index 26af0564..435ba06d 100644 --- a/rwcm/plugins/rwconman/rift/tasklets/rwconmantasklet/rwconman_config.py +++ b/rwcm/plugins/rwconman/rift/tasklets/rwconmantasklet/rwconman_config.py @@ -678,10 +678,6 @@ class ConfigManagerConfig(object): if vnfr_name: inp['vnfr_name'] = vnfr_name - # TODO (pjoseph): Add config agents, we need to identify which all - # config agents are required from this NS and provide only those - inp['config-agent'] = {} - # Add parameters for initial config inp['parameter'] = {} for parameter in parameters: @@ -696,6 +692,20 @@ class ConfigManagerConfig(object): format(nsr_obj.nsr_name, parameter, e)) + # Add config agents specific to each VNFR + inp['config-agent'] = {} + for vnfr in nsr_obj.agent_nsr.vnfrs: + # Get the config agent for the VNFR + # If vnfr name is specified, add only CA specific to that + if (vnfr_name is None) or \ + (vnfr_name == vnfr.name): + agent = self._config_agent_mgr.get_vnfr_config_agent(vnfr.vnfr_msg) + if agent: + if agent.agent_type != riftcm_config_plugin.DEFAULT_CAP_TYPE: + inp['config-agent'][vnfr.member_vnf_index] = agent.agent_data + inp['config-agent'][vnfr.member_vnf_index] \ + ['service-name'] = agent.get_service_name(vnfr.id) + # Add vnfrs specific data inp['vnfr'] = {} for vnfr in nsr_obj.vnfrs: @@ -726,10 +736,11 @@ class ConfigManagerConfig(object): if k in vdu: d[k] = vdu[k] vdu_data.append(d) - v['vdur'].append(vdu_data) + v['vdur'] = vdu_data inp['vnfr'][vnfr['member_vnf_index_ref']] = v + self._log.debug("Input data for {}: {}". format((vnfr_name if vnfr_name else nsr_obj.nsr_name), inp))