aboutsummaryrefslogtreecommitdiffstats
path: root/adapters/mso-openstack-adapters
diff options
context:
space:
mode:
authorMunir Ahmad <munir.ahmad@bell.ca>2019-04-04 09:42:37 -0400
committerMarcus Williams <marcus.williams@intel.com>2019-04-04 20:25:18 +0000
commita7da6f2fe455634f65cd98f0509972b0c1bd585b (patch)
tree047034a2696b3b98ee4646b0b61234710c0c8a78 /adapters/mso-openstack-adapters
parentf81920304c7b62637d32473e672a1e51275ce54b (diff)
bugfix for heatbridge keystone v3 not returning any resources
Issue-ID: SO-1484 Change-Id: Ic1341e94086470c59aab324a3ea16e4e7e086d38 Signed-off-by: Munir Ahmad <munir.ahmad@bell.ca>
Diffstat (limited to 'adapters/mso-openstack-adapters')
-rw-r--r--adapters/mso-openstack-adapters/src/main/java/org/onap/so/heatbridge/openstack/factory/OpenstackClientFactoryImpl.java5
1 files changed, 4 insertions, 1 deletions
diff --git a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/heatbridge/openstack/factory/OpenstackClientFactoryImpl.java b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/heatbridge/openstack/factory/OpenstackClientFactoryImpl.java
index 72b3795053..141dd4fe50 100644
--- a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/heatbridge/openstack/factory/OpenstackClientFactoryImpl.java
+++ b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/heatbridge/openstack/factory/OpenstackClientFactoryImpl.java
@@ -25,6 +25,7 @@ import org.openstack4j.api.OSClient.OSClientV2;
import org.openstack4j.api.OSClient.OSClientV3;
import org.openstack4j.api.exceptions.AuthenticationException;
import org.openstack4j.openstack.OSFactory;
+import org.openstack4j.model.common.Identifier;
public class OpenstackClientFactoryImpl implements OpenstackClientFactory {
@@ -35,12 +36,14 @@ public class OpenstackClientFactoryImpl implements OpenstackClientFactory {
Preconditions.checkNotNull(osAccess.getPassword(), "Keystone-v3 Auth: password not set.");
Preconditions.checkNotNull(osAccess.getDomainNameIdentifier(), "Keystone-v3 Auth: domain not set.");
Preconditions.checkNotNull(osAccess.getRegion(), "Keystone-v3 Auth: region not set.");
+ Preconditions.checkNotNull(osAccess.getTenantId(), "Keystone-v3 Auth: tenant-id not set.");
OSClientV3 client;
try {
client = OSFactory.builderV3()
.endpoint(osAccess.getUrl())
.credentials(osAccess.getUser(), osAccess.getPassword(), osAccess.getDomainNameIdentifier())
+ .scopeToProject(Identifier.byId(osAccess.getTenantId()))
.authenticate()
.useRegion(osAccess.getRegion());
return new OpenstackV3ClientImpl(client);
@@ -54,7 +57,7 @@ public class OpenstackClientFactoryImpl implements OpenstackClientFactory {
Preconditions.checkNotNull(osAccess.getUrl(), "Keystone-v2 Auth: endpoint not set.");
Preconditions.checkNotNull(osAccess.getUser(), "Keystone-v2 Auth: username not set.");
Preconditions.checkNotNull(osAccess.getPassword(), "Keystone-v2 Auth: password not set.");
- Preconditions.checkNotNull(osAccess.getTenantId(), "Keystone-v2 Auth: domain not set.");
+ Preconditions.checkNotNull(osAccess.getTenantId(), "Keystone-v2 Auth: tenant-id not set.");
Preconditions.checkNotNull(osAccess.getRegion(), "Keystone-v2 Auth: region not set.");
OSClientV2 client;