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:
parent
e334e545ef
commit
2c3cd101c1
1 changed files with 4 additions and 3 deletions
|
@ -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
|
||||||
|
|
Loading…
Reference in a new issue