aboutsummaryrefslogtreecommitdiffstats
path: root/adapters/mso-openstack-adapters/src/main/java/org
diff options
context:
space:
mode:
authorMunir Ahmad <munir.ahmad@bell.ca>2019-10-29 11:17:38 -0400
committerMunir Ahmad <munir.ahmad@bell.ca>2019-12-02 12:03:45 -0500
commita849c237fe71f7dee316dd87f5d385cf4e2a38b6 (patch)
treed43eb52b3603ee74f54ed8b0aa3b488add9c56e2 /adapters/mso-openstack-adapters/src/main/java/org
parent824b38dceab0fe94c3d80be31e48580609620641 (diff)
Heatbridge bugfix make use of regionId instead of cloudSiteId
Issue-ID: SO-2497 Signed-off-by: Munir Ahmad <munir.ahmad@bell.ca> Change-Id: Ic3b3fc98c6978807e198a4530974d940a7da5ff8
Diffstat (limited to 'adapters/mso-openstack-adapters/src/main/java/org')
-rw-r--r--adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/vnf/MsoVnfAdapterImpl.java4
-rw-r--r--adapters/mso-openstack-adapters/src/main/java/org/onap/so/heatbridge/HeatBridgeImpl.java13
-rw-r--r--adapters/mso-openstack-adapters/src/main/java/org/onap/so/heatbridge/factory/MsoCloudClientFactory.java4
-rw-r--r--adapters/mso-openstack-adapters/src/main/java/org/onap/so/heatbridge/factory/MsoCloudClientFactoryImpl.java6
4 files changed, 14 insertions, 13 deletions
diff --git a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/vnf/MsoVnfAdapterImpl.java b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/vnf/MsoVnfAdapterImpl.java
index 239c68abb5..fcb2d7c2bb 100644
--- a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/vnf/MsoVnfAdapterImpl.java
+++ b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/vnf/MsoVnfAdapterImpl.java
@@ -421,8 +421,8 @@ public class MsoVnfAdapterImpl implements MsoVnfAdapter {
List<String> oobMgtNetNames = new ArrayList<>();
- HeatBridgeApi heatBridgeClient =
- new HeatBridgeImpl(new AAIResourcesClient(), cloudIdentity, cloudOwner, cloudSiteId, tenantId);
+ HeatBridgeApi heatBridgeClient = new HeatBridgeImpl(new AAIResourcesClient(), cloudIdentity, cloudOwner,
+ cloudSiteId, cloudSite.getRegionId(), tenantId);
heatBridgeClient.authenticate();
diff --git a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/heatbridge/HeatBridgeImpl.java b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/heatbridge/HeatBridgeImpl.java
index 5e3d36d0d5..e2022c9a6e 100644
--- a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/heatbridge/HeatBridgeImpl.java
+++ b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/heatbridge/HeatBridgeImpl.java
@@ -105,21 +105,23 @@ public class HeatBridgeImpl implements HeatBridgeApi {
private AAISingleTransactionClient transaction;
private String cloudOwner;
private String cloudRegionId;
+ private String regionId;
private String tenantId;
private AaiHelper aaiHelper = new AaiHelper();
private CloudIdentity cloudIdentity;
-
public HeatBridgeImpl(AAIResourcesClient resourcesClient, final CloudIdentity cloudIdentity,
- @Nonnull final String cloudOwner, @Nonnull final String cloudRegionId, @Nonnull final String tenantId) {
+ @Nonnull final String cloudOwner, @Nonnull final String cloudRegionId, @Nonnull final String regionId,
+ @Nonnull final String tenantId) {
Objects.requireNonNull(cloudOwner, "Null cloud-owner value!");
Objects.requireNonNull(cloudRegionId, "Null cloud-region identifier!");
Objects.requireNonNull(tenantId, "Null tenant identifier!");
- Objects.requireNonNull(tenantId, "Null AAI actions list!");
+ Objects.requireNonNull(regionId, "Null regionId identifier!");
this.cloudIdentity = cloudIdentity;
this.cloudOwner = cloudOwner;
this.cloudRegionId = cloudRegionId;
+ this.regionId = regionId;
this.tenantId = tenantId;
this.resourcesClient = resourcesClient;
this.transaction = resourcesClient.beginSingleTransaction();
@@ -133,10 +135,9 @@ public class HeatBridgeImpl implements HeatBridgeApi {
@Override
public OpenstackClient authenticate() throws HeatBridgeException {
this.osClient = new MsoCloudClientFactoryImpl(new OpenstackClientFactoryImpl()).getOpenstackClient(
- cloudIdentity.getIdentityUrl(), cloudIdentity.getMsoId(), cloudIdentity.getMsoPass(), cloudRegionId,
+ cloudIdentity.getIdentityUrl(), cloudIdentity.getMsoId(), cloudIdentity.getMsoPass(), regionId,
tenantId);
- logger.debug("Successfully authenticated with keystone for tenant: " + tenantId + " and cloud " + "region: "
- + cloudRegionId);
+ logger.debug("Successfully authenticated with keystone for tenant: " + tenantId + " and region: " + regionId);
return osClient;
}
diff --git a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/heatbridge/factory/MsoCloudClientFactory.java b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/heatbridge/factory/MsoCloudClientFactory.java
index 018a4eac8d..e1f363ca05 100644
--- a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/heatbridge/factory/MsoCloudClientFactory.java
+++ b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/heatbridge/factory/MsoCloudClientFactory.java
@@ -47,13 +47,13 @@ public interface MsoCloudClientFactory {
* @param url openstack url
* @param msoId openstack user for mso
* @param msoPass openstack password for mso user
- * @param cloudRegionId cloud-region identifier
+ * @param regionId region identifier
* @param tenantId tenant identifier
* @return Openstack Client for the keystone version requested
* @throws HeatBridgeException if any errors when reading cloud configuration or getting openstack client
*/
- OpenstackClient getOpenstackClient(String url, String msoId, String msoPass, String cloudRegionId, String tenantId)
+ OpenstackClient getOpenstackClient(String url, String msoId, String msoPass, String regionId, String tenantId)
throws HeatBridgeException;
}
diff --git a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/heatbridge/factory/MsoCloudClientFactoryImpl.java b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/heatbridge/factory/MsoCloudClientFactoryImpl.java
index f0c5a0b434..04245899aa 100644
--- a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/heatbridge/factory/MsoCloudClientFactoryImpl.java
+++ b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/heatbridge/factory/MsoCloudClientFactoryImpl.java
@@ -61,17 +61,17 @@ public class MsoCloudClientFactoryImpl implements MsoCloudClientFactory {
@Override
public OpenstackClient getOpenstackClient(@Nonnull String url, @Nonnull String msoId, @Nonnull String msoPass,
- @Nonnull String cloudRegionId, @Nonnull String tenantId) throws HeatBridgeException {
+ @Nonnull String regionId, @Nonnull String tenantId) throws HeatBridgeException {
Objects.requireNonNull(url, "Null openstack url!");
Objects.requireNonNull(msoId, "Null openstack user id!");
Objects.requireNonNull(msoPass, "Null openstack password!");
- Objects.requireNonNull(cloudRegionId, "Null cloud-region ID!");
+ Objects.requireNonNull(regionId, "Null regionId ID!");
Objects.requireNonNull(tenantId, "Null tenant ID!");
try {
final OpenstackAccess osAccess = new OpenstackAccessBuilder().setBaseUrl(url) // keystone URL
.setUser(msoId) // keystone username
.setPassword(CryptoUtils.decryptCloudConfigPassword(msoPass)) // keystone decrypted password
- .setRegion(cloudRegionId) // openstack region
+ .setRegion(regionId) // openstack region
.setDomainName(HeatBridgeConstants.OS_DEFAULT_DOMAIN_NAME) // hardcode to "default"
.setTenantId(tenantId) // tenantId
.build();