diff options
author | zm330 <zhangminyj@chinamobile.com> | 2019-05-07 00:07:22 +0800 |
---|---|---|
committer | zm330 <zhangminyj@chinamobile.com> | 2019-05-07 16:21:07 +0800 |
commit | 5595d82ee5120b863a833e1e45b262d80f7dc6a1 (patch) | |
tree | f0b852e367b4f83083595e7b6ed4d0eb0398b14f /asdc-controller/src/main/java/org | |
parent | 7af16eec7a5ea196de57b47b918d3d88390a715c (diff) |
Update the format of resourceInput
Save format when resource is list type
e.g.
{key2:[vf_prop_list,INDEX,key]|default}
Issue-ID: SO-1393
Change-Id: Ibb5e7bb31114fa3bbd7a3e1af5f2152a98941a4b
Signed-off-by: zm330 <zhangminyj@chinamobile.com>
Diffstat (limited to 'asdc-controller/src/main/java/org')
-rw-r--r-- | asdc-controller/src/main/java/org/onap/so/asdc/installer/heat/ToscaResourceInstaller.java | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/asdc-controller/src/main/java/org/onap/so/asdc/installer/heat/ToscaResourceInstaller.java b/asdc-controller/src/main/java/org/onap/so/asdc/installer/heat/ToscaResourceInstaller.java index 179fa44547..388302f46e 100644 --- a/asdc-controller/src/main/java/org/onap/so/asdc/installer/heat/ToscaResourceInstaller.java +++ b/asdc-controller/src/main/java/org/onap/so/asdc/installer/heat/ToscaResourceInstaller.java @@ -575,15 +575,11 @@ public class ToscaResourceInstaller { Input input = inputOptional.get(); defaultValue = input.getDefault() != null ? input.getDefault().toString() : ""; } - String valueStr = value.toString(); - String regex = "(?<=\\[).*?(?=\\])"; + // Gets a value between [ and ] + String regex = "\\[.*?\\]"; Pattern pattern = Pattern.compile(regex); - Matcher matcher = pattern.matcher(valueStr); - if (matcher.find()) { - valueStr = matcher.group(); - } else { - valueStr = inputName; - } + Matcher matcher = pattern.matcher(value.toString()); + String valueStr = matcher.find() ? matcher.group() : inputName; outInput = valueStr + "|" + defaultValue; } else { outInput = value != null ? value.toString() : ""; @@ -1891,11 +1887,16 @@ public class ToscaResourceInstaller { resouceRequest.put(key, resourceValue); } + String resourceCustomizationUuid = + vfcTemplate.getMetaData().getValue(SdcPropertyNames.PROPERTY_NAME_CUSTOMIZATIONUUID); + String jsonStr = null; try { ObjectMapper objectMapper = new ObjectMapper(); jsonStr = objectMapper.writeValueAsString(resouceRequest); jsonStr = jsonStr.replace("\"", "\\\""); + logger.debug("vfcResource request for resource customization id (" + resourceCustomizationUuid + ") : " + + jsonStr); } catch (JsonProcessingException e) { e.printStackTrace(); } |