Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -95,8 +95,8 @@
AmazonS3 s3client = getS3Client(storeId, accountId);

try {
if (s3client.getBucketAcl(bucketName) != null) {
throw new CloudRuntimeException("Bucket already exists with name " + bucketName);
if (s3client.doesBucketExistV2(bucketName)) {
throw new CloudRuntimeException("Bucket already exists with the name: " + bucketName);

Check warning on line 99 in plugins/storage/object/ceph/src/main/java/org/apache/cloudstack/storage/datastore/driver/CephObjectStoreDriverImpl.java

View check run for this annotation

Codecov / codecov/patch

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

Added line #L99 was not covered by tests
}
} catch (AmazonS3Exception e) {
if (e.getStatusCode() != 404) {
Expand Down Expand Up @@ -221,9 +221,11 @@
if (user.isPresent()) {
logger.info("User already exists in Ceph RGW: " + username);
return true;
} else {
logger.debug("User does not exist. Creating user in Ceph RGW: " + username);

Check warning on line 225 in plugins/storage/object/ceph/src/main/java/org/apache/cloudstack/storage/datastore/driver/CephObjectStoreDriverImpl.java

View check run for this annotation

Codecov / codecov/patch

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

Added line #L225 was not covered by tests
}
} catch (Exception e) {
logger.debug("User does not exist. Creating user in Ceph RGW: " + username);
logger.debug("Get user info failed for user {} with exception {}. Proceeding with user creation.", username, e.getMessage());

Check warning on line 228 in plugins/storage/object/ceph/src/main/java/org/apache/cloudstack/storage/datastore/driver/CephObjectStoreDriverImpl.java

View check run for this annotation

Codecov / codecov/patch

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

Added line #L228 was not covered by tests
}

try {
Expand Down Expand Up @@ -348,7 +350,7 @@
new AWSStaticCredentialsProvider(
new BasicAWSCredentials(accessKey, secretKey)))
.withEndpointConfiguration(
new AwsClientBuilder.EndpointConfiguration(url, "auto"))
new AwsClientBuilder.EndpointConfiguration(url, null))
.build();

if (client == null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ public void testCreateBucket() throws Exception {
when(bucketDao.findById(anyLong())).thenReturn(new BucketVO(bucket.getName()));
Bucket bucketRet = cephObjectStoreDriverImpl.createBucket(bucket, false);
assertEquals(bucketRet.getName(), bucket.getName());
verify(rgwClient, times(1)).getBucketAcl(anyString());
verify(rgwClient, times(1)).doesBucketExistV2(anyString());
verify(rgwClient, times(1)).createBucket(anyString());
}

Expand Down
Loading