From 2d7f0e28db52615fcaeb1463439d9633de9f18d4 Mon Sep 17 00:00:00 2001 From: Jim Dalton Date: Sun, 20 Oct 2013 16:20:36 -0700 Subject: [PATCH] Availability zone should not be required --- library/cloud/elasticache | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/library/cloud/elasticache b/library/cloud/elasticache index fd39ff754c8..63c01c3cb55 100644 --- a/library/cloud/elasticache +++ b/library/cloud/elasticache @@ -399,9 +399,11 @@ class ElastiCacheManager(object): unmodifiable_data = { 'node_type': self.data['CacheNodeType'], 'engine': self.data['Engine'], - 'zone': self.data['PreferredAvailabilityZone'], 'cache_port': self._get_port() } + # Only check for modifications if zone is specified + if self.zone is not None: + unmodifiable_data['zone'] = self.data['PreferredAvailabilityZone'] for key, value in unmodifiable_data.iteritems(): if getattr(self, key) != value: return True @@ -506,8 +508,6 @@ def main(): if state == 'present' and not num_nodes: module.fail_json(msg="'num_nodes' is a required parameter. Please specify num_nodes > 0") - if state == 'present' and not zone: - module.fail_json(msg="'zone' is a required parameter. Please specify an availability zone") if not aws_secret_key: if 'AWS_SECRET_KEY' in os.environ: