Issue #22829 has been reported by R.I. Pienaar.

----------------------------------------
Bug #22829: create_resources auto importing a manifest with a syntax error 
produce a bad error message
https://projects.puppetlabs.com/issues/22829

* Author: R.I. Pienaar
* Status: Unreviewed
* Priority: Normal
* Assignee: 
* Category: 
* Target version: 
* Affected Puppet version: 3.3.0
* Keywords: 
* Branch: 
----------------------------------------
Given a module with this structure:

<pre>
x
└── manifests
    ├── init.pp
    └── y.pp
</pre>

init.pp:
<pre>
class x {
    $r = {"one" => {"foo" => "bar"}}

    create_resources("x::y", $r)
}
</pre>

and y.pp which has an obvious syntax error:

<pre>
define x::y {
    obvious error should be obvious
}
</pre>

I get the following error:

<pre>
% puppet apply --modulepath=`pwd` -e 'include x'
Error: exception object expected at /home/rip/temp/x/manifests/init.pp:4 on 
node devco.net
Wrapped exception:
exception object expected
Error: exception object expected at /home/rip/temp/x/manifests/init.pp:4 on 
node devco.net
</pre>

What's happening here is the y.pp only gets imported during the processing of 
create_resources and inside create_resources the parse error is incorrectly 
handled. 

In this case the following code:

<pre>
  begin
    resource.safeevaluate(self)
  rescue Puppet::ParseError => internal_error
    raise internal_error.original
  end
</pre>

has a nil for original in the internal_error object and so it fails.



-- 
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.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to