I have solved by changing theĀ buildVfModuleParams of VfModuleBase.groovy file.
I have changed the "userDirectives" part of code by fetching the correct value
to insert into userDirectives array:
String userDirectives = "{}"
if (paramsMap != null) {
StringBuilder userDirectivesBuilder = new StringBuilder()
userDirectivesBuilder.append("{ \"attributes\": [")
pcnt = 0
for (Map.Entry<String, String> entry : paramsMap.entrySet()) {
String vnfKey = entry.getKey()
String vnfValue = entry.getValue()
// paramsMap.put("$vnfKey", "$vnfValue")
logger.debug("[VfModuleBase-userDirectives] Key value :
"+vnfKey.toString()+" "+vnfValue.toString())
*if (("definition-name".equals(vnfKey)) ||
("definition-version".equals(vnfKey)) || ("profile-name".equals(vnfKey)) ||
("template_type".equals(vnfKey))) {*
if (pcnt > 0) {
userDirectivesBuilder.append(",")
}
pcnt++
userDirectivesBuilder.append("{\"attribute_name\":\"${vnfKey}\",")
userDirectivesBuilder.append("\"attribute_value\":\"${vnfValue}\"}")
}
}
if (pcnt > 0) {
userDirectives = userDirectivesBuilder.append("]}").toString()
}
}
paramsMap.put("user_directives", "${userDirectives}")
logger.debug("[VfModuleBase] userDirectives: "+userDirectives.toString())
Please, take a look and give me some feedback.
Thanks,
Aniello Paolo Malinconico
-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#19657): https://lists.onap.org/g/onap-discuss/message/19657
Mute This Topic: https://lists.onap.org/mt/68274830/21656
Group Owner: [email protected]
Unsubscribe: https://lists.onap.org/g/onap-discuss/unsub
[[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-