Issue #1828 has been reported by tstoop.
----------------------------------------
Bug #1828: Comparison of strings containing versions
http://projects.reductivelabs.com/issues/show/1828
Author: tstoop
Status: Unreviewed
Priority: Normal
Assigned to: masterzen
Category: unknown
Target version:
Complexity: Unknown
Affected version: 0.24.6
Keywords:
As discussed on IRC:
<pre>class puppet-version-test {
if $puppetversion > "0.24.5" {
notify { "newer than 0.24.5.":
message => "We're newer than 0.24.5.",
}
}
if $puppetversion == "0.24.5" {
notify { "0.24.5":
message => "We're 0.24.5.",
}
}
if $puppetversion > "0.24.6" {
notify { "newer than 0.24.6.":
message => "We're newer than 0.24.6.",
}
}
if $puppetversion == "0.24.6" {
notify { "0.24.6":
message => "We're 0.24.6.",
}
}
if $puppetversion > "0.24.7" {
notify { "newer than 0.24.7.":
message => "We're newer than 0.24.7.",
}
}
if $puppetversion == "0.24.7" {
notify { "0.24.7":
message => "We're 0.24.7.",
}
}
if $puppetversion > "0.24.8" {
notify { "newer than 0.24.8.":
message => "We're newer than 0.24.8.",
}
}
if $puppetversion == "0.24.8" {
notify { "0.24.8":
message => "We're 0.24.8.",
}
}
notify { "puppetversion":
message => $puppetversion,
}
}</pre>
Which gives this output:
<pre>otice: We're 0.24.8.
notice: //Node[default]/puppet-version-test/Notify[0.24.8]/message: defined
'message' as 'We're 0.24.8.'
notice: We're 0.24.7.
notice: //Node[default]/puppet-version-test/Notify[0.24.7]/message: defined
'message' as 'We're 0.24.7.'
notice: We're 0.24.6.
notice: //Node[default]/puppet-version-test/Notify[0.24.6]/message: defined
'message' as 'We're 0.24.6.'
notice: We're 0.24.5.
notice: //Node[default]/puppet-version-test/Notify[0.24.5]/message: defined
'message' as 'We're 0.24.5.'
notice: 0.24.7
notice: //Node[default]/puppet-version-test/Notify[puppetversion]/message:
defined 'message' as '0.24.7'</pre>
According to masterzen, the string gets converted to a float, which leads to an
invalid float which compares 0 to 0.
----------------------------------------
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
-~----------~----~----~----~------~----~------~--~---