mirror of
https://github.com/fog/fog.git
synced 2022-11-09 13:51:43 -05:00
fail when cloudstack default view empty
This commit is contained in:
parent
55c720ba9f
commit
5c74409f03
1 changed files with 5 additions and 2 deletions
|
@ -22,9 +22,12 @@ module Fog
|
|||
end
|
||||
|
||||
def get(server_id)
|
||||
if server = service.list_virtual_machines('id' => server_id)["listvirtualmachinesresponse"]["virtualmachine"].first
|
||||
servers = service.list_virtual_machines('id' => server_id)["listvirtualmachinesresponse"]["virtualmachine"]
|
||||
if ! servers.nil?
|
||||
if server = servers.first
|
||||
new(server)
|
||||
end
|
||||
end
|
||||
rescue Fog::Compute::Cloudstack::BadRequest
|
||||
nil
|
||||
end
|
||||
|
|
Loading…
Add table
Reference in a new issue