Fix SDC deployment
[clamp.git] / 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