`update_event_sources` fails on SNS and S3 event sources
Per https://github.com/garnaat/kappa/issues/32 , adding an update method for event sources that don't have them.
Showing
1 changed file
with
6 additions
and
0 deletions
... | @@ -144,6 +144,9 @@ class S3EventSource(EventSource): | ... | @@ -144,6 +144,9 @@ class S3EventSource(EventSource): |
144 | except Exception: | 144 | except Exception: |
145 | LOG.exception('Unable to add S3 event source') | 145 | LOG.exception('Unable to add S3 event source') |
146 | 146 | ||
147 | + def update(self, function): | ||
148 | + self.add(function) | ||
149 | + | ||
147 | def remove(self, function): | 150 | def remove(self, function): |
148 | LOG.debug('removing s3 notification') | 151 | LOG.debug('removing s3 notification') |
149 | response = self._s3.get_bucket_notification( | 152 | response = self._s3.get_bucket_notification( |
... | @@ -200,6 +203,9 @@ class SNSEventSource(EventSource): | ... | @@ -200,6 +203,9 @@ class SNSEventSource(EventSource): |
200 | except Exception: | 203 | except Exception: |
201 | LOG.exception('Unable to add SNS event source') | 204 | LOG.exception('Unable to add SNS event source') |
202 | 205 | ||
206 | + def update(self, function): | ||
207 | + self.add(function) | ||
208 | + | ||
203 | def remove(self, function): | 209 | def remove(self, function): |
204 | LOG.debug('removing SNS event source') | 210 | LOG.debug('removing SNS event source') |
205 | try: | 211 | try: | ... | ... |
-
Please register or login to post a comment