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:55:34 GMT
Repository: jclouds
Updated Branches:
  refs/heads/master 7e2723c9a -> 70f0635ac


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/70f0635a
Tree: http://git-wip-us.apache.org/repos/asf/jclouds/tree/70f0635a
Diff: http://git-wip-us.apache.org/repos/asf/jclouds/diff/70f0635a

Branch: refs/heads/master
Commit: 70f0635ac27d83673d2e49185221be059411c3ba
Parents: 7e2723c
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:29:31 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/70f0635a/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