From a7da6f2fe455634f65cd98f0509972b0c1bd585b Mon Sep 17 00:00:00 2001 From: Munir Ahmad Date: Thu, 4 Apr 2019 09:42:37 -0400 Subject: bugfix for heatbridge keystone v3 not returning any resources Issue-ID: SO-1484 Change-Id: Ic1341e94086470c59aab324a3ea16e4e7e086d38 Signed-off-by: Munir Ahmad --- .../so/heatbridge/openstack/factory/OpenstackClientFactoryImpl.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'adapters/mso-openstack-adapters') 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; -- cgit 1.2.3-korg