1
0
mirror of https://github.com/OpenNebula/one.git synced 2025-01-03 01:17:41 +03:00

L #-: Lint for rubocop 1.58.0

This commit is contained in:
Tino Vázquez 2023-12-04 10:40:53 +01:00
parent d49e6fcc8f
commit 7516ed7f0a
7 changed files with 13 additions and 10 deletions

View File

@ -944,6 +944,9 @@ Lint/NonAtomicFileOperation:
Lint/IncompatibleIoSelectWithFiberScheduler: Lint/IncompatibleIoSelectWithFiberScheduler:
Enabled: false Enabled: false
Lint/SymbolConversion:
Enabled: false
######### #########
# METRICS # METRICS
######## ########

View File

@ -75,7 +75,7 @@ CommandParser::CmdParser.new(ARGV) do
exit(0) exit(0)
end end
filter_flag = (options[:userfilter] || VirtualMachinePool::INFO_ALL) filter_flag = options[:userfilter] || VirtualMachinePool::INFO_ALL
if options[:start_time] if options[:start_time]
start_time = options[:start_time].to_i start_time = options[:start_time].to_i
else else

View File

@ -77,7 +77,7 @@ CommandParser::CmdParser.new(ARGV) do
exit(0) exit(0)
end end
filter_flag = (options[:userfilter] || VirtualMachinePool::INFO_ALL) filter_flag = options[:userfilter] || VirtualMachinePool::INFO_ALL
start_month = -1 start_month = -1
start_year = -1 start_year = -1

View File

@ -655,8 +655,8 @@ module OpenNebula
return OpenNebula::Error.new("Role #{name} is in DONE state") return OpenNebula::Error.new("Role #{name} is in DONE state")
end end
do_offset = (!period.nil? && period.to_i > 0 && do_offset = !period.nil? && period.to_i > 0 &&
!vms_per_period.nil? && vms_per_period.to_i > 0) !vms_per_period.nil? && vms_per_period.to_i > 0
nodes.each_with_index do |node, index| nodes.each_with_index do |node, index|
vm_id = node['deploy_id'] vm_id = node['deploy_id']

View File

@ -193,7 +193,7 @@ module HEMHook
def as_stdin? def as_stdin?
astdin = self['TEMPLATE/ARGUMENTS_STDIN'] astdin = self['TEMPLATE/ARGUMENTS_STDIN']
astdin &&= (astdin.casecmp('yes') || astdin.casecmp('true')) astdin &&= astdin.casecmp('yes') || astdin.casecmp('true')
return false if astdin.nil? return false if astdin.nil?

View File

@ -394,10 +394,10 @@ module OneDBFsck
vm_elem.xpath("#{cpu}_USED").each do |e| vm_elem.xpath("#{cpu}_USED").each do |e|
cpu_used = (cpu_used / 100.0) cpu_used = (cpu_used / 100.0)
different = (e.text.to_f != cpu_used || different = e.text.to_f != cpu_used ||
![format('%.2f', cpu_used), ![format('%.2f', cpu_used),
format('%.1f', cpu_used), format('%.1f', cpu_used),
format('%.0f', cpu_used)].include?(e.text)) format('%.0f', cpu_used)].include?(e.text)
cpu_used_str = format('%.2f', cpu_used) cpu_used_str = format('%.2f', cpu_used)

View File

@ -2720,7 +2720,7 @@ end
img_name = VCenterDriver::FileHelper.unescape_path(img_name_escaped) img_name = VCenterDriver::FileHelper.unescape_path(img_name_escaped)
vc_disks.each do |d| vc_disks.each do |d|
key_matches = (unmanaged_key && d[:key] == unmanaged_key.to_i) key_matches = unmanaged_key && d[:key] == unmanaged_key.to_i
path_matches = (d[:path_wo_ds] == img_name) path_matches = (d[:path_wo_ds] == img_name)
if key_matches || path_matches if key_matches || path_matches