L #-: Linting vlan.rb

This commit is contained in:
Jan Orel committed 2020-05-26 15:59:35 +02:00
1 parent 8797006ca5
commit a8a2e20e64
2 files changed
+7 -5

No files matched your search

-1
View File
@@ -301,7 +301,6 @@ AllCops:
- src/vnm_mad/remotes/lib/vnm_driver.rb
- src/vnm_mad/remotes/lib/sg_driver.rb
- src/vnm_mad/remotes/lib/command.rb
- src/vnm_mad/remotes/lib/vlan.rb
- src/vnm_mad/remotes/lib/address.rb
- src/cli/command_parser.rb
- src/cli/one_helper.rb
+7 -4
View File
@@ -163,8 +163,8 @@ module VNMMAD
# It tries to translate the options from brctl to ip-route2 format
# for the backward compatibility
def list_bridge_options
bridge_options = @nic[:conf][:bridge_conf] || Hash.new
ip_bridge_options = Hash.new
bridge_options = @nic[:conf][:bridge_conf] || {}
ip_bridge_options = {}
# options transform table from brctl to ip-route2
brctl_to_ipbridge = {
@@ -178,7 +178,8 @@ module VNMMAD
# translate bridge_options to ip_bridge_options
bridge_options.each do |brctl_opt, brctl_val|
next if ! brctl_to_ipbridge.include? brctl_opt
next unless brctl_to_ipbridge.include? brctl_opt
ip_bridge_options[brctl_to_ipbridge[brctl_opt]] = brctl_val
end
@@ -186,7 +187,7 @@ module VNMMAD
ip_bridge_options.merge!(@nic[:conf][:ip_bridge_conf]) \
if @nic[:conf][:ip_bridge_conf]
bridge_options_str = ""
bridge_options_str = ''
ip_bridge_options.each do |option, value|
case value
when true
@@ -215,8 +216,10 @@ module VNMMAD
br_name = line.split(': ')[1]
bridges[br_name] = []
# rubocop:disable Layout/LineLength
ip_show_master =
`#{VNMNetwork::COMMANDS[:ip_unpriv]} link show master #{br_name}`
# rubocop:enable Layout/LineLength
ip_show_master.split("\n").each do |l|
next if l !~ /^[0-9]*:/