From ca44d4680a5c377a16e91a9813046711244b4194 Mon Sep 17 00:00:00 2001 From: Steve Pulec Date: Fri, 31 Oct 2014 07:44:11 -0400 Subject: [PATCH] Py26 cloudwatch fixes. --- moto/cloudwatch/responses.py | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/moto/cloudwatch/responses.py b/moto/cloudwatch/responses.py index 96fecfee6..96f783739 100644 --- a/moto/cloudwatch/responses.py +++ b/moto/cloudwatch/responses.py @@ -17,12 +17,11 @@ class CloudWatchResponse(BaseResponse): results = [] param_index = 1 while True: - index_prefix = "{}.{}.".format(param_prefix, param_index) - new_items = { - camelcase_to_underscores(key.replace(index_prefix, "")): value[0] - for key, value in self.querystring.items() - if key.startswith(index_prefix) - } + index_prefix = "{0}.{1}.".format(param_prefix, param_index) + new_items = {} + for key, value in self.querystring.items(): + if key.startswith(index_prefix): + new_items[camelcase_to_underscores(key.replace(index_prefix, ""))] = value[0] if not new_items: break results.append(new_items)