From 9d93f052c2ed370ad3cef4856cb0b0eb2d56492f Mon Sep 17 00:00:00 2001 From: Jesse Rusak Date: Mon, 30 Mar 2015 15:43:14 -0400 Subject: [PATCH] Update rds module for RDS2 parameter name change. boto's rds2 renamed `vpc_security_groups` to `vpc_security_group_ids` and changed from a list of `VPCSecurityGroupMembership` to just a list of ids. This accommodates that change when rds2 is being used. --- lib/ansible/modules/cloud/amazon/rds.py | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) mode change 100644 => 100755 lib/ansible/modules/cloud/amazon/rds.py diff --git a/lib/ansible/modules/cloud/amazon/rds.py b/lib/ansible/modules/cloud/amazon/rds.py old mode 100644 new mode 100755 index dd2a11e2af..7e9836a51e --- a/lib/ansible/modules/cloud/amazon/rds.py +++ b/lib/ansible/modules/cloud/amazon/rds.py @@ -931,11 +931,15 @@ def validate_parameters(required_vars, valid_vars, module): if module.params.get('security_groups'): params[sec_group] = module.params.get('security_groups').split(',') - if module.params.get('vpc_security_groups'): - groups_list = [] - for x in module.params.get('vpc_security_groups'): - groups_list.append(boto.rds.VPCSecurityGroupMembership(vpc_group=x)) - params["vpc_security_groups"] = groups_list + vpc_groups = module.params.get('vpc_security_groups') + if vpc_groups: + if has_rds2: + params['vpc_security_group_ids'] = vpc_groups + else: + groups_list = [] + for x in vpc_groups: + groups_list.append(boto.rds.VPCSecurityGroupMembership(vpc_group=x)) + params['vpc_security_groups'] = groups_list # Convert tags dict to list of tuples that rds2 expects if 'tags' in params: