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:
commit
e0835fdd08
3 changed files with 5 additions and 3 deletions
|
@ -180,7 +180,7 @@ module Fog
|
||||||
if errors.empty?
|
if errors.empty?
|
||||||
change = {
|
change = {
|
||||||
:id => change_id,
|
:id => change_id,
|
||||||
:status => 'INSYNC',
|
:status => 'PENDING',
|
||||||
:submitted_at => Time.now.utc.iso8601
|
:submitted_at => Time.now.utc.iso8601
|
||||||
}
|
}
|
||||||
self.data[:changes][change[:id]] = change
|
self.data[:changes][change[:id]] = change
|
||||||
|
|
|
@ -82,7 +82,7 @@ module Fog
|
||||||
}
|
}
|
||||||
change = {
|
change = {
|
||||||
:id => Fog::AWS::Mock.change_id,
|
:id => Fog::AWS::Mock.change_id,
|
||||||
:status => 'INSYNC',
|
:status => 'PENDING',
|
||||||
:submitted_at => Time.now.utc.iso8601
|
:submitted_at => Time.now.utc.iso8601
|
||||||
}
|
}
|
||||||
self.data[:changes][change[:id]] = change
|
self.data[:changes][change[:id]] = change
|
||||||
|
|
|
@ -43,9 +43,11 @@ module Fog
|
||||||
|
|
||||||
if change
|
if change
|
||||||
response.status = 200
|
response.status = 200
|
||||||
|
submitted_at = Time.parse(change[:submitted_at])
|
||||||
response.body = {
|
response.body = {
|
||||||
'Id' => change[:id],
|
'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]
|
'SubmittedAt' => change[:submitted_at]
|
||||||
}
|
}
|
||||||
response
|
response
|
||||||
|
|
Loading…
Add table
Reference in a new issue