aboutsummaryrefslogtreecommitdiff
path: root/IkiWiki/Plugin/amazon_s3.pm
diff options
context:
space:
mode:
authorJoey Hess <joey@gnu.kitenet.net>2010-02-09 16:24:14 -0500
committerJoey Hess <joey@gnu.kitenet.net>2010-02-09 16:24:14 -0500
commita4ec579d1a6632447db91f2e52e90633b96a070f (patch)
tree7556d9bacef660134ebf3bd5e606e18e7237fb24 /IkiWiki/Plugin/amazon_s3.pm
parent4ce14aa621be4c6b8551555395b80b68fbcc1ffe (diff)
downloadikiwiki-a4ec579d1a6632447db91f2e52e90633b96a070f.tar
ikiwiki-a4ec579d1a6632447db91f2e52e90633b96a070f.tar.gz
amazon_s3: Fix to support the EU S3 datacenter, which is more picky about attempts to create already existing buckets.
Diffstat (limited to 'IkiWiki/Plugin/amazon_s3.pm')
-rw-r--r--IkiWiki/Plugin/amazon_s3.pm6
1 files changed, 5 insertions, 1 deletions
diff --git a/IkiWiki/Plugin/amazon_s3.pm b/IkiWiki/Plugin/amazon_s3.pm
index 3571c4189..cfd8cd347 100644
--- a/IkiWiki/Plugin/amazon_s3.pm
+++ b/IkiWiki/Plugin/amazon_s3.pm
@@ -133,6 +133,10 @@ sub getbucket {
}
if (! $bucket) {
+ # Try to use existing bucket.
+ $bucket=$s3->bucket($config{amazon_s3_bucket});
+ }
+ if (! $bucket) {
error(gettext("Failed to create S3 bucket: ").
$s3->err.": ".$s3->errstr."\n");
}
@@ -178,7 +182,7 @@ sub writefile ($$$;$$) {
# First, write the file to disk.
my $ret=$IkiWiki::Plugin::amazon_s3::subs{'IkiWiki::writefile'}->($file, $destdir, $content, $binary, $writer);
-
+
my @keys=IkiWiki::Plugin::amazon_s3::file2keys("$destdir/$file");
# Store the data in S3.