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:
commit
f2505be0f6
3 changed files with 24 additions and 2 deletions
|
@ -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
|
||||
|
||||
|
|
20
lib/fog/ninefold/requests/storage/head_namespace.rb
Normal file
20
lib/fog/ninefold/requests/storage/head_namespace.rb
Normal 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
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue