diff options
author | Benjamin, Max (mb388a) <mb388a@us.att.com> | 2018-10-12 14:03:02 -0400 |
---|---|---|
committer | Benjamin, Max (mb388a) <mb388a@us.att.com> | 2018-10-16 17:28:55 -0400 |
commit | 2ff435b28384a066017b690cf8a876a2cdd52d29 (patch) | |
tree | 0b87091067f3a23d8a75738d933bcb61cb8f8d6a /asdc-controller/src | |
parent | d6c21ac6f38474841d3b9ced0524fe7671ae8682 (diff) |
Bug fixes for casablanca
Updated builder to use String.format
Added exception specifically for issues interacting with
requestdbadapter
Updated exception message and added junit test case
Added case to handle when homing is not called during assign vnf.
include network ID for completion handler
Added exception handling for saving to requestdb
added null check to mdc and interceptors to sdnc cxf
confirm subnet map is not null in adapter response
shallow copy subnet before AAI udpate
update AAIObjectType to use uriTemplate
extract subnet data from adapter response
update correct AAIObjectType for subnet query
update subnet(s) in AAI on network create completion
updated how request db is set to failure in workflowA
updated in and out mapping to be generalBuildingBlock
change source out mapping to generalBuildingBlock
Use explicit conversion to JSON to read cloudConfiguration settings.
Use explicit conversion to JSON to read cloudConfiguration settings.
Correct the name of DeleteVfModuleBB subprocess.
Write the returned value from Homing to gBBInput
updated unit test coverage for update network
sync subnet status with network update
Added WorkflowException to out mapping which will trigger an exception
to be thrown when populated.
Correct the payload for HealthCheck APP-C Action to remove escaping and
change parameter name.
Added WorkflowException to out mapping which will trigger an exception
to be thrown when populated.
Commit a change that was not staged in previous commit
updated arguments to getConstructor method
forgot to extract throwable from Optional object
added throwable constructor to createException
fixed broken unit test and added a new test and method
set the network technology in the network request
remove namespace from added networkId payload element
- Updated SDWan test case to check the database to make sure the
VNFCustomization object exist.
- Updated code to only loop in iNotif.getResources() for VF resources,
all others are unnecessary and were causing issues with the Service
object.
- Removed modifiedHeatTemplate variable since this isn't needed in the
ONAP code base.
Make sure vnfResponseCode variable is set to 200 when VNF is correctly
retrieved from A&AI.
VRR VRRCreateVfModule - send availability_zone to SDNC Infra Assign
request
Safeguard the retrieval of Boolean setting for isRollbackEnabled.
Set isRollbackEnabled to opposite of suppressRollback early on in the
execution.
Reverse suppressRollback value to pass as backout parameter to VNF
Adapter
Add the exceptions to the calls to aai client queries
Correct retrieval of the object from Optional for A&AI queries.
Change-Id: I7d22e621b0316c14ce61bd51a9d5753473622697
Issue-ID: SO-1134
Signed-off-by: Benjamin, Max (mb388a) <mb388a@us.att.com>
Diffstat (limited to 'asdc-controller/src')
-rw-r--r-- | asdc-controller/src/main/java/org/onap/so/asdc/client/ASDCController.java | 62 | ||||
-rw-r--r-- | asdc-controller/src/main/java/org/onap/so/asdc/util/ASDCNotificationLogging.java | 11 |
2 files changed, 36 insertions, 37 deletions
diff --git a/asdc-controller/src/main/java/org/onap/so/asdc/client/ASDCController.java b/asdc-controller/src/main/java/org/onap/so/asdc/client/ASDCController.java index 91505918a8..503de0429e 100644 --- a/asdc-controller/src/main/java/org/onap/so/asdc/client/ASDCController.java +++ b/asdc-controller/src/main/java/org/onap/so/asdc/client/ASDCController.java @@ -680,36 +680,13 @@ public class ASDCController { VfResourceStructure resourceStructure = null; ToscaResourceStructure toscaResourceStructure = new ToscaResourceStructure(); boolean deploySuccessful = true; + boolean hasVFResource = false; String errorMessage = null; try { this.processCsarServiceArtifacts(iNotif, toscaResourceStructure); - - if (toscaResourceStructure.getServiceVersion() == null) { - LOGGER.debug("Deploy the workflow"); - IArtifactInfo iArtifact = toscaResourceStructure.getToscaArtifact(); - String csarFilePath = System.getProperty("mso.config.path") + "/ASDC" + "/" + iArtifact.getArtifactName(); - bpmnInstaller.installBpmn(csarFilePath); - } - - // Install a service with no resources, only the service itself - if (iNotif.getResources() == null || iNotif.getResources().size() < 1) { - - LOGGER.debug("No resources found for Service: " + iNotif.getServiceUUID()); - - try{ - resourceStructure = new VfResourceStructure(iNotif,new ResourceInstance()); - - this.deployResourceStructure(resourceStructure, toscaResourceStructure); - - } catch(ArtifactInstallerException e){ - deploySuccessful = false; - errorMessage = e.getMessage(); - LOGGER.debug ("Exception in processResourceNotification(): " + e); - } - } else { // Services with resources - + for (IResourceInstance resource : iNotif.getResources()){ resourceStructure = new VfResourceStructure(iNotif,resource); @@ -720,11 +697,14 @@ public class ASDCController { LOGGER.debug("Processing Resource Type: " + resourceType + " and Model UUID: " + resourceStructure.getResourceInstance().getResourceUUID()); if("VF".equals(resourceType) && !"Allotted Resource".equalsIgnoreCase(category)){ + + hasVFResource = true; for (IArtifactInfo artifact : resource.getArtifacts()) { IDistributionClientDownloadResult resultArtifact = this.downloadTheArtifact(artifact, iNotif.getDistributionID()); if (resultArtifact != null) { + if (ASDCConfiguration.VF_MODULES_METADATA.equals(artifact.getArtifactType())) { LOGGER.debug("VF_MODULE_ARTIFACT: "+new String(resultArtifact.getArtifactPayload(),"UTF-8")); LOGGER.debug(ASDCNotificationLogging.dumpVfModuleMetaDataList(resourceStructure.decodeVfModuleArtifact(resultArtifact.getArtifactPayload()))); @@ -732,21 +712,37 @@ public class ASDCController { resourceStructure.addArtifactToStructure(distributionClient,artifact, resultArtifact); } } + + //Deploy VF resource and artifacts + LOGGER.debug("Preparing to deploy Service: " + iNotif.getServiceUUID()); + try{ + + this.deployResourceStructure(resourceStructure, toscaResourceStructure); + + } catch(ArtifactInstallerException e){ + deploySuccessful = false; + errorMessage = e.getMessage(); + LOGGER.error(e); + } } + + } + + // There are cases where the Service has no VF resources, those are handled here + if (!hasVFResource) { + + LOGGER.debug("No resources found for Service: " + iNotif.getServiceUUID()); - //Deploy All resources and artifacts - LOGGER.debug("Preparing to deploy Service: " + iNotif.getServiceUUID()); - try{ - + try{ + resourceStructure = new VfResourceStructure(iNotif,new ResourceInstance()); + this.deployResourceStructure(resourceStructure, toscaResourceStructure); } catch(ArtifactInstallerException e){ deploySuccessful = false; errorMessage = e.getMessage(); - LOGGER.debug ("Exception in processResourceNotification(): " + e); - } - - } + LOGGER.error(e); + } } this.sendCsarDeployNotification(iNotif, resourceStructure, toscaResourceStructure, deploySuccessful, errorMessage); diff --git a/asdc-controller/src/main/java/org/onap/so/asdc/util/ASDCNotificationLogging.java b/asdc-controller/src/main/java/org/onap/so/asdc/util/ASDCNotificationLogging.java index ca4c5e83a9..f7c761f017 100644 --- a/asdc-controller/src/main/java/org/onap/so/asdc/util/ASDCNotificationLogging.java +++ b/asdc-controller/src/main/java/org/onap/so/asdc/util/ASDCNotificationLogging.java @@ -97,6 +97,7 @@ public class ASDCNotificationLogging { buffer.append(System.lineSeparator()); buffer.append("Environment Context:"); buffer.append(csarHelper.getServiceMetadata().getValue("environmentContext")); + buffer.append(System.lineSeparator()); List<NodeTemplate> serviceProxyResourceList = toscaResourceStructure.getSdcCsarHelper().getServiceNodeTemplateBySdcType(SdcTypes.SERVICE_PROXY); @@ -223,6 +224,9 @@ public class ASDCNotificationLogging { buffer.append("Type:"); buffer.append(testNull(vfNodeTemplate.getMetaData().getValue(SdcPropertyNames.PROPERTY_NAME_TYPE))); buffer.append(System.lineSeparator()); + buffer.append("Category:"); + buffer.append(testNull(vfNodeTemplate.getMetaData().getValue(SdcPropertyNames.PROPERTY_NAME_CATEGORY))); + buffer.append(System.lineSeparator()); buffer.append("InvariantUuid:"); buffer.append(testNull(vfNodeTemplate.getMetaData().getValue(SdcPropertyNames.PROPERTY_NAME_INVARIANTUUID))); buffer.append(System.lineSeparator()); @@ -412,14 +416,13 @@ public class ASDCNotificationLogging { } - buffer.append(System.lineSeparator()); - buffer.append("Network Collection Resource Properties:"); - buffer.append(System.lineSeparator()); - + List<NodeTemplate> networkCollectionList = toscaResourceStructure.getSdcCsarHelper().getServiceNodeTemplateBySdcType(SdcTypes.CR); if (networkCollectionList != null) { for (NodeTemplate crNode : networkCollectionList) { + buffer.append(System.lineSeparator()); + buffer.append("Network Collection Properties:"); buffer.append(System.lineSeparator()); buffer.append("Model Name:"); buffer.append(crNode.getMetaData().getValue(SdcPropertyNames.PROPERTY_NAME_NAME)); |