From db92301b0005e95312ab1e45db049f846d8a9e7a Mon Sep 17 00:00:00 2001 From: "Michael J. Schultz" Date: Fri, 11 Apr 2014 18:23:53 -0500 Subject: [PATCH] cloud/elasticache: Ensure self.data is iterable - self.data['SecurityGroups'] can return None causing traceback, if that is the case fallback to an empty list --- library/cloud/elasticache | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/library/cloud/elasticache b/library/cloud/elasticache index 54bf734d20..8c82f2fcc2 100644 --- a/library/cloud/elasticache +++ b/library/cloud/elasticache @@ -395,7 +395,8 @@ class ElastiCacheManager(object): # check vpc security groups vpc_security_groups = [] - for sg in self.data['SecurityGroups']: + security_groups = self.data['SecurityGroups'] or [] + for sg in security_groups: vpc_security_groups.append(sg['SecurityGroupId']) if set(vpc_security_groups) - set(self.security_group_ids): return True