Ryan S. Brown

Update to use "put_bucket_notification_configuration"

And, for debug, print the full response for error cases.
...@@ -132,16 +132,21 @@ class S3EventSource(EventSource): ...@@ -132,16 +132,21 @@ class S3EventSource(EventSource):
132 132
133 def add(self, function): 133 def add(self, function):
134 notification_spec = { 134 notification_spec = {
135 - 'CloudFunctionConfiguration': { 135 + 'LambdaFunctionConfigurations':[
136 + {
136 'Id': self._make_notification_id(function.name), 137 'Id': self._make_notification_id(function.name),
137 'Events': [e for e in self._config['events']], 138 'Events': [e for e in self._config['events']],
138 - 'CloudFunction': function.arn}} 139 + 'LambdaFunctionArn': function.arn,
140 + }
141 + ]
142 + }
139 try: 143 try:
140 - response = self._s3.put_bucket_notification( 144 + response = self._s3.put_bucket_notification_configuration(
141 Bucket=self._get_bucket_name(), 145 Bucket=self._get_bucket_name(),
142 NotificationConfiguration=notification_spec) 146 NotificationConfiguration=notification_spec)
143 LOG.debug(response) 147 LOG.debug(response)
144 - except Exception: 148 + except Exception as exc:
149 + LOG.debug(exc.response)
145 LOG.exception('Unable to add S3 event source') 150 LOG.exception('Unable to add S3 event source')
146 151
147 def update(self, function): 152 def update(self, function):
......