Skip to content

Commit

Permalink
Merge pull request #532 from ddzialak/master
Browse files Browse the repository at this point in the history
fix simply error in setlifecycle command
  • Loading branch information
mdomsch committed Apr 23, 2015
2 parents 5986e24 + f5415b4 commit 1d3e3c0
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion S3/S3.py
Expand Up @@ -815,7 +815,7 @@ def set_lifecycle_policy(self, uri, policy):
headers['content-md5'] = compute_content_md5(policy)
request = self.create_request("BUCKET_CREATE", uri = uri,
extra = "?lifecycle", headers=headers, body = policy)
debug(u"set_lifecycle_policy(%s): policy-xml: %s" % (uri))
debug(u"set_lifecycle_policy(%s): policy-xml: %s" % (uri, policy))
response = self.send_request(request)
return response

Expand Down
4 changes: 2 additions & 2 deletions s3cmd
Expand Up @@ -1596,7 +1596,7 @@ def cmd_setlifecycle(args):
response = s3.set_lifecycle_policy(uri, lifecycle_policy)

debug(u"response - %s" % response['status'])
if response['status'] == 204:
if response['status'] == 200:
output(u"%s: Lifecycle Policy updated" % uri)
return EX_OK

Expand Down Expand Up @@ -2050,7 +2050,7 @@ def get_commands_list():

## Lifecycle commands
{"cmd":"expire", "label":"Set or delete expiration rule for the bucket", "param":"s3://BUCKET", "func":cmd_expiration_set, "argc":1},
{"cmd":"setlifecycle", "label":"Upload a lifecycle policy for the bucket", "param":"s3://BUCKET", "func":cmd_setlifecycle, "argc":1},
{"cmd":"setlifecycle", "label":"Upload a lifecycle policy for the bucket", "param":"FILE s3://BUCKET", "func":cmd_setlifecycle, "argc":2},
{"cmd":"dellifecycle", "label":"Remove a lifecycle policy for the bucket", "param":"s3://BUCKET", "func":cmd_dellifecycle, "argc":1},

## CloudFront commands
Expand Down

0 comments on commit 1d3e3c0

Please sign in to comment.