diff options
author | waqas.ikram <waqas.ikram@est.tech> | 2020-09-24 12:47:22 +0100 |
---|---|---|
committer | waqas.ikram <waqas.ikram@est.tech> | 2020-09-25 14:02:10 +0100 |
commit | dc22a628fed70b82d074c509ebd91d51c33e20ec (patch) | |
tree | a7a6424c4daf48c0fb2190e6b2548b02ec721839 /so-etsi-nfvo/so-etsi-nfvo-ns-lcm/so-etsi-nfvo-ns-lcm-bpmn-flows | |
parent | 0f8b52fead32497543616b1d42d46e7319b22059 (diff) |
Fix getJob status bug
Change-Id: I1a3bab4de5c6cfaa5b7874bccff79fbf72f8dc03
Issue-ID: SO-3268
Signed-off-by: waqas.ikram <waqas.ikram@est.tech>
Diffstat (limited to 'so-etsi-nfvo/so-etsi-nfvo-ns-lcm/so-etsi-nfvo-ns-lcm-bpmn-flows')
2 files changed, 5 insertions, 3 deletions
diff --git a/so-etsi-nfvo/so-etsi-nfvo-ns-lcm/so-etsi-nfvo-ns-lcm-bpmn-flows/src/main/java/org/onap/so/etsi/nfvo/ns/lcm/bpmn/flows/extclients/aai/AaiServiceProviderImpl.java b/so-etsi-nfvo/so-etsi-nfvo-ns-lcm/so-etsi-nfvo-ns-lcm-bpmn-flows/src/main/java/org/onap/so/etsi/nfvo/ns/lcm/bpmn/flows/extclients/aai/AaiServiceProviderImpl.java index 78cdc797bc..0da53a09c2 100644 --- a/so-etsi-nfvo/so-etsi-nfvo-ns-lcm/so-etsi-nfvo-ns-lcm-bpmn-flows/src/main/java/org/onap/so/etsi/nfvo/ns/lcm/bpmn/flows/extclients/aai/AaiServiceProviderImpl.java +++ b/so-etsi-nfvo/so-etsi-nfvo-ns-lcm/so-etsi-nfvo-ns-lcm-bpmn-flows/src/main/java/org/onap/so/etsi/nfvo/ns/lcm/bpmn/flows/extclients/aai/AaiServiceProviderImpl.java @@ -22,6 +22,7 @@ package org.onap.so.etsi.nfvo.ns.lcm.bpmn.flows.extclients.aai; import java.util.Optional; import org.onap.aai.domain.yang.GenericVnf; import org.onap.aai.domain.yang.ServiceInstance; +import org.onap.aaiclient.client.aai.AAIObjectType; import org.onap.aaiclient.client.aai.entities.uri.AAIResourceUri; import org.onap.aaiclient.client.aai.entities.uri.AAIUriFactory; import org.onap.aaiclient.client.generated.fluentbuilders.AAIFluentTypeBuilder; @@ -88,7 +89,8 @@ public class AaiServiceProviderImpl implements AaiServiceProvider { @Override public void deleteGenericVnf(final String vnfId) { logger.info("Deleting GenericVnf with id: {} from AAI.", vnfId); - final AAIResourceUri aaiResourceUri = AAIUriFactory.createResourceUri(AAIObjectType.GENERIC_VNF, vnfId); + final AAIResourceUri aaiResourceUri = + AAIUriFactory.createResourceUri(AAIFluentTypeBuilder.network().genericVnf(vnfId)); aaiClientProvider.getAaiClient().delete(aaiResourceUri); } } diff --git a/so-etsi-nfvo/so-etsi-nfvo-ns-lcm/so-etsi-nfvo-ns-lcm-bpmn-flows/src/main/java/org/onap/so/etsi/nfvo/ns/lcm/bpmn/flows/service/JobExecutorService.java b/so-etsi-nfvo/so-etsi-nfvo-ns-lcm/so-etsi-nfvo-ns-lcm-bpmn-flows/src/main/java/org/onap/so/etsi/nfvo/ns/lcm/bpmn/flows/service/JobExecutorService.java index f240fa33ef..31e3011c0e 100644 --- a/so-etsi-nfvo/so-etsi-nfvo-ns-lcm/so-etsi-nfvo-ns-lcm-bpmn-flows/src/main/java/org/onap/so/etsi/nfvo/ns/lcm/bpmn/flows/service/JobExecutorService.java +++ b/so-etsi-nfvo/so-etsi-nfvo-ns-lcm/so-etsi-nfvo-ns-lcm-bpmn-flows/src/main/java/org/onap/so/etsi/nfvo/ns/lcm/bpmn/flows/service/JobExecutorService.java @@ -289,7 +289,7 @@ public class JobExecutorService { JobStatusEnum currentJobStatus = null; while (timeOutTime > System.currentTimeMillis()) { - final Optional<NfvoJob> optional = databaseServiceProvider.getJob(jobId); + final Optional<NfvoJob> optional = databaseServiceProvider.getRefreshedJob(jobId); if (optional.isEmpty()) { logger.error("Unable to find Job using jobId: {}", jobId); @@ -299,7 +299,7 @@ public class JobExecutorService { final NfvoJob nfvoJob = optional.get(); currentJobStatus = nfvoJob.getStatus(); logger.debug("Received job status response: \n {}", nfvoJob); - if (jobFinishedStates.contains(nfvoJob.getStatus())) { + if (jobFinishedStates.contains(currentJobStatus)) { logger.info("Job finished \n {}", currentJobStatus); return ImmutablePair.of(nfvoJob.getProcessInstanceId(), currentJobStatus); } |