Hi, I''ve got the following working fine with puppet 0.25.1, which was previously impossible with 0.24 (yepee!) : define dirs ( $dirs = [] ) { # Parent directory for the ones below file { "/nfs/skel/${title}": ensure => directory } # Make sure the File namevar is unique by prepending the path $fulldirs = regsubst($dirs, ".*", "/nfs/skel/${title}/\0") file { $fulldirs: ensure => directory } } Then I call it in a way similar to this : dirs { "dir1": dirs => [ "inc", "bin" ] dirs { "dir2": dirs => [ "inc", "bin" ] But then I see warnings in the puppetmaster log : Puppet (warning): Unrecognised escape sequence ''\0'' in file foo.pp [...] I''ve also tried with "^(.*)$" and \1 but it''s the same. So before I go and report this as a minor bug, am I doing something wrong here? Matthias -- Clean custom Red Hat Linux rpm packages : http://freshrpms.net/ Fedora release 10 (Cambridge) - Linux kernel 2.6.27.30-170.2.82.fc10.x86_64 Load : 0.39 0.46 0.35 --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en -~----------~----~----~----~------~----~------~--~---
On Tue, 2009-10-27 at 17:25 +0100, Matthias Saou wrote:> I''ve got the following working fine with puppet 0.25.1, which was > previously impossible with 0.24 (yepee!) : > > define dirs ( $dirs = [] ) { > # Parent directory for the ones below > file { "/nfs/skel/${title}": ensure => directory } > # Make sure the File namevar is unique by prepending the path > $fulldirs = regsubst($dirs, ".*", "/nfs/skel/${title}/\0") > file { $fulldirs: ensure => directory } > } > > Then I call it in a way similar to this : > > dirs { "dir1": dirs => [ "inc", "bin" ] > dirs { "dir2": dirs => [ "inc", "bin" ] > > But then I see warnings in the puppetmaster log : > > Puppet (warning): Unrecognised escape sequence ''\0'' in file foo.pp [...]I think puppet string interpolation is warning you that inserting a null byte is forbidden. Try to escape the \0 so that it isn''t eaten by the double quote interpolation: $fulldirs = regsubst($dirs, ".*", "/nfs/skel/${title}/\\0") -- 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 Users" group. To post to this group, send email to puppet-users@googlegroups.com To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en -~----------~----~----~----~------~----~------~--~---
Brice Figureau wrote :> > On Tue, 2009-10-27 at 17:25 +0100, Matthias Saou wrote: > > I''ve got the following working fine with puppet 0.25.1, which was > > previously impossible with 0.24 (yepee!) : > > > > define dirs ( $dirs = [] ) { > > # Parent directory for the ones below > > file { "/nfs/skel/${title}": ensure => directory } > > # Make sure the File namevar is unique by prepending the path > > $fulldirs = regsubst($dirs, ".*", "/nfs/skel/${title}/\0") > > file { $fulldirs: ensure => directory } > > } > > > > Then I call it in a way similar to this : > > > > dirs { "dir1": dirs => [ "inc", "bin" ] > > dirs { "dir2": dirs => [ "inc", "bin" ] > > > > But then I see warnings in the puppetmaster log : > > > > Puppet (warning): Unrecognised escape sequence ''\0'' in file foo.pp [...] > > I think puppet string interpolation is warning you that inserting a null > byte is forbidden. > Try to escape the \0 so that it isn''t eaten by the double quote > interpolation: > > $fulldirs = regsubst($dirs, ".*", "/nfs/skel/${title}/\\0")I could have sworn I had already tried that, but I guess not. Things still work and the warning is gone. Thanks a lot! Matthias -- Clean custom Red Hat Linux rpm packages : http://freshrpms.net/ Fedora release 10 (Cambridge) - Linux kernel 2.6.27.30-170.2.82.fc10.x86_64 Load : 0.42 0.24 0.19 --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en -~----------~----~----~----~------~----~------~--~---