Fix dcae url status 82/87382/1 4.0.1
authorsebdet <sebastien.determe@intl.att.com>
Thu, 9 May 2019 17:30:30 +0000 (19:30 +0200)
committersebdet <sebastien.determe@intl.att.com>
Thu, 9 May 2019 17:30:30 +0000 (19:30 +0200)
Set it to null when undeploy is successful

Issue-ID: CLAMP-376
Change-Id: I0c7f7b2e1464bcd72ece47f5d89730de1718b636
Signed-off-by: sebdet <sebastien.determe@intl.att.com>
src/main/java/org/onap/clamp/loop/LoopOperation.java

index 172b77c..87effa5 100644 (file)
@@ -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);
     }