Permalink
Browse files

Rename misspelled :backup_retention_period option (was :backend_reten…

…tion_period). Allow :backup_retention_period to be a string or fixnum.
  • Loading branch information...
1 parent a8ff0a1 commit 7fbeb3bc1da3348137dfdd8a840be62db7a89d50 @grempe committed Apr 25, 2010
Showing with 5 additions and 2 deletions.
  1. +5 −2 lib/AWS/RDS/rds.rb
View
@@ -17,7 +17,7 @@ class Base < AWS::Base
# @option options [String] :db_security_groups are the list of db security groups to associate with the instance (nil)
# @option options [String] :availability_zone is the availability_zone to create the instance in (nil)
# @option options [String] :preferred_maintenance_window in format: ddd:hh24:mi-ddd:hh24:mi (nil)
- # @option options [String] :backend_retention_period is the number of days which automated backups are retained (1)
+ # @option options [String] :backup_retention_period is the number of days which automated backups are retained (1)
# @option options [String] :preferred_backup_window is the daily time range for which automated backups are created
#
def create_db_instance( options = {})
@@ -29,6 +29,9 @@ def create_db_instance( options = {})
raise ArgumentError, "No :master_user_password provided" if options.does_not_have?(:master_user_password)
raise ArgumentError, "No :db_instance_class provided" if options.does_not_have?(:db_instance_class)
+ # handle a former argument that was misspelled
+ raise ArgumentError, "Perhaps you meant :backup_retention_period" if options.has?(:backend_retention_period)
+
params = {}
params['DBInstanceIdentifier'] = options[:db_instance_identifier]
params["AllocatedStorage"] = options[:allocated_storage].to_s
@@ -43,7 +46,7 @@ def create_db_instance( options = {})
params["DBSecurityGroups"] = options[:db_security_groups] if options.has?(:db_security_groups)
params["AvailabilityZone"] = options[:availability_zone] if options.has?(:availability_zone)
params["PreferredMaintenanceWindow"] = options[:preferred_maintenance_window] if options.has?(:preferred_maintenance_window)
- params["BackupRetentionPeriod"] = options[:backend_retention_period] if options.has?(:backend_retention_period)
+ params["BackupRetentionPeriod"] = options[:backup_retention_period].to_s if options.has?(:backup_retention_period)
params["PreferredBackupWindow"] = options[:preferred_backup_window] if options.has?(:preferred_backup_window)
return response_generator(:action => "CreateDBInstance", :params => params)

0 comments on commit 7fbeb3b

Please sign in to comment.