Issue #20122 has been updated by Charlie Sharpsteen.

Category set to documentation
Status changed from Unreviewed to Accepted
Keywords set to puppetdoc

Confirmed that both create_resources and ensure_resources wipe the docstring 
for some reason. Bundling together with other puppet doc related issues in 
#2364.

----------------------------------------
Bug #20122: function_create_resources drops docstring
https://projects.puppetlabs.com/issues/20122#change-91789

* Author: Sebastian Schmidt
* Status: Accepted
* Priority: Normal
* Assignee: 
* Category: documentation
* Target version: 
* Affected Puppet version: 3.1.1
* Keywords: puppetdoc
* 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.


Reply via email to