Skip to content

Commit

Permalink
Fixes #1247 - Update expire command to use Rule/Filter/Prefix for Lif…
Browse files Browse the repository at this point in the history
…ecycleConfiguration

Inside LifecycleConfiguration, setting the field Rule/Prefix is now
obsolete. And it is replaced with Rule/Filter/Prefix.
  • Loading branch information
fviard committed Aug 28, 2022
1 parent 134bd4b commit bed73f3
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions S3/S3.py
Original file line number Diff line number Diff line change
Expand Up @@ -592,14 +592,16 @@ def _expiration_set(self, uri):
debug("put bucket lifecycle")
body = '<LifecycleConfiguration>'
body += ' <Rule>'
body += (' <Prefix>%s</Prefix>' % self.config.expiry_prefix)
body += (' <Status>Enabled</Status>')
body += (' <Expiration>')
body += ' <Filter>'
body += ' <Prefix>%s</Prefix>' % self.config.expiry_prefix
body += ' </Filter>'
body += ' <Status>Enabled</Status>'
body += ' <Expiration>'
if self.config.expiry_date:
body += (' <Date>%s</Date>' % self.config.expiry_date)
body += ' <Date>%s</Date>' % self.config.expiry_date
elif self.config.expiry_days:
body += (' <Days>%s</Days>' % self.config.expiry_days)
body += (' </Expiration>')
body += ' <Days>%s</Days>' % self.config.expiry_days
body += ' </Expiration>'
body += ' </Rule>'
body += '</LifecycleConfiguration>'

Expand Down

0 comments on commit bed73f3

Please sign in to comment.