-
-
Notifications
You must be signed in to change notification settings - Fork 904
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support versioning configuration #1284
Conversation
S3/S3.py
Outdated
@@ -1064,6 +1065,27 @@ def set_acl(self, uri, acl): | |||
response = self.send_request(request) | |||
return response | |||
|
|||
def set_versioning(self, uri, status): | |||
headers = SortedDict(ignore_case = True) | |||
headers['content-type'] = 'application/xml' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think that you should set that.
We don't set it usually and it is not an issue. better to stay consistent.
S3/S3.py
Outdated
@@ -1064,6 +1065,27 @@ def set_acl(self, uri, acl): | |||
response = self.send_request(request) | |||
return response | |||
|
|||
def set_versioning(self, uri, status): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instead of taking the status as string directly here, it is probably better to only take an "on/off" value.
Thank you for your contribution, this is nice to have but I did a few reviews. |
Also, I don't like so much the following syntax to disable: I think that it is a little bit complicated for someone not knowing it already. I would have prefer something like one of the following: B) |
20e5a6e
to
b6aa6b9
Compare
@fviard Thanks for the reviews! I've pushed my changes. |
It looks good now, thanks for the changes. |
To be noted for a futur new PR, in such a case, you should "squash" your commits or have relevant commit messages. |
Got it, thanks! |
Enable versioning:s3cmd setversioning s3://mybucket
Suspend versioning:s3cmd setversioning s3://mybucket --versioning-suspended
s3cmd setversioning s3://mybucket enable
s3cmd setversioning s3://mybucket disable
info
Resolve #937