Skip to content

Commit

Permalink
Revert "B #2474 fix retrieve info from template"
Browse files Browse the repository at this point in the history
This reverts commit 0d5f519.
  • Loading branch information
Tino Vázquez authored Oct 17, 2018
1 parent afb3924 commit 2129afe
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions src/vmm_mad/remotes/lib/vcenter_driver/virtual_machine.rb
Original file line number Diff line number Diff line change
Expand Up @@ -1901,16 +1901,13 @@ 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['TEMPLATE/NIC_DEFAULT/MODEL']
File.open("/tmp/culo", 'w') {|f| f.write("Lo pilla del nic default: #{model}\n") }
model = one_item.retrieve_xmlelements('TEMPLATE/NIC_DEFAULT/MODEL')
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
Expand Down Expand Up @@ -2011,16 +2008,13 @@ 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['TEMPLATE/NIC_DEFAULT/MODEL']
File.open("/tmp/culo", 'w') {|f| f.write("Lo pilla del nic default: #{model}\n") }
model = one_item.retrieve_xmlelements('TEMPLATE/NIC_DEFAULT/MODEL')
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
Expand Down

0 comments on commit 2129afe

Please sign in to comment.