On Monday, March 18, 2013 11:16:41 AM UTC-5, olli...@googlemail.com wrote:
>
> Hello,
>
> If I want to do something like this:-
>
> if $::lsbdistrelease >= 6.3 {
>   SOMETHING
> }
>
> Do I have to convert lsbdistrelease from a string to a number with an 
> inline template or some such ?
>
>
Generally speaking, yes.  All fact values are strings, and the language 
docs specify that the behavior of the <, <=, >=, and > operators is 
undefined for strings.  For this particular case, however, Alessandro 
Ogier's suggestion to use the versioncmp() function is an excellent one.  
Not only is it easy to use, but it still does what you (probably) want when 
you compare against, say, version 6.11.


John

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to puppet-users+unsubscr...@googlegroups.com.
To post to this group, send email to puppet-users@googlegroups.com.
Visit this group at http://groups.google.com/group/puppet-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to