Skip to content

Commit

Permalink
B OpenNebula#2474 Network model is not working in vCenter
Browse files Browse the repository at this point in the history
  • Loading branch information
joseangelgm committed Oct 9, 2018
1 parent bfdee5b commit 86def5c
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 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,12 @@ 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?
model = one_item.retrieve_xmlelements("TEMPLATE/NIC_DEFAULT/MODEL")
elsif (model.nil? || model.empty?) && !nic["MODEL"].nil? && !nic["MODEL"].empty?
model = 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')
elsif (model.nil? || model.empty?) && !nic['MODEL'].nil? && !nic['MODEL'].empty?
model = nic['MODEL']
else
model = VCenterDriver::VIHelper.get_default("VM/TEMPLATE/NIC/MODEL")
model = VCenterDriver::VIHelper.get_default('VM/TEMPLATE/NIC/MODEL')
end
vnet_ref = nic["VCENTER_NET_REF"]
backing = nil
Expand Down Expand Up @@ -2001,12 +2001,12 @@ 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?
model = one_item.retrieve_xmlelements("TEMPLATE/NIC_DEFAULT/MODEL")
elsif (model.nil? || model.empty?) && !nic["MODEL"].nil? && !nic["MODEL"].empty?
model = 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')
elsif (model.nil? || model.empty?) && !nic['MODEL'].nil? && !nic['MODEL'].empty?
model = nic['MODEL']
else
model = VCenterDriver::VIHelper.get_default("VM/TEMPLATE/NIC/MODEL")
model = VCenterDriver::VIHelper.get_default('VM/TEMPLATE/NIC/MODEL')
end
vnet_ref = nic["VCENTER_NET_REF"]
backing = nil
Expand Down

0 comments on commit 86def5c

Please sign in to comment.