Bug #2266

Incompatible use of round method in earlier Ruby versions found in OneFlow component

Added by OpenNebula Systems Support Team over 7 years ago. Updated about 7 years ago.

Status:ClosedStart date:08/13/2013
Priority:NormalDue date:
Assignee:Jaime Melis% Done:

100%

Category:OneFlow
Target version:Release 4.4
Resolution:fixed Pull request:
Affected Versions:OpenNebula 4.2

Description

The following statement is not valid Ruby 1.8.7:

src/flow/lib/grammar.rb:934: val = (total / n_nodes).round(2)

Since round doesn't accept arguments for Ruby < 1.9.

Associated revisions

Revision ad21698a
Added by Jaime Melis over 7 years ago

Bug #2266: Incompatible use of round method in earlier Ruby versions found in OneFlow component

Revision c59196ce
Added by Jaime Melis over 7 years ago

Bug #2266: Incompatible use of round method in earlier Ruby versions found in OneFlow component
(cherry picked from commit ad21698a3f24362d1705a90b9498b273ad265306)

Revision 56fbcea8
Added by Carlos Martín about 5 years ago

Bug #3967: Re-apply fix for bug #2266

History

#1 Updated by Javi Fontan over 7 years ago

I'd better use sprintf to format instead of round:

val=sprintf("%.2f", total / n_nodes)

#2 Updated by Ruben S. Montero about 7 years ago

  • Status changed from Pending to New

#3 Updated by Tino Vázquez about 7 years ago

  • Status changed from New to Closed
  • Assignee set to Jaime Melis
  • % Done changed from 0 to 100
  • Resolution set to fixed

changed round to use no arguments for early ruby versions compatibility

Also available in: Atom PDF