From 103be7ab519456dca04460af600d733e4f4eb337 Mon Sep 17 00:00:00 2001 From: Rob Date: Fri, 4 Dec 2015 01:50:38 +0000 Subject: [PATCH] Added missing else statement that caused existing rules to be discarded --- lib/ansible/modules/extras/cloud/amazon/s3_lifecycle.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/ansible/modules/extras/cloud/amazon/s3_lifecycle.py b/lib/ansible/modules/extras/cloud/amazon/s3_lifecycle.py index 1ebfedcaf4e..cc05d6e7f7a 100644 --- a/lib/ansible/modules/extras/cloud/amazon/s3_lifecycle.py +++ b/lib/ansible/modules/extras/cloud/amazon/s3_lifecycle.py @@ -223,6 +223,8 @@ def create_lifecycle_rule(connection, module): lifecycle_obj.append(rule) changed = True appended = True + else: + lifecycle_obj.append(existing_rule) # If nothing appended then append now as the rule must not exist if not appended: lifecycle_obj.append(rule)