Bug #2266

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

Added by OpenNebula Systems Support Team almost 8 years ago. Updated almost 8 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 almost 8 years ago

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

Revision c59196ce
Added by Jaime Melis almost 8 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 almost 6 years ago

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

History

#1 Updated by Javi Fontan almost 8 years ago

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

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

#2 Updated by Ruben S. Montero almost 8 years ago

  • Status changed from Pending to New

#3 Updated by Tino Vázquez almost 8 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