summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorguanwenyao <guanwenyao@chinamobile.com>2018-05-29 18:04:08 +0800
committerguanwenyao <guanwenyao@chinamobile.com>2018-05-29 18:18:45 +0800
commit60ea8dec7591def51cb986992ceee542e1f078e0 (patch)
tree80e1d28b2e1b2fbcf896c63b1af5a7f4a663430a
parentc28f12b8fee6918fd622467be7cc8a0b5ab083ce (diff)
fix query ns scale endless loop
Issue-ID: SO-634 Change-Id: I79ac70be79345c966642dc5b99c25b4a39dc575d Signed-off-by: guanwenyao <guanwenyao@chinamobile.com>
-rw-r--r--bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DoScaleVFCNetworkServiceInstance.groovy9
1 files changed, 4 insertions, 5 deletions
diff --git a/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DoScaleVFCNetworkServiceInstance.groovy b/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DoScaleVFCNetworkServiceInstance.groovy
index 0e4aea00ae..321741b721 100644
--- a/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DoScaleVFCNetworkServiceInstance.groovy
+++ b/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DoScaleVFCNetworkServiceInstance.groovy
@@ -95,12 +95,11 @@ public class DoScaleVFCNetworkServiceInstance extends AbstractServiceTaskProcess
* scale NS task
*/
public void scaleNetworkService(DelegateExecution execution) {
+ def isDebugEnabled = execution.getVariable("isDebugLogEnabled")
String saleNsRequest = execution.getVariable("reqBody")
String[] nsReqStr = saleNsRequest.split("\\|")
- def jobIdArray = ['jobId001', 'jobId002'] as String[]
-
for (int i = 0; i < nsReqStr.length; i++) {
JSONObject reqBodyJsonObj = new JSONObject(nsReqStr[i])
String nsInstanceId = reqBodyJsonObj.getJSONObject("nsScaleParameters").getString("nsInstanceId")
@@ -114,11 +113,11 @@ public class DoScaleVFCNetworkServiceInstance extends AbstractServiceTaskProcess
String returnCode = apiResponse.getStatusCode()
String aaiResponseAsString = apiResponse.getResponseBodyAsString()
String jobId = "";
- if (returnCode == "200") {
+ if (returnCode == "200" || returnCode == "202") {
jobId = jsonUtil.getJsonValue(aaiResponseAsString, "jobId")
}
-
- execution.setVariable("jobId", jobIdArray[i])
+ utils.log("INFO", "scaleNetworkService get a ns scale job Id:" + jobId, isDebugEnabled)
+ execution.setVariable("jobId", jobId)
String isScaleFinished = ""