Skip to content

Commit

Permalink
Fix rubocop complaints
Browse files Browse the repository at this point in the history
  • Loading branch information
fabiendupont committed Mar 20, 2019
1 parent fdda95a commit 3323486
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
10 changes: 5 additions & 5 deletions app/models/conversion_host.rb
Original file line number Diff line number Diff line change
Expand Up @@ -57,18 +57,18 @@ def ipaddress(family = 'ipv4')
end

def cpu_limit
value = read_attribute(:cpu_limit) || Settings.transformation.limits.cpu_limit_per_host
value == 'unlimited' ? value : "#{value.to_i / active_tasks.size}"
value = self[:cpu_limit] || Settings.transformation.limits.cpu_limit_per_host
value == 'unlimited' ? value : (value.to_i / active_tasks.size).to_s
end

def network_limit
value = read_attribute(:network_limit) || Settings.transformation.limits.network_limit_per_host
value == 'unlimited' ? value : "#{value.to_i / active_tasks.size}"
value = self[:network_limit] || Settings.transformation.limits.network_limit_per_host
value == 'unlimited' ? value : (value.to_i / active_tasks.size).to_s
end

def apply_virtv2v_limits(path, limits = {})
connect_ssh { |ssu| ssu.put_file(path, JSON.dump(limits)) }
rescue => e
rescue StandardError => e
raise "Could not apply the limits in '#{path}' on '#{resource.name}' with [#{e.class}: #{e}]"
end

Expand Down
2 changes: 1 addition & 1 deletion app/models/infra_conversion_job.rb
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ def poll_conversion
when 'active'
begin
migration_task.apply_virtv2v_limits if migration_task.options.fetch_path(:virtv2v_wrapper, 'throttling_file')
rescue => exception
rescue StandardError => exception
_log.log_backtrace(exception)
end
queue_signal(:poll_conversion, :deliver_on => Time.now.utc + options[:conversion_polling_interval])
Expand Down

0 comments on commit 3323486

Please sign in to comment.