1
0
mirror of https://github.com/OpenNebula/one.git synced 2025-01-05 09:17:41 +03:00

M #-: Add sanity check on PHYDEV

Related to issue #6367, PHYDEV maybe an empry string. This commit adds
an additional sanity check on PHYDEV to skip any configuration if it is
empty
This commit is contained in:
Ruben S. Montero 2023-11-08 12:04:05 +01:00
parent 450443e19d
commit 2808f43c72
No known key found for this signature in database
GPG Key ID: A0CEA6FA880A1D87
2 changed files with 6 additions and 5 deletions

View File

@ -207,7 +207,7 @@ module DriverExecHelper
config[name]=value
end
end
rescue StandardException => e
rescue StandardError => e
STDERR.puts "Error reading config: #{e.inspect}"
STDERR.flush
end

View File

@ -43,7 +43,8 @@ module VNMMAD
create_bridge(@nic)
# Return if vlan device is already in the bridge.
next if !@nic[:phydev] || @bridges[@nic[:bridge]].include?(@nic[:phydev])
next if !@nic[:phydev] || @nic[:phydev].empty? ||
@bridges[@nic[:bridge]].include?(@nic[:phydev])
# Add phydev device to the bridge.
OpenNebula.exec_and_log("#{command(:ip)} link set " \
@ -97,8 +98,8 @@ module VNMMAD
next if keep
# Delete the bridge.
OpenNebula.exec_and_log("#{command(:ip)} link delete"\
" #{@nic[:bridge]}")
OpenNebula.exec_and_log("#{command(:ip)} link delete #{@nic[:bridge]}")
@bridges.delete(@nic[:bridge])
end
end
@ -122,7 +123,7 @@ module VNMMAD
@nic = nic
next unless Integer(@nic[:network_id]) == vnet_id
next if @bridges[@nic[:bridge]].include? @nic[:phydev]
next if @nic[:phydev].empty? || @bridges[@nic[:bridge]].include?(@nic[:phydev])
# Del old phydev device from the bridge.
OpenNebula.exec_and_log("#{command(:ip)} link set " \