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

[ecloud] fixed object returns in mock

This commit is contained in:
Eugene Howe 2013-02-04 13:25:34 -05:00
parent 016dc65502
commit 788568cc32
10 changed files with 11 additions and 31 deletions

View file

@ -17,11 +17,7 @@ module Fog
def get(uri)
data = service.get_detached_disk(uri).body
if data == ""
new({})
else
new(data)
end
new(data)
rescue Fog::Errors::NotFound
nil
end

View file

@ -20,11 +20,7 @@ module Fog
def get(uri)
data = service.get_internet_service(uri).body
if data == ""
new({})
else
new(data)
end
new(data)
rescue Fog::Errors::NotFound
nil
end

View file

@ -20,11 +20,7 @@ module Fog
def get(uri)
data = service.get_node(uri).body
if data == ""
new({})
else
new(data)
end
new(data)
rescue Fog::Errors::NotFound
nil
end

View file

@ -17,11 +17,7 @@ module Fog
def get(uri)
data = service.get_public_ip(uri).body
if data == ""
new({})
else
new(data)
end
new(data)
rescue Fog::Errors::NotFound
nil
end

View file

@ -23,12 +23,8 @@ module Fog
def get(uri)
data = service.get_server(uri).body
if data == ""
new({})
else
new(data)
end
rescue Excon::Errors::NotFound
new(data)
rescue Fog::Errors::NotFound
nil
end

View file

@ -12,7 +12,7 @@ module Fog
if detached_disk
response(:body => Fog::Ecloud.slice(detached_disk, :id, :compute_pool_id))
else response(:status => 404) # ?
else raise Fog::Errors::NotFound
end
end
end

View file

@ -14,7 +14,7 @@ module Fog
if internet_service
response(:body => Fog::Ecloud.slice(internet_service, :id, :public_ip))
else response(:status => 404) # ?
else raise Fog::Errors::NotFound
end
end
end

View file

@ -13,7 +13,7 @@ module Fog
if node_service
response(:body => Fog::Ecloud.slice(node_service, :id, :internet_service_id))
else response(:status => 404) # ?
else raise Fog::Errors::NotFound
end
end
end

View file

@ -12,7 +12,7 @@ module Fog
if public_ip
response(:body => Fog::Ecloud.slice(public_ip, :id, :environment_id))
else response(:status => 404) # ?
else raise Fog::Errors::NotFound
end
end
end

View file

@ -13,7 +13,7 @@ module Fog
server = self.data[:servers][server_id]
if server
response(:body => Fog::Ecloud.slice(server, :id, :compute_pool_id))
else response(:status => 404) # ?
else raise Fog::Errors::NotFound
end
end
end