I was testing parameterized classes using an external node classifier
running on a 3.0.0rc2 master and found that catalog compilation fails
if I have a parameterized class that uses defaults if I declare an
instance of the class that does not specify values for all parameters.
I was able to reproduce the behavior using 'puppet apply':

logos: /tmp ] cat foo.pp
class foo($foo1="default1", $foo2="default2") {
  file { "/tmp/foofile":
    content => "foo1=\"$foo1\" foo2=\"$foo2\"\n"
  }
}

class { "foo":
}

Rather than getting a file with the class default values, catalog
compilation fails:

logos: /tmp ] sudo puppet apply foo.pp
Error: Puppet::Parser::AST::Resource failed with error RuntimeError:
Hiera terminus not supported without hiera library at /tmp/foo.pp:8 on
node logos
Error: Puppet::Parser::AST::Resource failed with error RuntimeError:
Hiera terminus not supported without hiera library at /tmp/foo.pp:8 on
node logos

I get the same error if I declare a value for either one (but not
both) of the parameters but if I declare values for both parameters,
it works as expected:

class { "foo":
  foo1 => "value1",
  foo2 => "value2",
}

logos: /tmp ] sudo puppet apply foo.pp
/Stage[main]/Foo/File[/tmp/foofile]/ensure: defined content as
'{md5}42bcc1edf4e8ea1f2aeffafe2ef26712'
Finished catalog run in 0.41 seconds
logos: /tmp ] cat /tmp/foofile
foo1="value1" foo2="value2"

This class works fine with 'puppet apply' on all of the 2.7.x nodes
I've tested; I can declare the class with any valid combination of
default and non-default parameter values. It only fails on 3.0.0rc2.

Thanks,
Jason

-- 
"Life was better when sun4m mattered."  -Thom

-- 
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+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.

Reply via email to