Skip to content

Commit 589277f

Browse files
committed
Don't set signingRegion as auto for creating the s3 client in ceph object store provider.
1 parent 80b5d5c commit 589277f

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

plugins/storage/object/ceph/src/main/java/org/apache/cloudstack/storage/datastore/driver/CephObjectStoreDriverImpl.java

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -95,8 +95,8 @@ public Bucket createBucket(Bucket bucket, boolean objectLock) {
9595
AmazonS3 s3client = getS3Client(storeId, accountId);
9696

9797
try {
98-
if (s3client.getBucketAcl(bucketName) != null) {
99-
throw new CloudRuntimeException("Bucket already exists with name " + bucketName);
98+
if (s3client.doesBucketExistV2(bucketName)) {
99+
throw new CloudRuntimeException("Bucket already exists with the name: " + bucketName);
100100
}
101101
} catch (AmazonS3Exception e) {
102102
if (e.getStatusCode() != 404) {
@@ -221,9 +221,11 @@ public boolean createUser(long accountId, long storeId) {
221221
if (user.isPresent()) {
222222
logger.info("User already exists in Ceph RGW: " + username);
223223
return true;
224+
} else {
225+
logger.debug("User does not exist. Creating user in Ceph RGW: " + username);
224226
}
225227
} catch (Exception e) {
226-
logger.debug("User does not exist. Creating user in Ceph RGW: " + username);
228+
logger.debug("Get user info failed for user {} with exception {}. Proceeding with user creation.", username, e.getMessage());
227229
}
228230

229231
try {
@@ -348,7 +350,7 @@ protected AmazonS3 getS3Client(String url, String accessKey, String secretKey) {
348350
new AWSStaticCredentialsProvider(
349351
new BasicAWSCredentials(accessKey, secretKey)))
350352
.withEndpointConfiguration(
351-
new AwsClientBuilder.EndpointConfiguration(url, "auto"))
353+
new AwsClientBuilder.EndpointConfiguration(url, null))
352354
.build();
353355

354356
if (client == null) {

0 commit comments

Comments
 (0)