mirror of
https://github.com/fog/fog.git
synced 2022-11-09 13:51:43 -05:00
Merge pull request #1805 from torake/master
CloudStack: fails when there are no VMs in default view for user
This commit is contained in:
commit
451d257459
1 changed files with 3 additions and 2 deletions
|
@ -22,8 +22,9 @@ module Fog
|
|||
end
|
||||
|
||||
def get(server_id)
|
||||
if server = service.list_virtual_machines('id' => server_id)["listvirtualmachinesresponse"]["virtualmachine"].first
|
||||
new(server)
|
||||
servers = service.list_virtual_machines('id' => server_id)["listvirtualmachinesresponse"]["virtualmachine"]
|
||||
unless servers.nil?
|
||||
new(servers.first)
|
||||
end
|
||||
rescue Fog::Compute::Cloudstack::BadRequest
|
||||
nil
|
||||
|
|
Loading…
Add table
Reference in a new issue