jclouds-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From g...@apache.org
Subject jclouds git commit: JCLOUDS-1479: populate container cache on create
Date Thu, 03 Jan 2019 03:56:21 GMT
Repository: jclouds
Updated Branches:
  refs/heads/2.1.x 3d308560c -> f8e722214


JCLOUDS-1479: populate container cache on create


Project: http://git-wip-us.apache.org/repos/asf/jclouds/repo
Commit: http://git-wip-us.apache.org/repos/asf/jclouds/commit/f8e72221
Tree: http://git-wip-us.apache.org/repos/asf/jclouds/tree/f8e72221
Diff: http://git-wip-us.apache.org/repos/asf/jclouds/diff/f8e72221

Branch: refs/heads/2.1.x
Commit: f8e7222143c259fc42bd1111391b045cec837576
Parents: 3d30856
Author: duc <trantienduchn@gmail.com>
Authored: Wed Jan 2 15:45:11 2019 +0700
Committer: Andrew Gaul <gaul@apache.org>
Committed: Wed Jan 2 19:55:46 2019 -0800

----------------------------------------------------------------------
 .../swift/v1/blobstore/RegionScopedSwiftBlobStore.java       | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/jclouds/blob/f8e72221/apis/openstack-swift/src/main/java/org/jclouds/openstack/swift/v1/blobstore/RegionScopedSwiftBlobStore.java
----------------------------------------------------------------------
diff --git a/apis/openstack-swift/src/main/java/org/jclouds/openstack/swift/v1/blobstore/RegionScopedSwiftBlobStore.java
b/apis/openstack-swift/src/main/java/org/jclouds/openstack/swift/v1/blobstore/RegionScopedSwiftBlobStore.java
index 1086afe..c7d338c 100644
--- a/apis/openstack-swift/src/main/java/org/jclouds/openstack/swift/v1/blobstore/RegionScopedSwiftBlobStore.java
+++ b/apis/openstack-swift/src/main/java/org/jclouds/openstack/swift/v1/blobstore/RegionScopedSwiftBlobStore.java
@@ -191,10 +191,12 @@ public class RegionScopedSwiftBlobStore implements BlobStore {
    @Override
    public boolean createContainerInLocation(Location location, String container, CreateContainerOptions
options) {
       checkArgument(location == null || location.equals(region), "location must be null or
%s", region);
-      if (options.isPublicRead()) {
-         return api.getContainerApi(regionId).create(container, ANYBODY_READ);
+      boolean containerCreated = api.getContainerApi(regionId).create(container, options.isPublicRead()
? ANYBODY_READ : BASIC_CONTAINER);
+
+      if (containerCreated) {
+         containerCache.put(container, Optional.fromNullable(api.getContainerApi(regionId).get(container)));
       }
-      return api.getContainerApi(regionId).create(container, BASIC_CONTAINER);
+      return containerCreated;
    }
 
    @Override


Mime
View raw message