diff --git a/share/linters/.rubocop.yml b/share/linters/.rubocop.yml index 8f4d2b1297..b071717510 100644 --- a/share/linters/.rubocop.yml +++ b/share/linters/.rubocop.yml @@ -23,6 +23,7 @@ AllCops: TargetRubyVersion: 2.5.9 Exclude: - /**/*.schema + - src/onecfg/lib/config/type/yaml.rb - src/sunstone/public/node_modules/**/* - src/vnm_mad/remotes/vcenter/vnet_create - src/vnm_mad/remotes/vcenter/vnet_delete @@ -801,6 +802,9 @@ Style/SuperArguments: # LINT ###### +Lint/ConstantResolution: + Enabled: false + Lint/IneffectiveAccessModifier: Enabled: false diff --git a/src/onecfg/lib/config/type/yaml.rb b/src/onecfg/lib/config/type/yaml.rb index 3385766e16..cdea4b3b48 100644 --- a/src/onecfg/lib/config/type/yaml.rb +++ b/src/onecfg/lib/config/type/yaml.rb @@ -16,6 +16,7 @@ require 'yaml' +# rubocop:disable Lint/ConstantResolution # rubocop:disable Style/ClassAndModuleChildren module OneCfg::Config::Type @@ -284,8 +285,9 @@ def diff_subtree(tree1, tree2, path) if di1 && di2 # skip + # rubocop:disable Lint/void nil - + # rubocop:enable Lint/void elsif di1 # delete array item ret << { @@ -716,3 +718,4 @@ def apply_diff_op_set(tree, data, mode) end # rubocop:enable Style/ClassAndModuleChildren +# rubocop:enable Lint/ConstantResolution diff --git a/src/vmm_mad/remotes/lib/vcenter_driver/vm_template.rb b/src/vmm_mad/remotes/lib/vcenter_driver/vm_template.rb index 5e3a87c6b9..2f5a38d512 100644 --- a/src/vmm_mad/remotes/lib/vcenter_driver/vm_template.rb +++ b/src/vmm_mad/remotes/lib/vcenter_driver/vm_template.rb @@ -1041,10 +1041,8 @@ def create_network_for_import( :template_id=> vm_id } - if nic[:pg_type] == - VCenterDriver::Network::NETWORK_TYPE_NSXV || - nic[:pg_type] == - VCenterDriver::Network::NETWORK_TYPE_NSXT + if [VCenterDriver::Network::NETWORK_TYPE_NSXV, + VCenterDriver::Network::NETWORK_TYPE_NSXT].include?(nic[:pg_type]) import_opts[:nsx_id] = config[:nsx_id] import_opts[:nsx_vni] = config[:nsx_vni] import_opts[:nsx_tz_id] = config[:nsx_tz_id] diff --git a/src/vnm_mad/remotes/elastic/equinix_vnm.rb b/src/vnm_mad/remotes/elastic/equinix_vnm.rb index a9d9a8800d..716dd8d373 100644 --- a/src/vnm_mad/remotes/elastic/equinix_vnm.rb +++ b/src/vnm_mad/remotes/elastic/equinix_vnm.rb @@ -76,7 +76,7 @@ def assign(_ip, external, _opts = {}) # HTTP 422 is returned if IP already assigned to the device # e.g. VM poweroff from inside + onevm resume - unless resp.code == '201' || resp.code == '422' + unless ['201', '422'].include?(resp.code) STDERR.puts "Error assigning #{external}:#{resp.message}" return 1 end diff --git a/src/vnm_mad/remotes/elastic/scaleway_vnm.rb b/src/vnm_mad/remotes/elastic/scaleway_vnm.rb index 00a5140752..3d7ab90d7c 100644 --- a/src/vnm_mad/remotes/elastic/scaleway_vnm.rb +++ b/src/vnm_mad/remotes/elastic/scaleway_vnm.rb @@ -89,7 +89,7 @@ def assign(_ip, external, _opts = {}) fip_req) # HTTP 409 is returned if IP is being assigned to the device - unless resp.code == '200' || resp.code == '409' + unless ['200', '409'].include?(resp.code) STDERR.puts "Error assigning #{external}:#{resp.message}" return 1 end @@ -117,7 +117,7 @@ def unassign(_ip, external, _opts = {}) fip_req) # HTTP 409 is returned if IP is being unassigned to the device - unless resp.code == '200' || resp.code == '409' + unless ['200', '409'].include?(resp.code) STDERR.puts "Error unassigning #{external}:#{resp.message}" return 1 end