Mitch Garnaat

Delete the log group when the function is deleted. Fixes #28

......@@ -152,6 +152,7 @@ class Context(object):
def delete(self):
for event_source in self.event_sources:
event_source.remove(self.function)
self.function.log.delete()
self.function.delete()
time.sleep(5)
if self.role:
......
......@@ -13,10 +13,12 @@
import logging
LOG = logging.getLogger(__name__)
from botocore.exceptions import ClientError
import kappa.aws
LOG = logging.getLogger(__name__)
class Log(object):
......@@ -61,3 +63,11 @@ class Log(object):
logStreamName=latest_stream['logStreamName'])
LOG.debug(response)
return response['events']
def delete(self):
try:
response = self._log_svc.delete_log_group(
logGroupName=self.log_group_name)
LOG.debug(response)
except ClientError:
LOG.debug('unable to delete log group')
......