Skip to content

Commit

Permalink
Do not use BigDecimal in euwe
Browse files Browse the repository at this point in the history
Euwe uses ruby 2.3.1 which does not coalesce floats and BigDecimals
well.

Try for yourself

    BigDecimal.new(1) <= Float::INFINITY

or

    Float::INFINITY >= BigDecimal.new(1)

Fixes ManageIQ#13591.
Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1416001
  • Loading branch information
isimluk committed Jan 24, 2017
1 parent bbd2e4f commit 0a8a8fd
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion app/models/chargeback/consumption_without_rollups.rb
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ def current_value(metric)
when 'derived_memory_available'
resource.hardware.try(:memory_mb)
when 'derived_vm_allocated_disk_storage'
resource.allocated_disk_storage
resource.allocated_disk_storage.try(:to_f)
end
@value[metric]
end
Expand Down

0 comments on commit 0a8a8fd

Please sign in to comment.