Skip to content

Commit

Permalink
Revert "B #2474 Network model is not working in vCenter"
Browse files Browse the repository at this point in the history
This reverts commit 902abba.
  • Loading branch information
Tino Vázquez committed Oct 17, 2018
1 parent 2866841 commit 079113b
Showing 1 changed file with 4 additions and 10 deletions.
14 changes: 4 additions & 10 deletions src/vmm_mad/remotes/lib/vcenter_driver/virtual_machine.rb
Original file line number Diff line number Diff line change
Expand Up @@ -1898,12 +1898,9 @@ def regenerate_context
def calculate_add_nic_spec(nic)
mac = nic["MAC"]
pg_name = nic["BRIDGE"]
if !one_item.retrieve_xmlelements('TEMPLATE/NIC_DEFAULT/MODEL').nil? &&
!one_item.retrieve_xmlelements('TEMPLATE/NIC_DEFAULT/MODEL').empty?
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')
elsif (model.nil? || model.empty?) &&
!nic['MODEL'].nil? &&
!nic['MODEL'].empty?
elsif (model.nil? || model.empty?) && !nic['MODEL'].nil? && !nic['MODEL'].empty?
model = nic['MODEL']
else
model = VCenterDriver::VIHelper.get_default('VM/TEMPLATE/NIC/MODEL')
Expand Down Expand Up @@ -2004,12 +2001,9 @@ def calculate_add_nic_spec(nic)
# Returns an array of actions to be included in :deviceChange
def calculate_add_nic_spec_autogenerate_mac(nic)
pg_name = nic["BRIDGE"]
if !one_item.retrieve_xmlelements('TEMPLATE/NIC_DEFAULT/MODEL').nil? &&
!one_item.retrieve_xmlelements('TEMPLATE/NIC_DEFAULT/MODEL').empty?
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')
elsif (model.nil? || model.empty?) &&
!nic['MODEL'].nil? &&
!nic['MODEL'].empty?
elsif (model.nil? || model.empty?) && !nic['MODEL'].nil? && !nic['MODEL'].empty?
model = nic['MODEL']
else
model = VCenterDriver::VIHelper.get_default('VM/TEMPLATE/NIC/MODEL')
Expand Down

0 comments on commit 079113b

Please sign in to comment.