mirror of
https://github.com/fog/fog.git
synced 2022-11-09 13:51:43 -05:00
[aws|cdn] fix incorrect get_invalidation result
My change that added the get_invalidation request didn't parse the 'CallerReference' out of the response. This one is needed to match past requests to current invalidations. Signed-off-by: Brice Figureau <brice-puppet@daysofwonder.com>
This commit is contained in:
parent
f2dbf7efb6
commit
3272490dec
2 changed files with 6 additions and 4 deletions
|
@ -6,7 +6,7 @@ module Fog
|
|||
class GetInvalidation < Fog::Parsers::Base
|
||||
|
||||
def reset
|
||||
@response = { 'InvalidationBatch' => [] }
|
||||
@response = { 'InvalidationBatch' => { 'Path' => [] } }
|
||||
end
|
||||
|
||||
def start_element(name, attrs = [])
|
||||
|
@ -16,9 +16,11 @@ module Fog
|
|||
def end_element(name)
|
||||
case name
|
||||
when 'Path'
|
||||
@response['InvalidationBatch'] << @value
|
||||
@response['InvalidationBatch'][name] << value
|
||||
when 'Id', 'Status', 'CreateTime'
|
||||
@response[name] = @value
|
||||
@response[name] = value
|
||||
when 'CallerReference'
|
||||
@response['InvalidationBatch'][name] = value
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
@ -108,7 +108,7 @@ Shindo.tests('Fog::CDN[:aws] | CDN requests', ['aws', 'cdn']) do
|
|||
|
||||
response = @cf_connection.get_invalidation(@dist_id, @invalidation_id)
|
||||
if response.status == 200
|
||||
paths = response.body['InvalidationBatch'].sort
|
||||
paths = response.body['InvalidationBatch']['Path'].sort
|
||||
status = response.body['Status']
|
||||
if status.length > 0 and paths == [ '/test.html', '/path/to/file.html' ].sort
|
||||
result = true
|
||||
|
|
Loading…
Reference in a new issue