Issue #6696 has been updated by James Turnbull.
Status changed from Needs More Information to Needs Decision
Think I've already indicated that - tags returns "bob" with the function but
not "files" which means it's returning all the tags in scope. The code for
tags and all_tags is incredibly simple:
<pre>
# Allow templates to access the tags defined in the current scope
def tags
scope.tags
end
# Allow templates to access the all the defined tags
def all_tags
scope.catalog.tags
end
</pre>
----------------------------------------
Bug #6696: tag metaparam not working
https://projects.puppetlabs.com/issues/6696
Author: James Turnbull
Status: Needs Decision
Priority: Normal
Assignee: Nigel Kersten
Category: tags
Target version:
Affected Puppet version: 2.6.6
Keywords:
Branch:
Given a manifest:
<pre>
class test {
tag("bob")
file { "/tmp/test":
ensure => present,
content => template('/tmp/filet'),
tag => "files",
}
}
include test
</pre>
With the template:
<pre>
<% tags.each do |tag| -%>
The tag <%= tag %> is part of the current scope
<% end -%>
<% all_tags.each do |tag| -%>
The tag <%= tag %> is defined
<% end -%>
</pre>
When I run either:
<pre>
puppet --tags files /tmp/file.pp
</pre>
or:
<pre>
puppet /tmp/file.pp
</pre>
I get:
<pre>
The tag class is part of the current scope
The tag test is part of the current scope
The tag bob is part of the current scope
The tag settings is defined
The tag class is defined
The tag test is defined
</pre>
No sign of the tag "files" anywhere.
--
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 post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/puppet-bugs?hl=en.