diff options
author | sebdet <sebastien.determe@intl.att.com> | 2021-10-11 10:52:23 +0200 |
---|---|---|
committer | S�bastien Determe <sebastien.determe@intl.att.com> | 2021-10-11 11:31:17 +0000 |
commit | 7585ac35524c43acb23d178efed9223643a5c5c4 (patch) | |
tree | 10047f4fe272cb4d21a949bda8022ea629ce4851 /runtime | |
parent | b33792767bd90ce5f049d088c64812568d9a55d5 (diff) |
Fix delete action in design state
It can still happen due to DCAE deployment, so this patch should fix it.
+ Fix test due to changes done in DCAE camel flows
Issue-ID: POLICY-3707
Signed-off-by: sebdet <sebastien.determe@intl.att.com>
Change-Id: I0f439fc029354a0632b2b17a452b7811df90492a
Diffstat (limited to 'runtime')
3 files changed, 11 insertions, 11 deletions
diff --git a/runtime/src/main/resources/clds/camel/rest/clamp-api-v2.xml b/runtime/src/main/resources/clds/camel/rest/clamp-api-v2.xml index 82e1940b1..e7ba1283f 100644 --- a/runtime/src/main/resources/clds/camel/rest/clamp-api-v2.xml +++ b/runtime/src/main/resources/clds/camel/rest/clamp-api-v2.xml @@ -336,6 +336,9 @@ <to uri="direct:load-loop"/> <to uri="bean:org.onap.policy.clamp.loop.log.LoopLogService?method=addLog('DCAE UNDEPLOY request','INFO',${exchangeProperty[loopObject]})"/> + <setProperty name="raiseHttpExceptionFlag"> + <simple resultType="java.lang.Boolean">true</simple> + </setProperty> <to uri="direct:undeploy-loop"/> <log loggingLevel="INFO" @@ -549,9 +552,6 @@ <doTry> <log loggingLevel="INFO" message="DELETE request for loop: ${header.loopName}"/> - <setProperty name="raiseHttpExceptionFlag"> - <simple resultType="java.lang.Boolean">true</simple> - </setProperty> <to uri="bean:org.onap.policy.clamp.flow.log.FlowLogOperation?method=startLog(*,'DELETE request')"/> <to @@ -559,11 +559,17 @@ <to uri="direct:load-loop"/> <to uri="bean:org.onap.policy.clamp.loop.log.LoopLogService?method=addLog('DELETE request','INFO',${exchangeProperty[loopObject]})"/> + + <setProperty name="raiseHttpExceptionFlag"> + <simple resultType="java.lang.Boolean">false</simple> + </setProperty> <to uri="direct:undeploy-loop"/> + <setProperty name="raiseHttpExceptionFlag"> <simple resultType="java.lang.Boolean">false</simple> </setProperty> <to uri="direct:remove-all-policy-from-active-pdp-group"/> + <log loggingLevel="INFO" message="Deleting all MICRO-SERVICES policies defined in loop ${exchangeProperty[loopObject].getName()}"/> <split> diff --git a/runtime/src/main/resources/clds/camel/routes/dcae-flows.xml b/runtime/src/main/resources/clds/camel/routes/dcae-flows.xml index 517fb09a9..55ec70d16 100644 --- a/runtime/src/main/resources/clds/camel/routes/dcae-flows.xml +++ b/runtime/src/main/resources/clds/camel/routes/dcae-flows.xml @@ -180,17 +180,11 @@ <when> <simple>${exchangeProperty['loopObject'].getLoopTemplate().getUniqueBlueprint()} == true </simple> - <setProperty name="raiseHttpExceptionFlag"> - <simple resultType="java.lang.Boolean">true</simple> - </setProperty> <to uri="direct:undeploy-loop-single-blueprint"/> </when> <when> <simple>${exchangeProperty['loopObject'].getLoopTemplate().getUniqueBlueprint()} == false </simple> - <setProperty name="raiseHttpExceptionFlag"> - <simple resultType="java.lang.Boolean">true</simple> - </setProperty> <to uri="direct:undeploy-loop-multi-blueprint"/> </when> </choice> diff --git a/runtime/src/test/java/org/onap/policy/clamp/loop/DeployFlowItTestCase.java b/runtime/src/test/java/org/onap/policy/clamp/loop/DeployFlowItTestCase.java index bfd5b0377..899b6206b 100644 --- a/runtime/src/test/java/org/onap/policy/clamp/loop/DeployFlowItTestCase.java +++ b/runtime/src/test/java/org/onap/policy/clamp/loop/DeployFlowItTestCase.java @@ -154,7 +154,7 @@ public class DeployFlowItTestCase { loopTest.addMicroServicePolicy(microServicePolicy); loopService.saveOrUpdateLoop(loopTest); Exchange myCamelExchange = ExchangeBuilder.anExchange(camelContext).withProperty("loopObject", loopTest) - .build(); + .withProperty("raiseHttpExceptionFlag", true).build(); camelContext.createProducerTemplate().send("direct:undeploy-loop", myCamelExchange); @@ -189,7 +189,7 @@ public class DeployFlowItTestCase { loopTest2.addMicroServicePolicy(microServicePolicy2); loopsRepository.saveAndFlush(loopTest2); Exchange myCamelExchange = ExchangeBuilder.anExchange(camelContext).withProperty("loopObject", loopTest2) - .build(); + .withProperty("raiseHttpExceptionFlag", true).build(); camelContext.createProducerTemplate().send("direct:undeploy-loop", myCamelExchange); |