diff options
author | sebdet <sebastien.determe@intl.att.com> | 2021-10-08 13:52:10 +0200 |
---|---|---|
committer | sebdet <sebastien.determe@intl.att.com> | 2021-10-08 13:52:10 +0200 |
commit | b33792767bd90ce5f049d088c64812568d9a55d5 (patch) | |
tree | 9f9503ce0197ba1803ed01499a11b344a53eab11 | |
parent | b4f25510c8e71554cbbecf1cf1d9c21326d2d249 (diff) |
Fix delete instance in Design state
The "delete" flow should not crash when policies have not been deployed yet.
+ Fix DCAE logs (set to DCAe component)
+ Fix the STDOUT that should contain the error logs as requested by OOM team
Issue-ID: POLICY-3707
Signed-off-by: sebdet <sebastien.determe@intl.att.com>
Change-Id: I15951106280f4e781ee2f3140fa72a935d54f241
4 files changed, 14 insertions, 4 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 55e1f8ad1..82e1940b1 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 @@ -560,6 +560,9 @@ <to uri="bean:org.onap.policy.clamp.loop.log.LoopLogService?method=addLog('DELETE request','INFO',${exchangeProperty[loopObject]})"/> <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()}"/> @@ -597,6 +600,12 @@ message="DELETE request successfully executed for loop: ${header.loopName}"/> <to uri="bean:org.onap.policy.clamp.flow.log.FlowLogOperation?method=endLog()"/> + <setHeader name="CamelHttpResponseCode"> + <constant>200</constant> + </setHeader> + <setBody> + <simple>DELETE request SUCCESSFUL</simple> + </setBody> <doCatch> <exception>java.lang.Exception</exception> <handled> 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 d74bd91bf..517fb09a9 100644 --- a/runtime/src/main/resources/clds/camel/routes/dcae-flows.xml +++ b/runtime/src/main/resources/clds/camel/routes/dcae-flows.xml @@ -349,9 +349,9 @@ </when> <otherwise> <log loggingLevel="WARN" - message="Cannot Undeploy for the loop: ${exchangeProperty[loopObject].getName()}, the Deployment ID does not exist !"/> + message="Cannot Undeploy the loop: ${exchangeProperty[loopObject].getName()}, the Deployment ID does not exist !"/> <to - uri="bean:org.onap.policy.clamp.loop.log.LoopLogService?method=addLog('Cannot Undeploy for the loop: ${exchangeProperty[loopObject].getName()}, the Deployment ID does not exist !','WARNING',${exchangeProperty[loopObject]})"/> + uri="bean:org.onap.policy.clamp.loop.log.LoopLogService?method=addLogForComponent('Cannot Undeploy the loop: ${exchangeProperty[loopObject].getName()}, the Deployment ID does not exist !','WARNING','DCAE',${exchangeProperty[loopObject]})"/> </otherwise> </choice> </route> @@ -404,7 +404,7 @@ <log loggingLevel="ERROR" message="GET DCAE deployment request FAILED for loop: ${header.loopName}, ${exception.stacktrace}"/> <to - uri="bean:org.onap.policy.clamp.loop.log.LoopLogService?method=addLog('GET DCAE deployment request failed, Error reported: ${exception.message}','ERROR',${exchangeProperty[loopObject]})"/> + uri="bean:org.onap.policy.clamp.loop.log.LoopLogService?method=addLogForComponent('GET DCAE deployment request failed, Error reported: ${exception.message}','ERROR','DCAE',${exchangeProperty[loopObject]})"/> </doCatch> <doFinally> <to uri="direct:reset-raise-http-exception-flag"/> diff --git a/runtime/src/main/resources/logback-default.xml b/runtime/src/main/resources/logback-default.xml index 443bc0eb1..cfa280c45 100644 --- a/runtime/src/main/resources/logback-default.xml +++ b/runtime/src/main/resources/logback-default.xml @@ -214,5 +214,6 @@ <appender-ref ref="asyncAudit" /> <appender-ref ref="asyncMetric" /> <appender-ref ref="asyncSecurity" /> + <appender-ref ref="STDOUT" /> </root> </included> diff --git a/runtime/ui-react/src/api/LoopActionService.js b/runtime/ui-react/src/api/LoopActionService.js index bff812a2f..18ae90eff 100644 --- a/runtime/ui-react/src/api/LoopActionService.js +++ b/runtime/ui-react/src/api/LoopActionService.js @@ -32,7 +32,7 @@ export default class LoopActionService{ }) .then(function (response) { if (response.ok) { - return response.json(); + return response; } else { return Promise.reject("Perform action failed with code:" + response.status); } |