Skip to content

Commit

Permalink
Fixes #286
Browse files Browse the repository at this point in the history
  • Loading branch information
Claude Vessaz committed Aug 26, 2016
1 parent dbeb646 commit a223dd0
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions zappa/zappa.py
Original file line number Diff line number Diff line change
Expand Up @@ -1275,8 +1275,12 @@ def delete_rule(self, rule_name):
try:
targets = self.events_client.list_targets_by_rule(Rule=rule_name)
except botocore.exceptions.ClientError as e:
logger.debug('No target found for this rule: {} {}'.format(rule_name, e.message))
return
error_code = e.response['Error']['Code']
if error_code == 'AccessDeniedException':
raise
else:
logger.debug('No target found for this rule: {} {}'.format(rule_name, e.message))
return

if 'Targets' in targets and targets['Targets']:
response = self.events_client.remove_targets(Rule=rule_name, Ids=[x['Id'] for x in targets['Targets']])
Expand Down

0 comments on commit a223dd0

Please sign in to comment.