From 1b55edad8e4a3b6c28c4c8b066de4e6a38f63479 Mon Sep 17 00:00:00 2001 From: sebdet Date: Thu, 9 May 2019 19:30:30 +0200 Subject: Fix dcae url status Set it to null when undeploy is successful Issue-ID: CLAMP-376 Change-Id: I0c7f7b2e1464bcd72ece47f5d89730de1718b636 Signed-off-by: sebdet --- src/main/java/org/onap/clamp/loop/LoopOperation.java | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'src/main') diff --git a/src/main/java/org/onap/clamp/loop/LoopOperation.java b/src/main/java/org/onap/clamp/loop/LoopOperation.java index 172b77c28..87effa5fd 100644 --- a/src/main/java/org/onap/clamp/loop/LoopOperation.java +++ b/src/main/java/org/onap/clamp/loop/LoopOperation.java @@ -144,12 +144,13 @@ public class LoopOperation { JSONObject linksObj = (JSONObject) jsonObj.get(DCAE_LINK_FIELD); String statusUrl = (String) linksObj.get(DCAE_STATUS_FIELD); - // use http4 instead of http, because camel http4 component is used to do the - // http call - String newStatusUrl = statusUrl.replaceAll("http:", "http4:").replaceAll("https:", "https4:"); - - loop.setDcaeDeploymentId(deploymentId); - loop.setDcaeDeploymentStatusUrl(newStatusUrl); + if (deploymentId == null) { + loop.setDcaeDeploymentId(null); + loop.setDcaeDeploymentStatusUrl(null); + } else { + loop.setDcaeDeploymentId(deploymentId); + loop.setDcaeDeploymentStatusUrl(statusUrl.replaceAll("http:", "http4:").replaceAll("https:", "https4:")); + } loopService.saveOrUpdateLoop(loop); } -- cgit 1.2.3-korg