1
0
mirror of https://github.com/OpenNebula/one.git synced 2024-12-22 13:33:52 +03:00

Revert "L #-: Linting for rubocop 1.58.0"

This reverts commit 76f1d1bba4.
This commit is contained in:
Tino Vázquez 2023-12-04 10:05:02 +01:00
parent 76f1d1bba4
commit d49e6fcc8f
8 changed files with 17 additions and 17 deletions

View File

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

View File

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

View File

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

View File

@ -193,7 +193,7 @@ module HEMHook
def as_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?

View File

@ -28,7 +28,7 @@ module OneDBFsck
# resource[0] = u if user, g if group
id_field = "#{resource[0]}id"
oid = row["#{resource}_oid"]
oid = row["#{resource}_oid".to_sym]
params = [doc, "#{id_field}=#{oid}", resource.capitalize]
if type == 'running'
@ -37,10 +37,10 @@ module OneDBFsck
calculate_quotas(*params)
end
object = { "#{resource}_oid" => oid,
object = { "#{resource}_oid".to_sym => oid,
:body => doc.root.to_s }
@db["#{resource}_quotas"].insert(object)
@db["#{resource}_quotas".to_sym].insert(object)
end
end
@ -394,10 +394,10 @@ module OneDBFsck
vm_elem.xpath("#{cpu}_USED").each do |e|
cpu_used = (cpu_used / 100.0)
different = e.text.to_f != cpu_used ||
![format('%.2f', cpu_used),
format('%.1f', cpu_used),
format('%.0f', cpu_used)].include?(e.text)
different = (e.text.to_f != cpu_used ||
![format('%.2f', cpu_used),
format('%.1f', cpu_used),
format('%.0f', cpu_used)].include?(e.text))
cpu_used_str = format('%.2f', cpu_used)

View File

@ -167,8 +167,8 @@ class VmmAction
if DriverExecHelper.failed?(result)
info << (@data[:failed_info] || '-')
elsif !@data["#{@main_action}_info"].nil?
info << @data["#{@main_action}_info"]
elsif !@data["#{@main_action}_info".to_sym].nil?
info << @data["#{@main_action}_info".to_sym]
end
@vmm.send_message(VirtualMachineDriver::ACTION[@main_action],
@ -290,7 +290,7 @@ class VmmAction
end
# Save the step info
@data["#{step[:action]}_info"] = info.strip
@data["#{step[:action]}_info".to_sym] = info.strip
# Roll back steps, store failed info and break steps
if DriverExecHelper.failed?(result)

View File

@ -55,7 +55,7 @@ module Storage
device_fs = device_fs(device)
end
opts_fs = options[:mountopts]["dev_#{device_fs}"]
opts_fs = options[:mountopts]["dev_#{device_fs}".to_sym]
opts_fs ||= ''
# resize and mount operations according to the used filesystem

View File

@ -2720,7 +2720,7 @@ end
img_name = VCenterDriver::FileHelper.unescape_path(img_name_escaped)
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)
if key_matches || path_matches