From: Determe, Sebastien (sd378r) Date: Mon, 9 Apr 2018 09:13:34 +0000 (+0200) Subject: Fix SDC deployment X-Git-Tag: v2.0.0~59^2 X-Git-Url: https://gerrit.onap.org/r/gitweb?a=commitdiff_plain;h=6a5e92c5bb38f668b1be86adee513602f8151bb5;p=clamp.git Fix SDC deployment Fix the SDC deployment, inversion of the "already existing" check Issue-ID: CLAMP-151 Change-Id: I2d83033dd5df373965196dd00ead6fcab9bdc260 Signed-off-by: Determe, Sebastien (sd378r) --- diff --git a/src/main/java/org/onap/clamp/clds/sdc/controller/SdcSingleController.java b/src/main/java/org/onap/clamp/clds/sdc/controller/SdcSingleController.java index a0449a32..627bc72a 100644 --- a/src/main/java/org/onap/clamp/clds/sdc/controller/SdcSingleController.java +++ b/src/main/java/org/onap/clamp/clds/sdc/controller/SdcSingleController.java @@ -206,6 +206,13 @@ public class SdcSingleController { refProp.getStringValue(CONFIG_SDC_FOLDER)); csar.save(downloadTheArtifact(csar.getArtifactElement())); if (csarInstaller.isCsarAlreadyDeployed(csar)) { + this.sendSdcNotification(NotificationType.DOWNLOAD, csar.getArtifactElement().getArtifactURL(), + sdcConfig.getConsumerID(), iNotif.getDistributionID(), + DistributionStatusEnum.ALREADY_DOWNLOADED, null, System.currentTimeMillis()); + this.sendSdcNotification(NotificationType.DOWNLOAD, csar.getArtifactElement().getArtifactURL(), + sdcConfig.getConsumerID(), iNotif.getDistributionID(), DistributionStatusEnum.ALREADY_DEPLOYED, + null, System.currentTimeMillis()); + } else { this.sendSdcNotification(NotificationType.DOWNLOAD, csar.getArtifactElement().getArtifactURL(), sdcConfig.getConsumerID(), iNotif.getDistributionID(), DistributionStatusEnum.DOWNLOAD_OK, null, System.currentTimeMillis()); @@ -213,13 +220,6 @@ public class SdcSingleController { this.sendSdcNotification(NotificationType.DEPLOY, csar.getArtifactElement().getArtifactURL(), sdcConfig.getConsumerID(), iNotif.getDistributionID(), DistributionStatusEnum.DEPLOY_OK, null, System.currentTimeMillis()); - } else { - this.sendSdcNotification(NotificationType.DOWNLOAD, csar.getArtifactElement().getArtifactURL(), - sdcConfig.getConsumerID(), iNotif.getDistributionID(), - DistributionStatusEnum.ALREADY_DOWNLOADED, null, System.currentTimeMillis()); - this.sendSdcNotification(NotificationType.DOWNLOAD, csar.getArtifactElement().getArtifactURL(), - sdcConfig.getConsumerID(), iNotif.getDistributionID(), DistributionStatusEnum.ALREADY_DEPLOYED, - null, System.currentTimeMillis()); } } catch (SdcArtifactInstallerException e) { logger.error("SdcArtifactInstallerException exception caught during the notification processing", e);