mirror of
https://github.com/nextcloud/server.git
synced 2026-06-08 16:26:59 -04:00
make tests workable with Amazon S3
This commit is contained in:
parent
882d5ad728
commit
83a1fce1a3
1 changed files with 16 additions and 9 deletions
|
|
@ -40,21 +40,28 @@ class AmazonS3 extends Storage {
|
|||
if ($this->instance) {
|
||||
$connection = $this->instance->getConnection();
|
||||
|
||||
// NOTE(berendt): clearBucket() is not working with Ceph
|
||||
$iterator = $connection->getIterator('ListObjects', array(
|
||||
'Bucket' => $this->config['amazons3']['bucket']
|
||||
));
|
||||
|
||||
foreach ($iterator as $object) {
|
||||
$connection->deleteObject(array(
|
||||
'Bucket' => $this->config['amazons3']['bucket'],
|
||||
'Key' => $object['Key']
|
||||
try {
|
||||
// NOTE(berendt): clearBucket() is not working with Ceph
|
||||
$iterator = $connection->getIterator('ListObjects', array(
|
||||
'Bucket' => $this->config['amazons3']['bucket']
|
||||
));
|
||||
|
||||
foreach ($iterator as $object) {
|
||||
$connection->deleteObject(array(
|
||||
'Bucket' => $this->config['amazons3']['bucket'],
|
||||
'Key' => $object['Key']
|
||||
));
|
||||
}
|
||||
} catch (S3Exception $e) {
|
||||
}
|
||||
|
||||
$connection->deleteBucket(array(
|
||||
'Bucket' => $this->config['amazons3']['bucket']
|
||||
));
|
||||
|
||||
$connection->waitUntilBucketNotExists(array(
|
||||
'Bucket' => $this->config['amazons3']['bucket']
|
||||
));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue