Issue #20122 has been reported by Sebastian Schmidt.
----------------------------------------
Bug #20122: function_create_resources drops docstring
https://projects.puppetlabs.com/issues/20122
* Author: Sebastian Schmidt
* Status: Unreviewed
* Priority: Normal
* Assignee:
* Category:
* Target version:
* Affected Puppet version: 3.1.1
* Keywords:
* Branch:
----------------------------------------
Hi,
I've noticed puppet doc doesn't output anything at all when the manifest is
using ensure_resource from stdlib. I could track it down to be a parser issue.
Using this script:
<pre><code class="ruby">require 'puppet'
Puppet[:manifestdir] = '/etc/puppet/manifests'
p = Puppet::Parser::Parser.new(Puppet::Node::Environment.new)
p.file = ARGV[0]
ret = p.parse
puts ret.to_yaml</code></pre>
I've dumped the ASTs of two manifests, one using function_create_resource via
stdlib's ensure_resource and one using a plain resource:
<pre>
$ cat 1.pp; echo "========="; ruby dump_ast.rb 1.pp|grep doc:
# documentation for class foo
class foo {
ensure_resource('package', 'foo', {
ensure => present,
})
}
=========
!ruby/sym doc: ""
doc: ""
</pre>
<pre>
$ cat 2.pp; echo "========="; ruby dump_ast.rb 2.pp|grep doc:
# documentation for class foo
class foo {
package{'foo':
ensure => present,
}
}
=========
!ruby/sym doc: "documentation for class foo\n"
doc: ""
</pre>
As other functions, like join() or prefix() from stdlib don't trigger this
issue I suspect it has to do with create_resources.
I can reproduce this with 2.7.19 and 3.1.1.
Sebastian
--
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.