1
0
mirror of https://github.com/OpenNebula/one.git synced 2025-03-16 22:50:10 +03:00

Revert "Update virtual_machine.rb"

This reverts commit 658a3d4daf619121bd41c73e501e0da9c281292a.
This commit is contained in:
Tino Vázquez 2018-10-17 17:42:33 +02:00
parent 658a3d4daf
commit 7d798e54b3

View File

@ -1902,12 +1902,15 @@ class VirtualMachine < Template
if !one_item.retrieve_xmlelements('TEMPLATE/NIC_DEFAULT/MODEL').nil? &&
!one_item.retrieve_xmlelements('TEMPLATE/NIC_DEFAULT/MODEL').empty?
model = one_item['TEMPLATE/NIC_DEFAULT/MODEL']
File.open("/tmp/culo", 'w') {|f| f.write("Lo pilla del nic default: #{model}\n") }
elsif (model.nil? || model.empty?) &&
!nic['MODEL'].nil? &&
!nic['MODEL'].empty?
model = nic['MODEL']
File.open("/tmp/culo", 'w') {|f| f.write("Lo pilla del nic: #{model}\n") }
else
model = VCenterDriver::VIHelper.get_default('VM/TEMPLATE/NIC/MODEL')
File.open("/tmp/culo", 'w') {|f| f.write("Lo pilla vcenter default #{model}\n") }
end
vnet_ref = nic["VCENTER_NET_REF"]
backing = nil
@ -2009,12 +2012,15 @@ class VirtualMachine < Template
if !one_item.retrieve_xmlelements('TEMPLATE/NIC_DEFAULT/MODEL').nil? &&
!one_item.retrieve_xmlelements('TEMPLATE/NIC_DEFAULT/MODEL').empty?
model = one_item['TEMPLATE/NIC_DEFAULT/MODEL']
File.open("/tmp/culo", 'w') {|f| f.write("Lo pilla del nic default: #{model}\n") }
elsif (model.nil? || model.empty?) &&
!nic['MODEL'].nil? &&
!nic['MODEL'].empty?
model = nic['MODEL']
File.open("/tmp/culo", 'w') {|f| f.write("Lo pilla del nic: #{model}\n") }
else
model = VCenterDriver::VIHelper.get_default('VM/TEMPLATE/NIC/MODEL')
File.open("/tmp/culo", 'w') {|f| f.write("Lo pilla del vcenter default: #{model}\n") }
end
vnet_ref = nic["VCENTER_NET_REF"]
backing = nil