lib/fog/compute/ecloud/models/ssh_keys.rb in fog-ecloud-0.2.0 vs lib/fog/compute/ecloud/models/ssh_keys.rb in fog-ecloud-0.3.0
- old
+ new
@@ -7,18 +7,19 @@
identity :href
model Fog::Compute::Ecloud::SshKey
def all
- data = service.get_ssh_keys(href).body[:SshKey]
+ data = service.get_ssh_keys(href).body[:SshKey] || []
load(data)
end
def get(uri)
if data = service.get_ssh_key(uri).body
new(data)
end
- rescue Excon::Errors::NotFound
+ rescue ServiceError => e
+ raise e unless e.status_code == 404
nil
end
def create(options = {})
# Make sure we only pass what we should