Merge branch 'rdsfixes' of https://github.com/jamespharaoh/ansible into jamespharaoh-rdsfixes

This commit is contained in:
James Cammarata 2013-09-05 23:47:32 -05:00
commit 21ad089361

View file

@ -349,12 +349,12 @@ def main():
elif 'EC2_ACCESS_KEY' in os.environ: elif 'EC2_ACCESS_KEY' in os.environ:
aws_access_key = os.environ['EC2_ACCESS_KEY'] aws_access_key = os.environ['EC2_ACCESS_KEY']
if not aws_region: if not region:
module.fail_json(msg = str("region not specified and unable to determine region from EC2_REGION.")) module.fail_json(msg = str("region not specified and unable to determine region from EC2_REGION."))
# connect to the rds endpoint # connect to the rds endpoint
try: try:
conn = boto.rds.connect_to_region(aws_region, aws_access_key_id=aws_access_key, aws_secret_access_key=aws_secret_key) conn = boto.rds.connect_to_region(region, aws_access_key_id=aws_access_key, aws_secret_access_key=aws_secret_key)
except boto.exception.BotoServerError, e: except boto.exception.BotoServerError, e:
module.fail_json(msg = e.error_message) module.fail_json(msg = e.error_message)
@ -438,7 +438,10 @@ def main():
params["iops"] = iops params["iops"] = iops
if security_groups: if security_groups:
params["security_groups"] = security_groups.split(',') if subnet:
params["vpc_security_groups"] = security_groups.split(',')
else:
params["security_groups"] = security_groups.split(',')
try: try:
if command == 'create': if command == 'create':