Issue #1759 has been updated by masterzen. Status changed from Accepted to Ready for Testing Complexity changed from Unknown to Trivial
Hi, It is fixed in tickets/0.24.x/1759 in my github repository: http://github.com/masterzen/puppet/tree/tickets%2F0.24.x%2F1759 Commit: dd9d4486f4d6c8e033b891c5f5d33750b8ba3d0e ---------------------------------------- Bug #1759: Numeric comparison does not work as expected in if statements http://projects.reductivelabs.com/issues/show/1759 Author: tmz Status: Ready for Testing Priority: Normal Assigned to: masterzen Category: language Target version: 0.24.7 Complexity: Trivial Affected version: 0.24.6 Keywords: Attempting to use the new if statements in 0.24.6, I found that numeric comparisons did not work as I would expect. An example: $operatingsystemrelease = 10 # From facter if $operatingsystemrelease > 9 # This is not true. Huh? Thinking it might be comparing the facter variable as a string, try it hardcoded: if 10 > 9 # Still not true. Odd. if 10 > 09 # This is true. So, is the comparison being done character by character or is it just doing string comparison? The examples in the documentation indicate that using numeric comparisons are intended to work (with examples like "if $ram > 1024" and "if ( $processor_count > 2 )" at http://reductivelabs.com/trac/puppet/wiki/LanguageTutorial#if-else). fujin posted a handy demo at http://pastie.org/318391 ---------------------------------------- You have received this notification because you have either subscribed to it, or are involved in it. To change your notification preferences, please click here: http://reductivelabs.com/redmine/my/account --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Puppet Bugs" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/puppet-bugs?hl=en -~----------~----~----~----~------~----~------~--~---
