On Tue, Sep 25, 2012 at 8:57 AM, Philip Brown <p...@bolthole.com> wrote:
> I tried a few google searches on this, and attempted to look through
> docs.puppetlabs.com, but couldnt find anything...
>
> how do you make a module throw an error for an unrecognized parameter?
>
> ie:
>
> class setitup($machtype) {
>   case $machtype {
>       prod:  { blah}
>       dev:  {blah}
>      default: { error Unrecognized machtype parameter value }
>   }
> }
>

I think you'll have better luck in the standard library:
https://github.com/puppetlabs/puppetlabs-stdlib

Specifically the validate_*, type, member, and is_* functions are all
for helping validate parameters. Documentation is the in the Readme
and pretty good.


HTH,
Justin

>
>
> --
> You received this message because you are subscribed to the Google Groups
> "Puppet Users" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/puppet-users/-/_8zyA3QImNcJ.
> 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.

-- 
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