MCPcopy Create free account
hub / github.com/celery/celery / __init__

Method __init__

celery/backends/s3.py:31–51  ·  view source on GitHub ↗
(self, **kwargs)

Source from the content-addressed store, hash-verified

29 """
30
31 def __init__(self, **kwargs):
32 super().__init__(**kwargs)
33
34 if not boto3 or not botocore:
35 raise ImproperlyConfigured('You must install boto3 '
36 'to use s3 backend')
37 conf = self.app.conf
38
39 self.endpoint_url = conf.get('s3_endpoint_url', None)
40 self.aws_region = conf.get('s3_region', None)
41
42 self.aws_access_key_id = conf.get('s3_access_key_id', None)
43 self.aws_secret_access_key = conf.get('s3_secret_access_key', None)
44
45 self.bucket_name = conf.get('s3_bucket', None)
46 if not self.bucket_name:
47 raise ImproperlyConfigured('Missing bucket name')
48
49 self.base_path = conf.get('s3_base_path', None)
50
51 self._s3_resource = self._connect_to_s3()
52
53 def _get_s3_object(self, key):
54 key_bucket_path = self.base_path + key if self.base_path else key

Callers

nothing calls this directly

Calls 3

_connect_to_s3Method · 0.95
getMethod · 0.45

Tested by

no test coverage detected