(self, uri)
| 655 | return response |
| 656 | |
| 657 | def _expiration_set(self, uri): |
| 658 | debug("put bucket lifecycle") |
| 659 | body = '<LifecycleConfiguration>' |
| 660 | body += ' <Rule>' |
| 661 | body += ' <Filter>' |
| 662 | body += ' <Prefix>%s</Prefix>' % self.config.expiry_prefix |
| 663 | body += ' </Filter>' |
| 664 | body += ' <Status>Enabled</Status>' |
| 665 | body += ' <Expiration>' |
| 666 | if self.config.expiry_date: |
| 667 | body += ' <Date>%s</Date>' % self.config.expiry_date |
| 668 | elif self.config.expiry_days: |
| 669 | body += ' <Days>%s</Days>' % self.config.expiry_days |
| 670 | body += ' </Expiration>' |
| 671 | body += ' </Rule>' |
| 672 | body += '</LifecycleConfiguration>' |
| 673 | |
| 674 | headers = SortedDict(ignore_case = True) |
| 675 | headers['content-md5'] = generate_content_md5(body) |
| 676 | bucket = uri.bucket() |
| 677 | request = self.create_request("BUCKET_CREATE", bucket = bucket, |
| 678 | headers = headers, body = body, |
| 679 | uri_params = {'lifecycle': None}) |
| 680 | return (request) |
| 681 | |
| 682 | def _guess_content_type(self, filename): |
| 683 | content_type = self.config.default_mime_type |
no test coverage detected