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

Merge pull request #2400 from maestrodev/aws-dns-status

[aws|dns] Don't set mock changes to INSYNC immediately, only after some timeout
This commit is contained in:
Wesley Beary 2013-11-18 16:01:38 -08:00
commit e0835fdd08
3 changed files with 5 additions and 3 deletions

View file

@ -180,7 +180,7 @@ module Fog
if errors.empty?
change = {
:id => change_id,
:status => 'INSYNC',
:status => 'PENDING',
:submitted_at => Time.now.utc.iso8601
}
self.data[:changes][change[:id]] = change

View file

@ -82,7 +82,7 @@ module Fog
}
change = {
:id => Fog::AWS::Mock.change_id,
:status => 'INSYNC',
:status => 'PENDING',
:submitted_at => Time.now.utc.iso8601
}
self.data[:changes][change[:id]] = change

View file

@ -43,9 +43,11 @@ module Fog
if change
response.status = 200
submitted_at = Time.parse(change[:submitted_at])
response.body = {
'Id' => change[:id],
'Status' => 'INSYNC', # TODO do some logic here
# set as insync after some time
'Status' => (submitted_at + (Fog.timeout/4).to_i) < Time.now ? 'INSYNC' : change[:status],
'SubmittedAt' => change[:submitted_at]
}
response