Actions
Bug #53181
closedrgw: wrong UploadPartCopy error code when src object not exist and src bucket not exist
% Done:
100%
Source:
Tags:
multipart copy backport_processed
Backport:
octopus pacific
Regression:
No
Severity:
3 - minor
Reviewed:
Description
coding: utf-8
from boto3.session import Session
import boto3
import logging
boto3.set_stream_logger('', logging.DEBUG)
access_key = ''
secret_key = ''
host = "s3.amazonaws.com"
url = "http://s3.amazonaws.com"
session = Session(access_key, secret_key)
config = boto3.session.Config(connect_timeout=30000, read_timeout=30000, retries={'max_attempts': 0}, signature_version="s3")
s3_client = session.client('s3', endpoint_url=url, config=config)
dst_bucket = "destbucket"
dst_obj = 'destobject'
src_bucket = "srcbucketnotexist"
src_obj = 'srcobjectnotexist'
mpu = s3_client.create_multipart_upload(Bucket=dst_bucket, Key=dst_obj)
res = s3_client.upload_part_copy(Bucket=dst_bucket, CopySource=src_bucket+"/"+src_obj,
Key=dst_obj,
PartNumber=1, UploadId=mpu["UploadId"])
when src bucket not exist, it should return -ERR_NO_SUCH_BUCKET rather than -ENOENT
when src object not exist, it should return -ENOENT rather than -ACCESS
Actions