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

skip lookup for get if id is nil

This commit is contained in:
Wesley Beary 2009-10-22 20:46:15 -07:00
parent 3d7ac75cbe
commit 5ef58a135a
6 changed files with 18 additions and 6 deletions

View file

@ -43,7 +43,9 @@ module Fog
end
def get(public_ip)
all(public_ip).first
if public_ip
all(public_ip).first
end
rescue Fog::Errors::BadRequest
nil
end

View file

@ -39,7 +39,9 @@ module Fog
end
def get(instance_id)
all(instance_id).first
if instance_id
all(instance_id).first
end
rescue Fog::Errors::BadRequest
nil
end

View file

@ -37,7 +37,9 @@ module Fog
end
def get(key_name)
all(key_name).first
if key_name
all(key_name).first
end
rescue Fog::Errors::BadRequest
nil
end

View file

@ -37,7 +37,9 @@ module Fog
end
def get(group_name)
all(group_name).first
if group_name
all(group_name).first
end
rescue Fog::Errors::BadRequest
nil
end

View file

@ -43,7 +43,9 @@ module Fog
end
def get(snapshot_id)
all(snapshot_id).first
if snapshot_id
all(snapshot_id).first
end
rescue Fog::Errors::BadRequest
nil
end

View file

@ -43,7 +43,9 @@ module Fog
end
def get(volume_id)
all(volume_id).first
if volume_id
all(volume_id).first
end
rescue Fog::Errors::BadRequest
nil
end