aboutsummaryrefslogtreecommitdiffstats
path: root/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp
diff options
context:
space:
mode:
authorArthur Martella <am153x@att.com>2018-05-17 17:45:53 -0400
committerArthur Martella <am153x@att.com>2018-05-18 14:28:05 -0400
commit465c8992f528ab634f5321e79c6cc0a4e8ec4fd3 (patch)
tree5d926761468828082a36b8a44f05cb36ad5b0076 /bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp
parentc82216b0be5e2fab57031056d386a192b6abbce2 (diff)
Fallback for cloud region calls to AAI
In the integration environment, there's no cloud region named att-aic. Therefore, try without att-aic first (CLOUD-REGION) and if that fails, try att-aic (DEFAULT-CLOUD-REGION) Change-Id: Ie4a4a3924eb6fe1120519e124a7967a62c96428f Issue-ID: INT-475 Signed-off-by: Arthur Martella <am153x@att.com>
Diffstat (limited to 'bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp')
-rw-r--r--bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/VnfCmBase.groovy14
1 files changed, 11 insertions, 3 deletions
diff --git a/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/VnfCmBase.groovy b/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/VnfCmBase.groovy
index 39820dc2e1..d8405aa243 100644
--- a/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/VnfCmBase.groovy
+++ b/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/VnfCmBase.groovy
@@ -277,11 +277,19 @@ public abstract class VnfCmBase extends AbstractServiceTaskProcessor {
}
}
- if (cloudRegionId != null) {
- AAIUri cloudRegionUri = AAIUriFactory.createResourceUri(AAIObjectType.DEFAULT_CLOUD_REGION, cloudRegionId)
+ if (cloudRegionId != null) {
+ String cloudOwnerId = "att-aic";
+ try {
+ cloudOwnerId = execution.getVariable("URN_mso_default_cloud_owner_id");
+ if (cloudOwnerId == null) cloudOwnerId = "att-aic";
+ } catch (RuntimeException e) {
+ cloudOwnerId = "att-aic";
+ }
+
+ AAIUri cloudRegionUri = AAIUriFactory.createResourceUri(AAIObjectType.CLOUD_REGION, cloudOwnerId, cloudRegionId)
// Check if this client region exists
if (!client.exists(cloudRegionUri)) {
- logDebug("Cloud Region with cloudRegionId " + cloudRegionId + " does not exist in A&AI", isDebugLogEnabled)
+ logDebug("Cloud Region with cloudOwner ID " + cloudOwnerId + " and cloudRegionId " + cloudRegionId + " does not exist in A&AI", isDebugLogEnabled)
exceptionUtil.buildAndThrowWorkflowException(execution, 404, "Cloud Region with cloudRegionId " + cloudRegionId + " does not exist in A&AI")
}