Issue #19558 has been updated by Matthaus Owens.

Status changed from Merged - Pending Release to Closed

Released in Puppet 3.2.0-rc1

----------------------------------------
Bug #19558: Type-level validation doesn't provide information about the resource
https://projects.puppetlabs.com/issues/19558#change-89509

* Author: Dominic Cleal
* Status: Closed
* Priority: Normal
* Assignee: 
* Category: error reporting
* Target version: 3.2.0
* Affected Puppet version: 
* Keywords: 
* Branch: https://github.com/puppetlabs/puppet/pull/1515
----------------------------------------
When validation is defined at the type level rather than a parameter, 
exceptions raised don't show the resource or manifest that it originated from:

    $ bin/puppet apply -e 'file { "/a": content => a, source => "puppet:///" }' 
--trace
    Error: You cannot specify more than one of content, source, target
    /home/dcleal/code/puppet/puppet/lib/puppet/util/errors.rb:60:in `fail'
    /home/dcleal/code/puppet/puppet/lib/puppet/type/file.rb:289:in `block (2 
levels) in <top (required)>'
    /home/dcleal/code/puppet/puppet/lib/puppet/type.rb:2198:in `initialize'
    /home/dcleal/code/puppet/puppet/lib/puppet/type/file.rb:400:in `initialize'

When it fails from a parameter, it shows the resource (thanks to #16208), but 
not the manifest:

    $ bin/puppet apply -e 'file { "/a": content => a, source => "puppe:///" }' 
--trace
    Error: Parameter source failed on File[/a]: Cannot use URLs of type 'puppe' 
as source for fileserving
    /home/dcleal/code/puppet/puppet/lib/puppet/util/errors.rb:61:in `fail'
    /home/dcleal/code/puppet/puppet/lib/puppet/type/file/source.rb:67:in `block 
(3 levels) in <module:Puppet>'
    /home/dcleal/code/puppet/puppet/lib/puppet/type/file/source.rb:56:in `each'
    /home/dcleal/code/puppet/puppet/lib/puppet/type/file/source.rb:56:in `block 
(2 levels) in <module:Puppet>'
    /home/dcleal/code/puppet/puppet/lib/puppet/parameter.rb:450:in `validate'
    /home/dcleal/code/puppet/puppet/lib/puppet/parameter.rb:485:in `value='
    /home/dcleal/code/puppet/puppet/lib/puppet/type.rb:654:in `[]='



-- 
You have received this notification because you have either subscribed to it, 
or are involved in it.
To change your notification preferences, please click here: 
http://projects.puppetlabs.com/my/account

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Bugs" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/puppet-bugs?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to