Fix SDC deployment 97/41697/1
authorDeterme, Sebastien (sd378r) <sd378r@intl.att.com>
Mon, 9 Apr 2018 09:13:34 +0000 (11:13 +0200)
committerDeterme, Sebastien (sd378r) <sd378r@intl.att.com>
Mon, 9 Apr 2018 09:13:34 +0000 (11:13 +0200)
Fix the SDC deployment, inversion of the "already existing" check

Issue-ID: CLAMP-151
Change-Id: I2d83033dd5df373965196dd00ead6fcab9bdc260
Signed-off-by: Determe, Sebastien (sd378r) <sd378r@intl.att.com>
src/main/java/org/onap/clamp/clds/sdc/controller/SdcSingleController.java

index a0449a3..627bc72 100644 (file)
@@ -206,6 +206,13 @@ public class SdcSingleController {
                     refProp.getStringValue(CONFIG_SDC_FOLDER));\r
             csar.save(downloadTheArtifact(csar.getArtifactElement()));\r
             if (csarInstaller.isCsarAlreadyDeployed(csar)) {\r
+                this.sendSdcNotification(NotificationType.DOWNLOAD, csar.getArtifactElement().getArtifactURL(),\r
+                        sdcConfig.getConsumerID(), iNotif.getDistributionID(),\r
+                        DistributionStatusEnum.ALREADY_DOWNLOADED, null, System.currentTimeMillis());\r
+                this.sendSdcNotification(NotificationType.DOWNLOAD, csar.getArtifactElement().getArtifactURL(),\r
+                        sdcConfig.getConsumerID(), iNotif.getDistributionID(), DistributionStatusEnum.ALREADY_DEPLOYED,\r
+                        null, System.currentTimeMillis());\r
+            } else {\r
                 this.sendSdcNotification(NotificationType.DOWNLOAD, csar.getArtifactElement().getArtifactURL(),\r
                         sdcConfig.getConsumerID(), iNotif.getDistributionID(), DistributionStatusEnum.DOWNLOAD_OK, null,\r
                         System.currentTimeMillis());\r
@@ -213,13 +220,6 @@ public class SdcSingleController {
                 this.sendSdcNotification(NotificationType.DEPLOY, csar.getArtifactElement().getArtifactURL(),\r
                         sdcConfig.getConsumerID(), iNotif.getDistributionID(), DistributionStatusEnum.DEPLOY_OK, null,\r
                         System.currentTimeMillis());\r
-            } else {\r
-                this.sendSdcNotification(NotificationType.DOWNLOAD, csar.getArtifactElement().getArtifactURL(),\r
-                        sdcConfig.getConsumerID(), iNotif.getDistributionID(),\r
-                        DistributionStatusEnum.ALREADY_DOWNLOADED, null, System.currentTimeMillis());\r
-                this.sendSdcNotification(NotificationType.DOWNLOAD, csar.getArtifactElement().getArtifactURL(),\r
-                        sdcConfig.getConsumerID(), iNotif.getDistributionID(), DistributionStatusEnum.ALREADY_DEPLOYED,\r
-                        null, System.currentTimeMillis());\r
             }\r
         } catch (SdcArtifactInstallerException e) {\r
             logger.error("SdcArtifactInstallerException exception caught during the notification processing", e);\r