1
0
mirror of https://github.com/OpenNebula/one.git synced 2025-08-14 05:49:26 +03:00

L #-: Linting for 1.45.1 rubocop

This commit is contained in:
Tino Vázquez
2023-02-10 11:18:41 +01:00
parent 0b958f46b4
commit 1a97d78a38
5 changed files with 9 additions and 5 deletions

View File

@ -27,7 +27,7 @@ RG_SETUP_END = '%%RUBYGEMS_SETUP_END%%'
# Bundled Ruby gems loader code.
# IMPORTANT: Update here and commit into Git as well!
# rubocop:disable Layout/HeredocIndentation
RG_SETUP = <<-'EOT'
RG_SETUP = <<-EOT
if File.directory?(GEMS_LOCATION)
real_gems_path = File.realpath(GEMS_LOCATION)
if !defined?(Gem) || Gem.path != [real_gems_path]

View File

@ -388,7 +388,7 @@ module OneCfg::Config::Type
def self.run_shell_command((*cmd), stdin = nil)
rtn = nil
if Hash == cmd.last
if cmd.last == Hash
opts = cmd.pop.dup
else
opts = {}

View File

@ -576,7 +576,9 @@ CommandParser::CmdParser.new(ARGV) do
end
rescue StandardError => e
puts e.message
# rubocop:disable Lint/Debugger
pp e.backtrace
# rubocop:enable Lint/Debugger
[-1, e.message]
end
@ -604,7 +606,9 @@ CommandParser::CmdParser.new(ARGV) do
end
rescue StandardError => e
puts e.name
# rubocop:disable Lint/Debugger
pp e.backtrace
# rubocop:enable Lint/Debugger
[-1, e.message]
end

View File

@ -110,7 +110,7 @@ module OneProvision
rtn = nil
begin
if Hash == cmd.last
if cmd.last == Hash
opts = cmd.pop.dup
else
opts = {}

View File

@ -1126,7 +1126,7 @@ end
when OPAQUE_CARD.to_s
# Select only Opaque Networks
opaque_networks = @item.network.select do |net|
RbVmomi::VIM::OpaqueNetwork == net.class
net.class == RbVmomi::VIM::OpaqueNetwork
end
opaque_network = opaque_networks.find do |opn|
backing.opaqueNetworkId == opn.summary.opaqueNetworkId
@ -1296,7 +1296,7 @@ end
when OPAQUE_CARD.to_s
# Select only Opaque Networks
opaque_networks = @item.network.select do |net|
RbVmomi::VIM::OpaqueNetwork == net.class
net.class == RbVmomi::VIM::OpaqueNetwork
end
opaque_network = opaque_networks.find do |opn|
nic.backing.opaqueNetworkId ==