On Tue, 2010-10-19 at 03:14 -0700, Denis Barishev wrote:
> Hello!
> Could you, please, enlightent the situation about the subject. As far
> as i can understand, puppet, actually my version 2.6.1, makes case-
> sensitive matches, and i can't find a way to change the behavior.
>
> The following code fails to work as expected, 'cause all operating
> system define themselves as Ubuntu or Debian:
>
> case $operatingsystem {
> /(ubuntu|debian)/: { $is_debian = true }
> default: { $is_debian = false }
> }
>
> Moreover documentation discourages to use downcasefacts as this option
> is deprecated. Maybe there is some modifier to make case insensitive
> regex match (like /i /bla/fu/i)?
> Surly i can define regex as /([Uu]buntu|[Dd]ebian)/, but that is not a
> very elegant way out.
> From my point of view puppet should be able to make case sensitive/
> insensitive matches as well as it should have standard functions to
> downcase and uppercase variables. Is not that essential?
> Or may be i just can't understand how to achieve the desired thing..
> However that is i think is true enough, that the documentation lacks
> appropriate consideration of this matter.
>
I'm afraid I am the culprit, or more precisely this commit:
http://github.com/puppetlabs/puppet/commit/b581c2348e784ce5d857a4c1c0686399b87cc13f
Regex matching in puppet has been case sensitive since the first day
(and maybe it was the wrong choice).
As a workaround you can use uppercase in your regexes:
/(Ubuntu|Debian)/
I suggest you to file (several) bug reports about this (one for the case
sensitivity issue, one for the documentation, and one feature for the
uppercase/lowercase functions).
--
Brice Figureau
Follow the latest Puppet Community evolutions on www.planetpuppet.org!
--
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.