You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@jclouds.apache.org by na...@apache.org on 2018/01/12 07:43:15 UTC
jclouds git commit: Add warning if there is no service catalog in the
authenticated token
Repository: jclouds
Updated Branches:
refs/heads/keystonev3 7ae03aebf -> e53949a33
Add warning if there is no service catalog in the authenticated token
Project: http://git-wip-us.apache.org/repos/asf/jclouds/repo
Commit: http://git-wip-us.apache.org/repos/asf/jclouds/commit/e53949a3
Tree: http://git-wip-us.apache.org/repos/asf/jclouds/tree/e53949a3
Diff: http://git-wip-us.apache.org/repos/asf/jclouds/diff/e53949a3
Branch: refs/heads/keystonev3
Commit: e53949a333731a620097f7d98ddad2ab6b961e3a
Parents: 7ae03ae
Author: Ignasi Barrera <na...@apache.org>
Authored: Fri Jan 12 08:43:05 2018 +0100
Committer: Ignasi Barrera <na...@apache.org>
Committed: Fri Jan 12 08:43:05 2018 +0100
----------------------------------------------------------------------
.../LocationIdToURIFromServiceEndpointsForTypeAndVersion.java | 4 ++++
1 file changed, 4 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/jclouds/blob/e53949a3/apis/openstack-keystone/src/main/java/org/jclouds/openstack/keystone/catalog/suppliers/LocationIdToURIFromServiceEndpointsForTypeAndVersion.java
----------------------------------------------------------------------
diff --git a/apis/openstack-keystone/src/main/java/org/jclouds/openstack/keystone/catalog/suppliers/LocationIdToURIFromServiceEndpointsForTypeAndVersion.java b/apis/openstack-keystone/src/main/java/org/jclouds/openstack/keystone/catalog/suppliers/LocationIdToURIFromServiceEndpointsForTypeAndVersion.java
index a96503d..aabfec2 100644
--- a/apis/openstack-keystone/src/main/java/org/jclouds/openstack/keystone/catalog/suppliers/LocationIdToURIFromServiceEndpointsForTypeAndVersion.java
+++ b/apis/openstack-keystone/src/main/java/org/jclouds/openstack/keystone/catalog/suppliers/LocationIdToURIFromServiceEndpointsForTypeAndVersion.java
@@ -74,6 +74,10 @@ public class LocationIdToURIFromServiceEndpointsForTypeAndVersion implements Sup
@Override
public Map<String, Supplier<URI>> get() {
List<ServiceEndpoint> endpoints = serviceEndpoints.get();
+ if (endpoints.isEmpty()) {
+ throw new NoSuchElementException(
+ "No endpoints were found in the service catalog. Make sure your authentication token has the right scopes and permissions");
+ }
// Filter endpoints by service type
Iterable<ServiceEndpoint> endpointsForType = filter(endpoints, apiTypeEquals);