diff --git a/src/mad/ruby/DriverExecHelper.rb b/src/mad/ruby/DriverExecHelper.rb index 8d31177fd1..de7eb9d7ae 100644 --- a/src/mad/ruby/DriverExecHelper.rb +++ b/src/mad/ruby/DriverExecHelper.rb @@ -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 diff --git a/src/vnm_mad/remotes/lib/no_vlan.rb b/src/vnm_mad/remotes/lib/no_vlan.rb index e2393e2e63..94d25254fd 100644 --- a/src/vnm_mad/remotes/lib/no_vlan.rb +++ b/src/vnm_mad/remotes/lib/no_vlan.rb @@ -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 " \