From b57887bafdc2419121ffce8f2001dd8db1408092 Mon Sep 17 00:00:00 2001 From: Bruce Pennypacker Date: Fri, 18 Apr 2014 17:56:11 +0000 Subject: [PATCH] Fix for https://github.com/ansible/ansible/issues/7054 - when renaming an instance and waiting for the change to occur, force result.id to the name of the new instance so the subsequent call to get_current_resource succeeds. --- library/cloud/rds | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/library/cloud/rds b/library/cloud/rds index cde7c5bcf2..42f4886311 100644 --- a/library/cloud/rds +++ b/library/cloud/rds @@ -540,6 +540,12 @@ def main(): found = 1 if found == 0: time.sleep(5) + + # The name of the database has now changed, so we have + # to force result to contain the new instance, otherwise + # the call below to get_current_resource will fail since it + # will be looking for the old instance name. + result.id = new_instance_name else: # Wait for a few seconds since it takes a while for AWS # to change the instance from 'available' to 'modifying'