summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSébastien Determe <sd378r@intl.att.com>2018-04-25 13:12:57 +0000
committerGerrit Code Review <gerrit@onap.org>2018-04-25 13:12:57 +0000
commit142153e137df36bc470032e26b66313f7afe5df6 (patch)
tree74873468497dc8822fb64d538440b2ff2acabe82
parent879691ba309eb305c4dd24dc3d0b2c091a8a118c (diff)
parentd67bf35d358de09054049641892cab72eacbb7ce (diff)
Merge "Fix the Sdc Controller"
-rw-r--r--src/main/java/org/onap/clamp/clds/model/CldsModel.java5
-rw-r--r--src/main/java/org/onap/clamp/clds/sdc/controller/installer/CsarHandler.java2
-rw-r--r--src/main/java/org/onap/clamp/clds/sdc/controller/installer/CsarInstallerImpl.java4
3 files changed, 6 insertions, 5 deletions
diff --git a/src/main/java/org/onap/clamp/clds/model/CldsModel.java b/src/main/java/org/onap/clamp/clds/model/CldsModel.java
index b92ff5f71..af4d6c666 100644
--- a/src/main/java/org/onap/clamp/clds/model/CldsModel.java
+++ b/src/main/java/org/onap/clamp/clds/model/CldsModel.java
@@ -108,10 +108,11 @@ public class CldsModel {
/**
* Save model to DB.
*/
- public void save(CldsDao cldsDao, String userid) {
- cldsDao.setModel(this, userid);
+ public CldsModel save(CldsDao cldsDao, String userid) {
+ CldsModel cldsModel = cldsDao.setModel(this, userid);
determineStatus();
determinePermittedActionCd();
+ return cldsModel;
}
/**
diff --git a/src/main/java/org/onap/clamp/clds/sdc/controller/installer/CsarHandler.java b/src/main/java/org/onap/clamp/clds/sdc/controller/installer/CsarHandler.java
index 87c9c15fc..883543868 100644
--- a/src/main/java/org/onap/clamp/clds/sdc/controller/installer/CsarHandler.java
+++ b/src/main/java/org/onap/clamp/clds/sdc/controller/installer/CsarHandler.java
@@ -113,7 +113,7 @@ public class CsarHandler {
for (IResourceInstance resource : this.sdcNotification.getResources()) {
String filteredString = resource.getResourceInstanceName().replaceAll("-", "");
filteredString = filteredString.replaceAll(" ", "");
- if (filteredString.equals(blueprintResourceInstanceName)) {
+ if (filteredString.equalsIgnoreCase(blueprintResourceInstanceName)) {
return resource;
}
}
diff --git a/src/main/java/org/onap/clamp/clds/sdc/controller/installer/CsarInstallerImpl.java b/src/main/java/org/onap/clamp/clds/sdc/controller/installer/CsarInstallerImpl.java
index 0498ca75e..e28e8ab70 100644
--- a/src/main/java/org/onap/clamp/clds/sdc/controller/installer/CsarInstallerImpl.java
+++ b/src/main/java/org/onap/clamp/clds/sdc/controller/installer/CsarInstallerImpl.java
@@ -154,7 +154,7 @@ public class CsarInstallerImpl implements CsarInstaller {
List<String> policyNameList = new ArrayList<>();
Map<String, Object> templateNodes = ((Map<String, Object>) ((Map<String, Object>) yaml
.load(blueprintArtifact.getDcaeBlueprint())).get("node_templates"));
- templateNodes.entrySet().stream().filter(e -> e.getKey().contains("policy_")).forEach(ef -> {
+ templateNodes.entrySet().stream().filter(e -> e.getKey().contains("policy")).forEach(ef -> {
String filteredPolicyName = (String) ((Map<String, Object>) ((Map<String, Object>) ef.getValue())
.get("properties")).get("policy_filter");
if (policyName != null) {
@@ -230,7 +230,7 @@ public class CsarInstallerImpl implements CsarInstaller {
+ blueprintArtifact.getResourceAttached().getResourceInvariantUUID()
+ "\"]},{\"name\":\"actionSet\",\"value\":[\"vnfRecipe\"]},{\"name\":\"location\",\"value\":[\"DC1\"]},"
+ inputParams + "]}");
- cldsModel.save(cldsDao, null);
+ cldsModel = cldsModel.save(cldsDao, null);
logger.info("Fake Clds Model created for blueprint " + blueprintArtifact.getBlueprintArtifactName()
+ " with name " + cldsModel.getName());
return cldsModel;