diff --git a/fence/blueprints/data/indexd.py b/fence/blueprints/data/indexd.py index ca88d8c64..f2978f56d 100755 --- a/fence/blueprints/data/indexd.py +++ b/fence/blueprints/data/indexd.py @@ -349,13 +349,12 @@ def init_multipart_upload(key, expires_in=None, bucket=None): Returns: uploadId(str) """ + bucket = bucket or flask.current_app.config["DATA_UPLOAD_BUCKET"] if not bucket: - try: - bucket = flask.current_app.config["DATA_UPLOAD_BUCKET"] - except KeyError: - raise InternalError( - "fence not configured with data upload bucket; can't create signed URL" - ) + raise InternalError( + "fence not configured with data upload bucket; can't create signed URL" + ) + s3_url = "s3://{}/{}".format(bucket, key) return S3IndexedFileLocation(s3_url).init_multipart_upload(expires_in)