On 10/03/09 23:02, Oliver Hookins wrote:
> On Tue Mar 10, 2009 at 16:13:40 -0400, Todd Zullinger wrote:
>> This allows operatingsystemrelease to properly determine the release for
>> various Red Hat based distros, including the point portion of the
>> release.
>>
>> Signed-off-by: Todd Zullinger <[email protected]>
>> ---
>> lib/facter/operatingsystemrelease.rb |    2 +-
>> 1 files changed, 1 insertions(+), 1 deletions(-)
>>
>> diff --git a/lib/facter/operatingsystemrelease.rb 
>> b/lib/facter/operatingsystemrelease.rb
>> index 2f76817..18199bd 100644
>> --- a/lib/facter/operatingsystemrelease.rb
>> +++ b/lib/facter/operatingsystemrelease.rb
>> @@ -15,7 +15,7 @@ Facter.add(:operatingsystemrelease) do
>>             line = f.readline.chomp
>>             if line =~ /\(Rawhide\)$/
>>                 "Rawhide"
>> -            elsif line =~ /release (\d+)/
>> +            elsif line =~ /release (\d[\d.]*)/
> 
> Ahh! That breaks the behaviour I was trying to fix by reporting the
> inconsistency. So now instead of having releases numbered 3, 4, 5 across the
> board it could well end up 3.8, 4.6, 5.3 etc which in my opinion is much
> harder to make use of since Puppet conditionals don't support substring
> matching.

I contributed a versioncmp Puppet function a while back to ease such 
comparison. I _think_ it will be in 0.24.8.

Usage:
if versioncmp("5.3", "4.8") > 0 {
   # blah blah
}


> I'm not sure what to suggest though, but I guess there are a few
> alternatives:
>  * limit $operatingsystemrelease output to only the major release integer
>  * allow point release output with $operatingsystemrelease, and create a new
>    variable $operatingsystemmajrelease which only contains the major release
>    integer
>  * allow point release output with $operatingsystemrelease and add substring
>    matching of variables in conditionals in puppet
> 
> Your thoughts?

I think it is important to keep compatibility with the old behaviour, so 
a new name is IMHO better.
-- 
Brice Figureau
Days of Wonder
http://www.daysofwonder.com

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Puppet Developers" 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-dev?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to