Rollback on failure flag should always be true while vfm replace call
Issue-ID: VID-851
Signed-off-by: Soumya Pattanayak <sp931a@att.com>
Change-Id: I2cb3fd0a6b6d25133e426c76ac5851df9cc55216
diff --git a/vid-app-common/src/main/java/org/onap/vid/job/command/VfmoduleCommand.kt b/vid-app-common/src/main/java/org/onap/vid/job/command/VfmoduleCommand.kt
index a92f610..734faf6 100644
--- a/vid-app-common/src/main/java/org/onap/vid/job/command/VfmoduleCommand.kt
+++ b/vid-app-common/src/main/java/org/onap/vid/job/command/VfmoduleCommand.kt
@@ -82,7 +82,7 @@
}
private fun planReplaceMyselfRestCall(commandParentData: CommandParentData): MsoRestCallPlan {
-
+ val shouldRollBackOnFailure = true
val newestModel = fetchNewestServiceModel()
val serviceInstanceId = serviceInstanceIdFromRequest()
@@ -90,7 +90,7 @@
val (serviceModelInfo, vnfModelInfo, vfmModelInfo) = newestSelector(newestModel, commandParentData);
- val originalRequestWithNewestVfmModelInfo = getRequest().cloneWith(vfmModelInfo)
+ val originalRequestWithNewestVfmModelInfo = getRequest().cloneWith(vfmModelInfo, shouldRollBackOnFailure)
val requestDetailsWrapper = msoRequestBuilder.generateVfModuleReplaceRequest(
originalRequestWithNewestVfmModelInfo, serviceModelInfo, serviceInstanceId,
diff --git a/vid-app-common/src/main/java/org/onap/vid/model/serviceInstantiation/VfModule.java b/vid-app-common/src/main/java/org/onap/vid/model/serviceInstantiation/VfModule.java
index dc6a2c6..bfe4d69 100644
--- a/vid-app-common/src/main/java/org/onap/vid/model/serviceInstantiation/VfModule.java
+++ b/vid-app-common/src/main/java/org/onap/vid/model/serviceInstantiation/VfModule.java
@@ -118,7 +118,7 @@
return retainVolumeGroups;
}
- public VfModule cloneWith(ModelInfo modelInfo) {
+ public VfModule cloneWith(ModelInfo modelInfo, boolean shouldRollbackOnFailure) {
return new VfModule(
modelInfo,
this.getInstanceName(),
@@ -129,7 +129,7 @@
this.getTenantId(),
this.getInstanceParams(),
this.getSupplementaryParams(),
- this.isRollbackOnFailure(),
+ shouldRollbackOnFailure,
this.isUsePreload(),
this.getInstanceId(),
this.getTrackById(),
@@ -138,8 +138,8 @@
this.isRetainAssignments(),
this.isRetainVolumeGroups(),
this.getPosition(),
- this.getPauseInstantiation(),
- this.getOriginalName()
+ this.getPauseInstantiation(),
+ this.getOriginalName()
);
}
diff --git a/vid-app-common/src/test/resources/payload_jsons/vfmodule/upgrade_vfmodule_e2e__payload_to_mso.json b/vid-app-common/src/test/resources/payload_jsons/vfmodule/upgrade_vfmodule_e2e__payload_to_mso.json
index d72dc7a..c10f450 100644
--- a/vid-app-common/src/test/resources/payload_jsons/vfmodule/upgrade_vfmodule_e2e__payload_to_mso.json
+++ b/vid-app-common/src/test/resources/payload_jsons/vfmodule/upgrade_vfmodule_e2e__payload_to_mso.json
@@ -4,7 +4,7 @@
"source": "VID",
"requestorId": "az2016",
"instanceName": "PST-VfMod-Replace-5-Vfmod",
- "suppressRollback": true
+ "suppressRollback": false
},
"relatedInstanceList": [{
"relatedInstance": {