Skip to content

Commit

Permalink
L #-: Rubocop 1.70.0
Browse files Browse the repository at this point in the history
  • Loading branch information
tinova committed Jan 10, 2025
1 parent 0580065 commit ef932b6
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 8 deletions.
4 changes: 4 additions & 0 deletions share/linters/.rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -801,6 +802,9 @@ Style/SuperArguments:
# LINT
######

Lint/ConstantResolution:
Enabled: false

Lint/IneffectiveAccessModifier:
Enabled: false

Expand Down
5 changes: 4 additions & 1 deletion src/onecfg/lib/config/type/yaml.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@

require 'yaml'

# rubocop:disable Lint/ConstantResolution
# rubocop:disable Style/ClassAndModuleChildren
module OneCfg::Config::Type

Expand Down Expand Up @@ -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 << {
Expand Down Expand Up @@ -716,3 +718,4 @@ def apply_diff_op_set(tree, data, mode)

end
# rubocop:enable Style/ClassAndModuleChildren
# rubocop:enable Lint/ConstantResolution
6 changes: 2 additions & 4 deletions src/vmm_mad/remotes/lib/vcenter_driver/vm_template.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down
2 changes: 1 addition & 1 deletion src/vnm_mad/remotes/elastic/equinix_vnm.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions src/vnm_mad/remotes/elastic/scaleway_vnm.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit ef932b6

Please sign in to comment.