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:
parent
450443e19d
commit
2808f43c72
@ -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
|
||||
|
@ -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 " \
|
||||
|
Loading…
Reference in New Issue
Block a user