diff options
author | kuldipr <kuldip.rai@amdocs.com> | 2021-03-16 15:27:00 -0400 |
---|---|---|
committer | kuldipr <kuldip.rai@amdocs.com> | 2021-03-18 09:08:13 -0400 |
commit | 1bd6e1e2f978abbab4b924288a72ff6b2657d1e4 (patch) | |
tree | 677f1a50ad1a342a55328721244f06e64b65fee2 /asdc-controller/src/main/java | |
parent | a53a1aa617f7ca6c052f4b4a0578b20456ec6d93 (diff) |
Fixed sdc-controller ingestion logic for cds values
sdc controller was not picking the cds values because
logic expected the values in the 'metadata' block however
the cds values exist in the 'input' block. Logic is modified
to look for values at the correct location.
Issue-ID: SO-3591
Signed-off-by: kuldipr <kuldip.rai@amdocs.com>
Change-Id: I59778fde00025e22446446df560b5f85bfda7469
Signed-off-by: kuldipr <kuldip.rai@amdocs.com>
Diffstat (limited to 'asdc-controller/src/main/java')
-rw-r--r-- | asdc-controller/src/main/java/org/onap/so/asdc/installer/heat/ToscaResourceInstaller.java | 29 |
1 files changed, 23 insertions, 6 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 da7aad4319..bc4434a70a 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 @@ -1471,13 +1471,30 @@ public class ToscaResourceInstaller { generateNamingValue = "true".equalsIgnoreCase(generateNaming); } service.setOnapGeneratedNaming(generateNamingValue); - service.setBlueprintName(serviceMetadata.getValue(CDS_MODEL_NAME)); - service.setBlueprintVersion(serviceMetadata.getValue(CDS_MODEL_VERSION)); - service.setSkipPostInstConf(Boolean.valueOf(serviceMetadata.getValue(SKIP_POST_INST_CONF))); - service.setControllerActor(serviceMetadata.getValue(CONTROLLER_ACTOR)); - } - + List<Input> serviceInputs = toscaResourceStructure.getSdcCsarHelper().getServiceInputs(); + logger.debug("serviceInputs: {} " + serviceInputs); + if (!serviceInputs.isEmpty()) { + serviceInputs.forEach(input -> { + if (CDS_MODEL_NAME.equalsIgnoreCase(input.getName())) { + String value = input.getDefault() != null ? input.getDefault().toString() : null; + service.setBlueprintName(value); + } + if (CDS_MODEL_VERSION.equalsIgnoreCase(input.getName())) { + String value = input.getDefault() != null ? input.getDefault().toString() : null; + service.setBlueprintVersion(value); + } + if (CONTROLLER_ACTOR.equalsIgnoreCase(input.getName())) { + String value = input.getDefault() != null ? input.getDefault().toString() : null; + service.setControllerActor(value); + } + if (SKIP_POST_INST_CONF.equalsIgnoreCase(input.getName())) { + String value = input.getDefault() != null ? input.getDefault().toString() : "false"; + service.setSkipPostInstConf(Boolean.valueOf(value)); + } + }); + } + } toscaResourceStructure.setCatalogService(service); return service; } |