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

F #4207: fix unmanage nics at deploy time (#4419)

Signed-off-by: Carlos Herrera <cherrera@opennebula.systems>
This commit is contained in:
Carlos J. Herrera 2020-03-26 12:27:26 -04:00 committed by GitHub
parent aed58f5248
commit 5b884dc626
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -902,18 +902,22 @@ module VCenterDriver
break
end
raise 'Problem with your unmanaged nics!' unless device
nics.delete(device)
if device
nics.delete(device)
else
nil
end
}
unmanaged_nics.each do |unic|
vnic = select_net.call(unic['VCENTER_NET_REF'])
nic_class = vnic.class
nic_class = vnic.class if vnic
new_model = Nic.nic_model_class(unic['MODEL']) if unic['MODEL']
if vnic.nil?
device_change << calculate_add_nic_spec(unic)
# delete actual nic and update the new one.
if new_model && new_model != nic_class
elsif new_model && new_model != nic_class
device_change << { :device => vnic, :operation => :remove }
device_change << calculate_add_nic_spec(unic, vnic.unitNumber)
else