aboutsummaryrefslogtreecommitdiffstats
path: root/participant
diff options
context:
space:
mode:
Diffstat (limited to 'participant')
-rwxr-xr-xparticipant/participant-impl/participant-impl-policy/src/main/java/org/onap/policy/clamp/acm/participant/policy/main/handler/AutomationCompositionElementHandler.java8
1 files changed, 6 insertions, 2 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 7fd8e0dec..281fe3e01 100755
--- 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
@@ -165,12 +165,16 @@ public class AutomationCompositionElementHandler implements AutomationCompositio
if (automationCompositionDefinition.getPolicyTypes() != null) {
LOGGER.info("Found Policy Types in automation composition definition: {} , Creating Policy Types",
automationCompositionDefinition.getName());
- createPolicyTypeResp = apiHttpClient.createPolicyType(automationCompositionDefinition).getStatus();
+ try (var response = apiHttpClient.createPolicyType(automationCompositionDefinition)) {
+ createPolicyTypeResp = response.getStatus();
+ }
}
if (automationCompositionDefinition.getToscaTopologyTemplate().getPolicies() != null) {
LOGGER.info("Found Policies in automation composition definition: {} , Creating Policies",
automationCompositionDefinition.getName());
- createPolicyResp = apiHttpClient.createPolicy(automationCompositionDefinition).getStatus();
+ try (var response = apiHttpClient.createPolicy(automationCompositionDefinition)) {
+ createPolicyResp = response.getStatus();
+ }
}
if (createPolicyTypeResp == HttpStatus.SC_OK && createPolicyResp == HttpStatus.SC_OK) {
LOGGER.info(