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

[vsphere|compute] interfaces#get now properly initializes the Interface object.

This commit is contained in:
Kevin Menard 2013-11-01 15:52:34 -04:00
parent e334e545ef
commit 2c3cd101c1

View file

@ -32,15 +32,16 @@ module Fog
case server case server
when Fog::Compute::Vsphere::Server when Fog::Compute::Vsphere::Server
interface=service.get_vm_interface(server.id, :key => id, :mac=> id, :name => id) interface = service.get_vm_interface(server.id, :key => id, :mac=> id, :name => id)
when Fog::Compute::Vsphere::Template when Fog::Compute::Vsphere::Template
interface=service.get_template_interfaces(server.id, :key => id, :mac=> id, :name => id) interface = service.get_template_interfaces(server.id, :key => id, :mac=> id, :name => id)
else else
raise 'interfaces should have vm or template' raise 'interfaces should have vm or template'
end end
if interface if interface
Fog::Compute::Vsphere::Interface.new(interface) Fog::Compute::Vsphere::Interface.new(interface.merge(:server_id => server.id, :service => service))
else else
nil nil
end end