summaryrefslogtreecommitdiffstats
path: root/models-tosca/src
diff options
context:
space:
mode:
Diffstat (limited to 'models-tosca/src')
-rw-r--r--models-tosca/src/main/java/org/onap/policy/models/tosca/simple/provider/SimpleToscaProvider.java3
1 files changed, 2 insertions, 1 deletions
diff --git a/models-tosca/src/main/java/org/onap/policy/models/tosca/simple/provider/SimpleToscaProvider.java b/models-tosca/src/main/java/org/onap/policy/models/tosca/simple/provider/SimpleToscaProvider.java
index 81a41aa05..761a47c9a 100644
--- a/models-tosca/src/main/java/org/onap/policy/models/tosca/simple/provider/SimpleToscaProvider.java
+++ b/models-tosca/src/main/java/org/onap/policy/models/tosca/simple/provider/SimpleToscaProvider.java
@@ -195,7 +195,6 @@ public class SimpleToscaProvider {
for (JpaToscaPolicy policy : serviceTemplate.getTopologyTemplate().getPolicies().getAll(null)) {
verifyPolicyTypeForPolicy(dao, policy);
-
dao.create(policy);
}
@@ -226,6 +225,7 @@ public class SimpleToscaProvider {
ToscaUtils.assertPoliciesExist(serviceTemplate);
for (JpaToscaPolicy policy : serviceTemplate.getTopologyTemplate().getPolicies().getAll(null)) {
+ verifyPolicyTypeForPolicy(dao, policy);
dao.update(policy);
}
@@ -288,6 +288,7 @@ public class SimpleToscaProvider {
if (PfKey.NULL_KEY_VERSION.equals(policyTypeKey.getVersion())) {
policyType = getLatestPolicyTypeVersion(dao, policyTypeKey.getName());
+ policy.getType().setVersion(policyType.getKey().getVersion());
} else {
policyType = dao.get(JpaToscaPolicyType.class, policyTypeKey);
}