[Rt-commit] rt branch, 4.4/external-storage, updated. rt-4.2.11-81-g4fbaa8a
Shawn Moore
shawn at bestpractical.com
Wed May 27 18:53:18 EDT 2015
The branch, 4.4/external-storage has been updated
via 4fbaa8abd1ab94994c1fda1407e0a9c0b7634061 (commit)
from f57e2980534d82d560837edcfde356e95f152b61 (commit)
Summary of changes:
lib/RT/ExternalStorage/AmazonS3.pm | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
- Log -----------------------------------------------------------------
commit 4fbaa8abd1ab94994c1fda1407e0a9c0b7634061
Author: Shawn M Moore <shawn at bestpractical.com>
Date: Wed May 27 22:52:19 2015 +0000
Handle a single bucket in a region
->{buckets} only seems to be populated when there are multiple
sibling buckets in a region.
Without this fallback, we try to create a bucket that already
exists (but we can't tell it exists because ->{buckets} is empty).
diff --git a/lib/RT/ExternalStorage/AmazonS3.pm b/lib/RT/ExternalStorage/AmazonS3.pm
index 8144df4..7f8ecbd 100644
--- a/lib/RT/ExternalStorage/AmazonS3.pm
+++ b/lib/RT/ExternalStorage/AmazonS3.pm
@@ -109,7 +109,10 @@ sub Init {
RT->Logger->error("Can't list buckets of AmazonS3: ".$S3->errstr);
return;
}
- unless ( grep {$_->bucket eq $self->Bucket} @{$buckets->{buckets}} ) {
+
+ my @buckets = $buckets->{buckets} ? @{$buckets->{buckets}} : ($buckets);
+
+ unless ( grep {$_->bucket eq $self->Bucket} @buckets ) {
my $ok = $S3->add_bucket( {
bucket => $self->Bucket,
acl_short => 'private',
-----------------------------------------------------------------------
More information about the rt-commit
mailing list