diff --git a/src/vnm_mad/remotes/lib/no_vlan.rb b/src/vnm_mad/remotes/lib/no_vlan.rb index 50129c1615..33289c1a16 100644 --- a/src/vnm_mad/remotes/lib/no_vlan.rb +++ b/src/vnm_mad/remotes/lib/no_vlan.rb @@ -47,7 +47,7 @@ def activate TProxy.setup_tproxy(@nic, :up) # Skip if vlan device is already in the bridge. - next if !@nic[:phydev] || @nic[:phydev].empty? || + next if @nic[:phydev].nil? || @nic[:phydev].empty? || @bridges[@nic[:bridge]].include?(@nic[:phydev]) # Add phydev device to the bridge. @@ -178,7 +178,8 @@ def vlan_filter process do |nic| @nic = nic - next if @nic[:phydev].nil? || @nic[:bridge].nil? || !@nic.vlan_trunk? + next if @nic[:phydev].nil? || @nic[:phydev].empty? + next if @nic[:bridge].nil? || !@nic.vlan_trunk? vlan_set = @nic.vlan_trunk diff --git a/src/vnm_mad/remotes/lib/vlan.rb b/src/vnm_mad/remotes/lib/vlan.rb index b83fabe2b4..408ea0be11 100644 --- a/src/vnm_mad/remotes/lib/vlan.rb +++ b/src/vnm_mad/remotes/lib/vlan.rb @@ -45,7 +45,7 @@ def activate process do |nic| @nic = nic - next if @nic[:phydev].nil? + next if @nic[:phydev].nil? || @nic[:phydev].empty? # generate the name of the vlan device. gen_vlan_dev_name @@ -111,7 +111,7 @@ def deactivate @nic = nic - next if @nic[:phydev].nil? + next if @nic[:phydev].nil? || @nic[:phydev].empty? next if @bridges[@nic[:bridge]].nil? # Get the name of the vlan device. @@ -167,7 +167,7 @@ def update(vnet_id) process do |nic| next unless Integer(nic[:network_id]) == vnet_id - next if nic[:phydev].nil? + next if nic[:phydev].nil? || nic[:phydev].empty? # the bridge should already exist as we're updating next if @bridges[nic[:bridge]].nil?