Fix TargetDBInstanceIdentifier assignment in wrong place (issue #46689) (#47710)

This commit is contained in:
Łukasz Tomaszkiewicz 2018-12-04 13:43:49 +01:00 committed by John R Barker
parent 9c02ade536
commit 9d62cbc2af

View file

@ -760,6 +760,9 @@ def get_final_snapshot(client, module, snapshot_identifier):
def get_parameters(client, module, parameters, method_name): 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) required_options = get_boto3_client_method_parameters(client, method_name, required=True)
if any([parameters.get(k) is None for k in required_options]): if any([parameters.get(k) is None for k in required_options]):
module.fail_json(msg='To {0} requires the parameters: {1}'.format( 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']) parameters['Tags'] = ansible_dict_to_boto3_tag_list(parameters['Tags'])
if method_name == 'modify_db_instance': if method_name == 'modify_db_instance':
parameters = get_options_with_changing_values(client, module, parameters) 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 return parameters