aboutsummaryrefslogtreecommitdiffstats
path: root/participant/participant-impl/participant-impl-policy
diff options
context:
space:
mode:
Diffstat (limited to 'participant/participant-impl/participant-impl-policy')
-rw-r--r--participant/participant-impl/participant-impl-policy/src/main/java/org/onap/policy/clamp/acm/participant/policy/main/handler/AutomationCompositionElementHandler.java6
1 files changed, 5 insertions, 1 deletions
diff --git a/participant/participant-impl/participant-impl-policy/src/main/java/org/onap/policy/clamp/acm/participant/policy/main/handler/AutomationCompositionElementHandler.java b/participant/participant-impl/participant-impl-policy/src/main/java/org/onap/policy/clamp/acm/participant/policy/main/handler/AutomationCompositionElementHandler.java
index 34c195501..5a3bc6328 100644
--- a/participant/participant-impl/participant-impl-policy/src/main/java/org/onap/policy/clamp/acm/participant/policy/main/handler/AutomationCompositionElementHandler.java
+++ b/participant/participant-impl/participant-impl-policy/src/main/java/org/onap/policy/clamp/acm/participant/policy/main/handler/AutomationCompositionElementHandler.java
@@ -182,7 +182,7 @@ public class AutomationCompositionElementHandler extends AcElementListenerV2 {
createPolicyResp = response.getStatus();
}
}
- if (createPolicyTypeResp == HttpStatus.SC_OK && createPolicyResp == HttpStatus.SC_OK) {
+ if (isSuccess(createPolicyTypeResp) && isSuccess(createPolicyResp)) {
LOGGER.info(
"PolicyTypes/Policies for the automation composition element : {} are created " + "successfully",
instanceElement.elementId());
@@ -195,6 +195,10 @@ public class AutomationCompositionElementHandler extends AcElementListenerV2 {
}
}
+ private boolean isSuccess(int status) {
+ return status == HttpStatus.SC_OK || status == HttpStatus.SC_CREATED;
+ }
+
private List<ToscaConceptIdentifier> getPolicyTypeList(ToscaServiceTemplate serviceTemplate) {
List<ToscaConceptIdentifier> policyTypeList = new ArrayList<>();
if (serviceTemplate.getPolicyTypes() != null) {