Allow use without credentials

This commit is contained in:
nyov 2020-03-17 10:19:13 +00:00 committed by Artur Shellunts
parent 98e8086d1b
commit 2829cd4268
2 changed files with 0 additions and 8 deletions

View File

@ -94,10 +94,6 @@ class FileFeedStorage:
class S3FeedStorage(BlockingFeedStorage):
def __init__(self, uri, access_key=None, secret_key=None, acl=None):
no_keys = access_key is None and secret_key is None
if no_keys:
raise NotConfigured('%s is missing AWS credentials' %
self.__class__.__name__)
u = urlparse(uri)
self.bucketname = u.hostname
self.access_key = u.username or access_key

View File

@ -24,7 +24,6 @@ from zope.interface.verify import verifyObject
import scrapy
from scrapy.crawler import CrawlerRunner
from scrapy.exceptions import NotConfigured
from scrapy.exporters import CsvItemExporter
from scrapy.extensions.feedexport import (
BlockingFeedStorage,
@ -202,9 +201,6 @@ class S3FeedStorageTest(unittest.TestCase):
aws_credentials['AWS_SECRET_ACCESS_KEY'])
self.assertEqual(storage.access_key, 'uri_key')
self.assertEqual(storage.secret_key, 'uri_secret')
# Instantiate without credentials
with self.assertRaises(NotConfigured):
S3FeedStorage('s3://mybucket/export.csv')
@defer.inlineCallbacks
def test_store(self):