MCPcopy Create free account
hub / github.com/s3tools/s3cmd / expiration_set

Method expiration_set

S3/S3.py:641–655  ·  view source on GitHub ↗
(self, uri, bucket_location = None)

Source from the content-addressed store, hash-verified

639 return response
640
641 def expiration_set(self, uri, bucket_location = None):
642 if self.config.expiry_date and self.config.expiry_days:
643 raise ParameterError("Expect either --expiry-day or --expiry-date")
644 if not (self.config.expiry_date or self.config.expiry_days):
645 if self.config.expiry_prefix:
646 raise ParameterError("Expect either --expiry-day or --expiry-date")
647 debug("del bucket lifecycle")
648 bucket = uri.bucket()
649 request = self.create_request("BUCKET_DELETE", bucket = bucket,
650 uri_params = {'lifecycle': None})
651 else:
652 request = self._expiration_set(uri)
653 response = self.send_request(request)
654 debug("Received response '%s'" % (response))
655 return response
656
657 def _expiration_set(self, uri):
658 debug("put bucket lifecycle")

Callers

nothing calls this directly

Calls 5

create_requestMethod · 0.95
_expiration_setMethod · 0.95
send_requestMethod · 0.95
ParameterErrorClass · 0.85
bucketMethod · 0.80

Tested by

no test coverage detected