Do not eagerly initialize BlobStore

This prevents OpenStack blobstores from matching regions incorrectly, basing on a value of the endpoint variable. OVH has different URLs for each storage endpoint, which does not match the auth endpoint.
pull/296/head
Maciej 2019-03-06 15:26:43 +01:00 zatwierdzone przez Andrew Gaul
rodzic 52fcf4a868
commit c88072b8ef
1 zmienionych plików z 3 dodań i 1 usunięć

Wyświetl plik

@ -310,11 +310,13 @@ public final class Main {
}
BlobStoreContext context = builder.build(BlobStoreContext.class);
BlobStore blobStore = context.getBlobStore();
BlobStore blobStore;
if (context instanceof RegionScopedBlobStoreContext &&
region != null) {
blobStore = ((RegionScopedBlobStoreContext) context)
.getBlobStore(region);
} else {
blobStore = context.getBlobStore();
}
return blobStore;
}