Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Make sure we do not add a 2nd slash in the S3 post processor. Fixes gh-1

  • Loading branch information...
commit e0bd3873c28601e5f8033c9a70f9af945696e01a 1 parent deb658f
@robhudson authored
Showing with 4 additions and 2 deletions.
  1. +4 −2 dumpy/postprocessor/s3copy.py
View
6 dumpy/postprocessor/s3copy.py
@@ -26,6 +26,9 @@ def parse_config(self):
self.secret_key = self._get_option_value(self.config, 'S3Copy options', 'secret_key')
self.bucket = self._get_option_value(self.config, 'S3Copy options', 'bucket')
self.prefix = self._get_option_value(self.config, 'S3Copy options', 'prefix')
+ # Make sure prefix ends with a single forward slash
+ if not self.prefix.endswith('/'):
+ self.prefix += '/'
def process(self, file):
if boto is None:
@@ -37,9 +40,8 @@ def process(self, file):
bucket = conn.create_bucket(self.bucket)
k = Key(bucket)
if self.prefix:
- keyname = '%s%s%s' % (
+ keyname = '%s%s' % (
self.prefix,
- self.prefix.endswith('/') and '' or '/',
os.path.basename(file.name)
)
else:
Please sign in to comment.
Something went wrong with that request. Please try again.