aboutsummaryrefslogtreecommitdiffstats
path: root/src/main
diff options
context:
space:
mode:
authorsebdet <sebastien.determe@intl.att.com>2019-04-05 18:00:51 +0200
committersebdet <sebastien.determe@intl.att.com>2019-04-08 10:39:14 +0200
commita6d476bfa4ae4350f979cc85d71ba98a6b6410b5 (patch)
tree8eef49fec7cde31c4df8946b61f3c5e2776c5b3c /src/main
parenta9f66923cddf2263ebbeb24825b95875c6932281 (diff)
Fix config policy
Fix saving of config policy due to refactoring + fix missing model type in config policy Issue-ID: CLAMP-303 Change-Id: I863f3bb6b2acef8ed7bf534e142c1730b1493b67 Signed-off-by: sebdet <sebastien.determe@intl.att.com>
Diffstat (limited to 'src/main')
-rw-r--r--src/main/java/org/onap/clamp/clds/sdc/controller/installer/BlueprintParser.java3
-rw-r--r--src/main/java/org/onap/clamp/policy/microservice/MicroservicePolicyService.java7
2 files changed, 6 insertions, 4 deletions
diff --git a/src/main/java/org/onap/clamp/clds/sdc/controller/installer/BlueprintParser.java b/src/main/java/org/onap/clamp/clds/sdc/controller/installer/BlueprintParser.java
index f3654596..93374fe1 100644
--- a/src/main/java/org/onap/clamp/clds/sdc/controller/installer/BlueprintParser.java
+++ b/src/main/java/org/onap/clamp/clds/sdc/controller/installer/BlueprintParser.java
@@ -87,7 +87,8 @@ public class BlueprintParser {
}
}
String msName = theBiggestMicroServiceKey.toLowerCase().contains(HOLMES_PREFIX) ? HOLMES : TCA;
- return Collections.singletonList(new MicroService(msName, "", "", "", ""));
+ return Collections
+ .singletonList(new MicroService(msName, "onap.policy.monitoring.cdap.tca.hi.lo.ap", "", "", ""));
}
String getName(Entry<String, JsonElement> entry) {
diff --git a/src/main/java/org/onap/clamp/policy/microservice/MicroservicePolicyService.java b/src/main/java/org/onap/clamp/policy/microservice/MicroservicePolicyService.java
index b14e1450..59ddaa00 100644
--- a/src/main/java/org/onap/clamp/policy/microservice/MicroservicePolicyService.java
+++ b/src/main/java/org/onap/clamp/policy/microservice/MicroservicePolicyService.java
@@ -65,9 +65,10 @@ public class MicroservicePolicyService implements PolicyService<MicroServicePoli
* @return The updated MicroService policy
*/
public MicroServicePolicy getAndUpdateMicroServicePolicy(Loop loop, MicroServicePolicy policy) {
- return repository.findById(policy.getName()).map(p -> updateMicroservicePolicyProperties(p, policy, loop))
- .orElse(new MicroServicePolicy(policy.getName(), policy.getModelType(), policy.getPolicyTosca(),
- policy.getShared(), policy.getJsonRepresentation(), Sets.newHashSet(loop)));
+ return repository
+ .save(repository.findById(policy.getName()).map(p -> updateMicroservicePolicyProperties(p, policy, loop))
+ .orElse(new MicroServicePolicy(policy.getName(), policy.getModelType(), policy.getPolicyTosca(),
+ policy.getShared(), policy.getJsonRepresentation(), Sets.newHashSet(loop))));
}
private MicroServicePolicy updateMicroservicePolicyProperties(MicroServicePolicy oldPolicy,