From 9d62cbc2af25fc0c8570afa1aa95520b476fc0de Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Tomaszkiewicz?= Date: Tue, 4 Dec 2018 13:43:49 +0100 Subject: [PATCH] Fix TargetDBInstanceIdentifier assignment in wrong place (issue #46689) (#47710) --- lib/ansible/modules/cloud/amazon/rds_instance.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/ansible/modules/cloud/amazon/rds_instance.py b/lib/ansible/modules/cloud/amazon/rds_instance.py index fee883ee73..179ac84274 100644 --- a/lib/ansible/modules/cloud/amazon/rds_instance.py +++ b/lib/ansible/modules/cloud/amazon/rds_instance.py @@ -760,6 +760,9 @@ def get_final_snapshot(client, module, snapshot_identifier): def get_parameters(client, module, parameters, method_name): + if method_name == 'restore_db_instance_to_point_in_time': + parameters['TargetDBInstanceIdentifier'] = module.params['db_instance_identifier'] + required_options = get_boto3_client_method_parameters(client, method_name, required=True) if any([parameters.get(k) is None for k in required_options]): module.fail_json(msg='To {0} requires the parameters: {1}'.format( @@ -778,8 +781,6 @@ def get_parameters(client, module, parameters, method_name): parameters['Tags'] = ansible_dict_to_boto3_tag_list(parameters['Tags']) if method_name == 'modify_db_instance': parameters = get_options_with_changing_values(client, module, parameters) - if method_name == 'restore_db_instance_to_point_in_time': - parameters['TargetDBInstanceIdentifier'] = module.params['db_instance_identifier'] return parameters