Below is a simplified version of a class I''m using. I found that
using a single character in the case statement results in the
following error.
[root@puppet classes]# puppetd -v -o
notice: Ignoring --listen on onetime run
info: Facts have changed; recompiling
err: Could not retrieve configuration: Invalid tag "w"
-------------------------------------------------------------------------------------
define check_usr_bin {
case $name {
"w", "watch": { file { "/usr/bin/$name":
mode => 0555 } }
default: { file { "/usr/bin/$name": mode => 0755 } }
}
}
class check_usr_bin_files {
$usr_bin_files = ["at", "w", "watch"]
check_usr_bin { $usr_bin_files: }
}
-------------------------------------------------------------------------------------
I didn''t find anything in bug reports about this. I haven''t
been able
to find where this is defined in the source code. It''s probably
simple but I''m not much of a programmer and have never used Ruby. If
someone can point me to the relevant files I''ll see if I can fix this.
I''ll submit a bug report.
Thanks,
Kent
On Mar 29, 2007, at 10:21 AM, Kenton Brede wrote:> Below is a simplified version of a class I''m using. I found that > using a single character in the case statement results in the > following error.It''s worse than that; you can''t have definitions with a single character as their names. I''ve modified the ticket accordingly. -- He played the king as if afraid someone else would play the ace. --John Mason Brown --------------------------------------------------------------------- Luke Kanies | http://reductivelabs.com | http://madstop.com
On 3/29/07, Luke Kanies <luke@madstop.com> wrote:> On Mar 29, 2007, at 10:21 AM, Kenton Brede wrote: > > > Below is a simplified version of a class I''m using. I found that > > using a single character in the case statement results in the > > following error. > > It''s worse than that; you can''t have definitions with a single > character as their names. > > I''ve modified the ticket accordingly.Thanks for the clarification Luke. Just for completeness, my work around for this particular instance is below. ------------------------------------------------------------------------------------- define check_usr_bin { case $name { "watch": { file { "/usr/bin/$name": mode => 0555 } } "w_check": { file { "/usr/bin/w": mode => 0555 } } default: { file { "/usr/bin/$name": mode => 0755 } } } } class check_usr_bin_files { $usr_bin_files = ["at", "w_check", "watch"] check_usr_bin { $usr_bin_files: } } ------------------------------------------------------------------------------------- Kent