diff --git a/src/vmm_mad/remotes/lib/vcenter_driver/virtual_machine.rb b/src/vmm_mad/remotes/lib/vcenter_driver/virtual_machine.rb index 515bc463610..6177f62d6e6 100644 --- a/src/vmm_mad/remotes/lib/vcenter_driver/virtual_machine.rb +++ b/src/vmm_mad/remotes/lib/vcenter_driver/virtual_machine.rb @@ -1901,13 +1901,16 @@ def calculate_add_nic_spec(nic) mode = "" if !one_item.retrieve_xmlelements('TEMPLATE/NIC_DEFAULT/MODEL').nil? && !one_item.retrieve_xmlelements('TEMPLATE/NIC_DEFAULT/MODEL').empty? - model = one_item.retrieve_xmlelements('TEMPLATE/NIC_DEFAULT/MODEL') + 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 @@ -2008,13 +2011,16 @@ def calculate_add_nic_spec_autogenerate_mac(nic) model = "" if !one_item.retrieve_xmlelements('TEMPLATE/NIC_DEFAULT/MODEL').nil? && !one_item.retrieve_xmlelements('TEMPLATE/NIC_DEFAULT/MODEL').empty? - model = one_item.retrieve_xmlelements('TEMPLATE/NIC_DEFAULT/MODEL') + 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