From d8ed18aaacb8f5a500a985d019c5cd5b1a01d415 Mon Sep 17 00:00:00 2001 From: beeva-antonioirizar Date: Mon, 15 Feb 2016 13:02:04 +0100 Subject: [PATCH 1/6] add tag () to describe_alarms_template. Because it is miss and it can't work with boto3 --- moto/cloudwatch/responses.py | 94 ++++++++++++++++++------------------ 1 file changed, 48 insertions(+), 46 deletions(-) diff --git a/moto/cloudwatch/responses.py b/moto/cloudwatch/responses.py index 064e6964d..d35560aeb 100644 --- a/moto/cloudwatch/responses.py +++ b/moto/cloudwatch/responses.py @@ -95,52 +95,54 @@ PUT_METRIC_ALARM_TEMPLATE = """ - - {% for alarm in alarms %} - - {{ alarm.actions_enabled }} - - {% for action in alarm.alarm_actions %} - {{ action }} - {% endfor %} - - {{ alarm.arn }} - {{ alarm.configuration_updated_timestamp }} - {{ alarm.description }} - {{ alarm.name }} - {{ alarm.comparison_operator }} - - {% for dimension in alarm.dimensions %} - - {{ dimension.name }} - {{ dimension.value }} - - {% endfor %} - - {{ alarm.evaluation_periods }} - - {% for action in alarm.insufficient_data_actions %} - {{ action }} - {% endfor %} - - {{ alarm.metric_name }} - {{ alarm.namespace }} - - {% for action in alarm.ok_actions %} - {{ action }} - {% endfor %} - - {{ alarm.period }} - {{ alarm.state_reason }} - {{ alarm.state_reason_data }} - {{ alarm.state_updated_timestamp }} - {{ alarm.state_value }} - {{ alarm.statistic }} - {{ alarm.threshold }} - {{ alarm.unit }} - - {% endfor %} - + + + {% for alarm in alarms %} + + {{ alarm.actions_enabled }} + + {% for action in alarm.alarm_actions %} + {{ action }} + {% endfor %} + + {{ alarm.arn }} + {{ alarm.configuration_updated_timestamp }} + {{ alarm.description }} + {{ alarm.name }} + {{ alarm.comparison_operator }} + + {% for dimension in alarm.dimensions %} + + {{ dimension.name }} + {{ dimension.value }} + + {% endfor %} + + {{ alarm.evaluation_periods }} + + {% for action in alarm.insufficient_data_actions %} + {{ action }} + {% endfor %} + + {{ alarm.metric_name }} + {{ alarm.namespace }} + + {% for action in alarm.ok_actions %} + {{ action }} + {% endfor %} + + {{ alarm.period }} + {{ alarm.state_reason }} + {{ alarm.state_reason_data }} + {{ alarm.state_updated_timestamp }} + {{ alarm.state_value }} + {{ alarm.statistic }} + {{ alarm.threshold }} + {{ alarm.unit }} + + {% endfor %} + + """ DELETE_METRIC_ALARMS_TEMPLATE = """ From 1448cf35417674a8916a63373a1d0e7e50b7b782 Mon Sep 17 00:00:00 2001 From: beeva-antonioirizar Date: Wed, 17 Feb 2016 15:14:59 +0100 Subject: [PATCH 2/6] add Istruncated to False in template list_hosted_zones_response in route53. Because it always has it. --- moto/route53/responses.py | 1 + 1 file changed, 1 insertion(+) diff --git a/moto/route53/responses.py b/moto/route53/responses.py index 957ddb9c1..6d72c70b1 100644 --- a/moto/route53/responses.py +++ b/moto/route53/responses.py @@ -174,6 +174,7 @@ LIST_HOSTED_ZONES_RESPONSE = """ From 1ac40cbaf61a4636fcee2762571afe3e0b1346e6 Mon Sep 17 00:00:00 2001 From: beeva-antonioirizar Date: Wed, 17 Feb 2016 15:24:11 +0100 Subject: [PATCH 3/6] add private zone in templates. Because it should have. It is always to False because it doesn't support for private zones. --- moto/route53/models.py | 1 + moto/route53/responses.py | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/moto/route53/models.py b/moto/route53/models.py index 0e79d617a..7838b47d8 100644 --- a/moto/route53/models.py +++ b/moto/route53/models.py @@ -114,6 +114,7 @@ class FakeZone(object): self.name = name self.id = id_ self.comment = comment + self.private_zone = False self.rrsets = [] def add_rrset(self, record_set): diff --git a/moto/route53/responses.py b/moto/route53/responses.py index 6d72c70b1..627e83f5a 100644 --- a/moto/route53/responses.py +++ b/moto/route53/responses.py @@ -139,6 +139,7 @@ GET_HOSTED_ZONE_RESPONSE = """ diff --git a/moto/route53/urls.py b/moto/route53/urls.py index 69f776ff0..e0c620b6a 100644 --- a/moto/route53/urls.py +++ b/moto/route53/urls.py @@ -10,4 +10,5 @@ url_paths = { '{0}hostedzone/[^/]+$': responses.get_or_delete_hostzone_response, '{0}hostedzone/[^/]+/rrset$': responses.rrset_response, '{0}healthcheck': responses.health_check_response, + '{0}tags|trafficpolicyinstances/*': responses.not_implemented, } From 84753aeac558f144146a453f659fcd2172bb3a18 Mon Sep 17 00:00:00 2001 From: beeva-antonioirizar Date: Wed, 17 Feb 2016 17:44:20 +0100 Subject: [PATCH 6/6] fix name method in the last commit --- moto/route53/responses.py | 2 +- moto/route53/urls.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/moto/route53/responses.py b/moto/route53/responses.py index 31c69cbf6..edd766b01 100644 --- a/moto/route53/responses.py +++ b/moto/route53/responses.py @@ -113,7 +113,7 @@ def health_check_response(request, full_url, headers): health_checks = route53_backend.get_health_checks() return 200, headers, template.render(health_checks=health_checks) -def not_implemented_methods(request, full_url, headers): +def not_implemented_response(request, full_url, headers): action = '' if 'tags' in full_url: action = 'tags' diff --git a/moto/route53/urls.py b/moto/route53/urls.py index e0c620b6a..1f0470a04 100644 --- a/moto/route53/urls.py +++ b/moto/route53/urls.py @@ -10,5 +10,5 @@ url_paths = { '{0}hostedzone/[^/]+$': responses.get_or_delete_hostzone_response, '{0}hostedzone/[^/]+/rrset$': responses.rrset_response, '{0}healthcheck': responses.health_check_response, - '{0}tags|trafficpolicyinstances/*': responses.not_implemented, + '{0}tags|trafficpolicyinstances/*': responses.not_implemented_response, }