Brice Figureau wrote:
> On 10/03/09 23:02, Oliver Hookins wrote:
>> 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.

What's bad is that facter reports 5.2 for CentOS and 5 for RHEL.  I
don't much care which way it goes, but the inconsistency across what
should be nearly identical systems is what I think needs to be
rectified.

I lean toward including the full string, as that is more accurate.
But I have been called a pedant at times. ;)

> 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
> }

Hmm, trying that in a test.pp and calling it with puppet /tmp/test.pp
yields:

Unknown function versioncmp at /tmp/test.pp:1

(Using 0.24.8rc1.)  But it's late and I may be missing the obvious
error of my ways.

Apart from using versioncmp (which would surely be helpful), there is
also the lsbmajdistrelease fact.  That does return an integer on the
CentOS boxes I tested it on.  The downside there is that the lsb*
facts aren't available unless the lsb_release script is present in the
system.

Adding operatingsystemmajrelease also sounds reasonable.

> I think it is important to keep compatibility with the old
> behaviour, so a new name is IMHO better.

Well, thankfully we can choose from two standards.  Use an int and be
compatible with RHEL or use the full release string and be compatible
with CentOS.  Choice is good, right? :)

-- 
Todd        OpenPGP -> KeyID: 0xBEAF0CE3 | URL: www.pobox.com/~tmz/pgp
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
When correctly viewed, everything is lewd.
    -- Tom Lehrer

Attachment: pgpOwCnTfyryQ.pgp
Description: PGP signature

Reply via email to