On Wed Mar 11, 2009 at 15:03:43 +0100, Thomas Bellman wrote: > >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. >> >> 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 > >In general, I prefer to get more information than I need rather than less. >Its much easier to prune excess information than find out missing info. > >In this specific case, you can dig out the major version from the full version >string using the regsubst() function in the upcoming 0.24.8 Puppet: > > $osmajorversion = regsubst($operatingsystemrelease, '^(\d+)\..*', '\1') > $osminorversion = regsubst($operatingsystemrelease, '^\d+\.(\d+)\..*', > '\1')
That is fantastic. I will be upgrading to 0.24.8 as soon as it is stable. -- Regards, Oliver Hookins Anchor Systems --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
