-
-
Notifications
You must be signed in to change notification settings - Fork 354
Closed
Description
Parser doesn't support ContinuationToken as per http://docs.aws.amazon.com/AmazonS3/latest/API/v2-RESTBucketGET.html
require 'fog/aws'
Fog::Storage.new(
:provider => 'AWS',
:aws_access_key_id => ':key',
:aws_secret_access_key => ':secret'
).tap do |s|
r = s.get_bucket(':bucket', 'list-type' => 2)
if r.body['IsTruncated']
puts r.body['ContinuationToken'].inspect # => nil
end
end
returns expected result after monkey patch
require 'fog/aws/parsers/storage/get_bucket'
Fog::Parsers::Storage::AWS::GetBucket.class_eval do
alias_method :original_end_element, :end_element
def end_element name
case name
when 'NextContinuationToken'
@response['NextContinuationToken'] = value
else
original_end_element name
end
end
end
Metadata
Metadata
Assignees
Labels
No labels