Project

General

Profile

Bug #42336

rgw: failed to set correct storage class when post object

Added by joke lee about 1 year ago. Updated 12 months ago.

Status:
Fix Under Review
Priority:
Normal
Assignee:
-
Target version:
% Done:

0%

Source:
Tags:
Backport:
Regression:
No
Severity:
3 - minor
Reviewed:
Affected Versions:
ceph-qa-suite:
Pull request ID:
Crash signature:

Description

#!/usr/bin/python
from boto3.session import Session
import boto3
import botocore
botocore.session.Session().set_debug_logger()
bucketname = 'test1'
objectname = 'prefix/keyv7'
access_key = "yly"
secret_key = "yly"
url = "http://127.0.0.1:7480"

session = Session(access_key, secret_key)
s3_client = session.client(
's3',
endpoint_url=url,
use_ssl = False,
)
#import ipdb; ipdb.set_trace() # BREAKPOINT

conditions = [
["starts-with", "$Content-Type", "image/"],
["starts-with", "$key", "prefix/"], {'x-amz-storage-class': 'STANDARD_IA'}, # {"success_action_redirect": "http://www.baidu.com"},
["content-length-range", 0, 20000000],
]
form_data = s3_client.generate_presigned_post(
Conditions = conditions,
Bucket = bucketname,
Key=objectname
)

form_data["fields"]['Content-Type'] = 'image/png'
form_data["fields"]['key'] = objectname
form_data["fields"]['x-amz-storage-class'] = 'STANDARD_IA'
  1. form_data["fields"]['success_action_redirect'] = 'http://www.baidu.com'

files = {"file": open('/root/5M', 'rb')}

import requests
import logging
from requests_toolbelt.utils import dump
logging.basicConfig(level=logging.DEBUG)

response = requests.post(form_data["url"], data=form_data["fields"], files=files)
data = dump.dump_all(response)
print(data.decode('utf-8'))

failed to set correct object storage class

History

#2 Updated by Abhishek Lekshmanan about 1 year ago

  • Status changed from New to Fix Under Review
  • Pull request ID set to 30956

#3 Updated by J. Eric Ivancich about 1 year ago

  • Status changed from Fix Under Review to 7

#4 Updated by J. Eric Ivancich about 1 year ago

  • Target version set to v15.0.0

#5 Updated by Patrick Donnelly 12 months ago

  • Status changed from 7 to Fix Under Review

Also available in: Atom PDF