1
0
Fork 0
mirror of https://github.com/fog/fog.git synced 2022-11-09 13:51:43 -05:00

[aws|rds] Mock support for setting AZ and MultiAZ

Mocking preserves the AvailabilityZone and MultiAZ parameters if set.
This commit is contained in:
Aaron Suggs 2012-08-15 11:50:56 -04:00
parent cb1357252a
commit 3992e818b7
2 changed files with 2 additions and 2 deletions

View file

@ -85,7 +85,7 @@ module Fog
"Engine"=> options["Engine"], "Engine"=> options["Engine"],
"EngineVersion"=> options["EngineVersion"] || "5.5.12", "EngineVersion"=> options["EngineVersion"] || "5.5.12",
"PendingModifiedValues"=>{"MasterUserPassword"=>"****"}, # This clears when is available "PendingModifiedValues"=>{"MasterUserPassword"=>"****"}, # This clears when is available
"MultiAZ"=>false, "MultiAZ"=> !!options['MultiAZ'],
"MasterUsername"=> options["MasterUsername"], "MasterUsername"=> options["MasterUsername"],
"DBInstanceClass"=> options["DBInstanceClass"], "DBInstanceClass"=> options["DBInstanceClass"],
"DBInstanceStatus"=>"creating", "DBInstanceStatus"=>"creating",

View file

@ -51,7 +51,7 @@ module Fog
if Time.now - server['InstanceCreateTime'] >= Fog::Mock.delay * 2 if Time.now - server['InstanceCreateTime'] >= Fog::Mock.delay * 2
region = "us-east-1" region = "us-east-1"
server["DBInstanceStatus"] = "available" server["DBInstanceStatus"] = "available"
server["AvailabilityZone"] = region + 'a' server["AvailabilityZone"] ||= region + 'a'
server["Endpoint"] = {"Port"=>3306, server["Endpoint"] = {"Port"=>3306,
"Address"=> Fog::AWS::Mock.rds_address(server["DBInstanceIdentifier"],region) } "Address"=> Fog::AWS::Mock.rds_address(server["DBInstanceIdentifier"],region) }
server["PendingModifiedValues"] = {} server["PendingModifiedValues"] = {}