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

Merge pull request #581 from newmana/master

Ninefold implementation missing head_namespace implementation
This commit is contained in:
Wesley Beary 2011-11-07 07:01:54 -08:00
commit f2505be0f6
3 changed files with 24 additions and 2 deletions

View file

@ -51,12 +51,13 @@ module Fog
def head(key, options = {})
requires :directory
data = connection.head_object(directory.key, key)
data = connection.head_namespace(directory.key + key, :parse => false)
file_data = data.headers.merge({
:body => data.body,
:key => key
})
new(file_data)
rescue Fog::Storage::Rackspace::NotFound
rescue Fog::Storage::Ninefold::NotFound
nil
end

View file

@ -0,0 +1,20 @@
module Fog
module Storage
class Ninefold
class Real
def head_namespace(namespace = '', options = {})
options = options.reject {|key, value| value.nil?}
request({
:expects => 200,
:method => 'HEAD',
:path => "namespace/" + namespace,
:query => {},
:parse => true
}.merge(options))
end
end
end
end
end

View file

@ -20,6 +20,7 @@ module Fog
request_path 'fog/ninefold/requests/storage'
# request :delete_container
request :get_namespace
request :head_namespace
request :post_namespace
request :put_namespace
request :delete_namespace