Skip to content

Commit

Permalink
Merge pull request #2578 from Bugagazavr/master
Browse files Browse the repository at this point in the history
[OpenStack] Decode body to array
  • Loading branch information
Kyle Rames committed Jan 24, 2014
2 parents 1167c4a + f7c22c8 commit 28e8259
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions lib/fog/openstack/models/storage/directories.rb
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ def get(key, options = {})
end
directory.files.merge_attributes(options)
directory.files.instance_variable_set(:@loaded, true)

data.body.each do |file|
directory.files << directory.files.new(file)
end
Expand Down
2 changes: 1 addition & 1 deletion lib/fog/openstack/storage.rb
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ def request(params, parse_json = true)
error
end
end
if !response.body.empty? && parse_json && response.headers['Content-Type'] =~ %r{application/json}
if !response.body.empty? && parse_json && response.get_header('Content-Type') =~ %r{application/json}
response.body = Fog::JSON.decode(response.body)
end
response
Expand Down

0 comments on commit 28e8259

Please sign in to comment.