Fix: Cloudwatch delete Alarm status code handling on invalid alarm name (#3028)
* CloudWwatch delete Alarm status code handling on invalid alarm Name * Handled cases where a mix of existent and non existent alarms are tried to delete * Linting Co-authored-by: usmankb <usman@krazybee.com> Co-authored-by: Bert Blommers <info@bertblommers.nl>
This commit is contained in:
parent
162a38bb10
commit
7a6d78afde
2 changed files with 38 additions and 0 deletions
|
|
@ -304,6 +304,13 @@ class CloudWatchBackend(BaseBackend):
|
|||
)
|
||||
|
||||
def delete_alarms(self, alarm_names):
|
||||
for alarm_name in alarm_names:
|
||||
if alarm_name not in self.alarms:
|
||||
raise RESTError(
|
||||
"ResourceNotFound",
|
||||
"Alarm {0} not found".format(alarm_name),
|
||||
status=404,
|
||||
)
|
||||
for alarm_name in alarm_names:
|
||||
self.alarms.pop(alarm_name, None)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue