Remove S3ReportStorage, because S3BotoStorage already handles a custom_domain argument
This commit is contained in:
@@ -3305,7 +3305,7 @@ class TestInstructorAPILevelsDataDump(SharedModuleStoreTestCase, LoginEnrollment
|
||||
ex_status = 503
|
||||
ex_reason = 'Slow Down'
|
||||
url = reverse('list_report_downloads', kwargs={'course_id': text_type(self.course.id)})
|
||||
with patch('openedx.core.storage.S3ReportStorage.listdir', side_effect=BotoServerError(ex_status, ex_reason)):
|
||||
with patch('storages.backends.s3boto.S3BotoStorage.listdir', side_effect=BotoServerError(ex_status, ex_reason)):
|
||||
response = self.client.post(url, {})
|
||||
mock_error.assert_called_with(
|
||||
u'Fetching files failed for course: %s, status: %s, reason: %s',
|
||||
|
||||
@@ -212,7 +212,7 @@ class ReportStore(object):
|
||||
storage_type = config.get('STORAGE_TYPE', '').lower()
|
||||
if storage_type == 's3':
|
||||
return DjangoStorageReportStore(
|
||||
storage_class='openedx.core.storage.S3ReportStorage',
|
||||
storage_class='storages.backends.s3boto.S3BotoStorage',
|
||||
storage_kwargs={
|
||||
'bucket': config['BUCKET'],
|
||||
'location': config['ROOT_PATH'],
|
||||
|
||||
@@ -125,7 +125,7 @@ class DjangoStorageReportStoreS3TestCase(MockS3Mixin, ReportStoreTestMixin, Test
|
||||
storage.
|
||||
"""
|
||||
test_settings = copy.deepcopy(settings.GRADES_DOWNLOAD)
|
||||
test_settings['STORAGE_CLASS'] = 'openedx.core.storage.S3ReportStorage'
|
||||
test_settings['STORAGE_CLASS'] = 'storages.backends.s3boto.S3BotoStorage'
|
||||
test_settings['STORAGE_KWARGS'] = {
|
||||
'bucket': settings.GRADES_DOWNLOAD['BUCKET'],
|
||||
'location': settings.GRADES_DOWNLOAD['ROOT_PATH'],
|
||||
|
||||
@@ -9,7 +9,6 @@ from django.utils.deconstruct import deconstructible
|
||||
from django.utils.lru_cache import lru_cache
|
||||
from pipeline.storage import NonPackagingMixin, PipelineCachedStorage
|
||||
from require.storage import OptimizedFilesMixin
|
||||
from storages.backends.s3boto import S3BotoStorage
|
||||
|
||||
from openedx.core.djangoapps.theming.storage import ThemeCachedFilesMixin, ThemePipelineMixin, ThemeStorage
|
||||
|
||||
@@ -68,29 +67,6 @@ class DevelopmentStorage(
|
||||
pass
|
||||
|
||||
|
||||
class S3ReportStorage(S3BotoStorage): # pylint: disable=abstract-method
|
||||
"""
|
||||
Storage for reports.
|
||||
"""
|
||||
def __init__(self, acl=None, bucket=None, custom_domain=None, **settings):
|
||||
"""
|
||||
init method for S3ReportStorage, Note that we have added an extra key-word
|
||||
argument named "custom_domain" and this argument should not be passed to the superclass's init.
|
||||
|
||||
Args:
|
||||
acl: content policy for the uploads i.e. private, public etc.
|
||||
bucket: Name of S3 bucket to use for storing and/or retrieving content
|
||||
custom_domain: custom domain to use for generating file urls
|
||||
**settings: additional settings to be passed in to S3BotoStorage,
|
||||
|
||||
Returns:
|
||||
|
||||
"""
|
||||
if custom_domain:
|
||||
self.custom_domain = custom_domain
|
||||
super(S3ReportStorage, self).__init__(acl=acl, bucket=bucket, **settings)
|
||||
|
||||
|
||||
@deconstructible
|
||||
class OverwriteStorage(FileSystemStorage):
|
||||
"""
|
||||
|
||||
Reference in New Issue
Block a user