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

Merge pull request #1547 from ehowe/master

[ecloud] Cleaning up bad code
This commit is contained in:
Wesley Beary 2013-02-05 06:39:23 -08:00
commit b99305276c
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
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
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
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
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
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