-
Bug
-
Resolution: Done
-
High
-
Casablanca Release
in the class org.onap.so.openstack.utils.MsoMulticloudUtils in the method org.onap.so.openstack.utils.MsoMulticloudUtils.createStack(String, String, String, String, Map<String, ?>, boolean, int, String, Map<String, Object>, Map<String, Object>, boolean)
there is the code
multicloudRequest.setOofDirectives(JSON_MAPPER.readTree(oofDirectives));
multicloudRequest.setSdncDirectives(JSON_MAPPER.readTree(sdncDirectives));
this will result in the exception
com.fasterxml.jackson.databind.JsonMappingException: No content to map due to end-of-inputcom.fasterxml.jackson.databind.JsonMappingException: No content to map due to end-of-input at [Source: ; line: 1, column: 0] at com.fasterxml.jackson.databind.JsonMappingException.from(JsonMappingException.java:270) at com.fasterxml.jackson.databind.ObjectMapper._initForReading(ObjectMapper.java:3854) at com.fasterxml.jackson.databind.ObjectMapper._readMapAndClose(ObjectMapper.java:3799) at com.fasterxml.jackson.databind.ObjectMapper.readTree(ObjectMapper.java:2397)
this is because the default is set to
String oofDirectives = "";
String sdncDirectives = "";
"" isn't valid JSON
I think the code should be
if (!"".equalsIgnoreCase(oofDirectives))
{ multicloudRequest.setOofDirectives(JSON_MAPPER.readTree(oofDirectives)); }if (!"".equalsIgnoreCase(sdncDirectives))
{ multicloudRequest.setSdncDirectives(JSON_MAPPER.readTree(sdncDirectives)); }