boto/boto — Issue #413: [patch] - Problems with MultiAZ/AutoMinorVersionUpgrade set to False
Author: atodorov
Created: 2011-11-19 11:08:29+00:00
State: open

Hi,
rds.create_dbinstance is not processing parameters correctly IMHO.

When I tried to create RDS instance with MultiAZ/AutoMinorVersionUpgrade set to False it was always created with these parameters set to True.

I added a print statement in the function to demonstrate it:

Before the patch:

auto_minor_version_upgrade= False
multi_az= False
params = {'Engine': 'MySQL5.1', 'DBParameterGroupName': 'myparamgrp', 'MultiAZ': 'true', 'MasterUsername': u'atodorov', 'MasterUserPassword': u'secret', 'DBSecurityGroups.member.1': 'mysecgrp', 'AllocatedStorage': 5, 'DBInstanceClass': u'db.m1.small', 'Port': 3306, 'DBInstanceIdentifier': 'mydb'}

After the patch:

auto_minor_version_upgrade= False
multi_az= False
params = {'DBParameterGroupName': 'myparamgrp', 'MasterUsername': u'atodorov', 'DBSecurityGroups.member.1': 'mysecgrp', 'Engine': 'MySQL5.1', 'MultiAZ': 'false', 'MasterUserPassword': u'secret', 'AutoMinorVersionUpgrade': 'false', 'AllocatedStorage': 5, 'DBInstanceClass': u'db.m1.small', 'Port': 3306, 'DBInstanceIdentifier': 'mydb'}

The patch is here:
https://github.com/atodorov/boto/commit/2ef5cf27164807b4fd5d702986048acbd4f3a4e5

It removes the if conditions for both parameters and directly adds them to the params dict at the beginning. It does the same for the Port parameter too. This will always work because the 3 parameters have default values and are not None. No need for an if-then statement.

I'm new to git and github and couldn't figure it out how to send a clean pull request for this patch. it was also showing my other commits not related to the issue.