Jira (PUP-10779) Calling scope#tags results in undefined method

0 views
Skip to first unread message

Josh Cooper (Jira)

unread,
Nov 11, 2020, 3:46:03 PM11/11/20
to puppe...@googlegroups.com
Josh Cooper created an issue
 
Puppet / Bug PUP-10779
Calling scope#tags results in undefined method
Issue Type: Bug Bug
Assignee: Unassigned
Created: 2020/11/11 12:45 PM
Priority: Normal Normal
Reporter: Josh Cooper

The following prints a confusing error message in 4.10.5 and up:

$ bundle exec puppet apply -e "notice(inline_template('<%= tags %>'))"
Error: Evaluation Error: Error while evaluating a Function Call, Failed to parse inline template: undefined method `tags' for Scope(Class[main]):Puppet::Parser::Scope (line: 1, column: 8) on node localhost

Within the body of the ERB template, self is TemplateWrapper and TemplateWrapper#tags is a valid method that delegates to the Scope, but that doesn't forward it to the parser resource, due to https://github.com/puppetlabs/puppet/commit/02576c98fa5a8b7decb7b53c9407bf8523947220#diff-b929053e73f66fa12eac30a6222276489f6ea778ec407f99183a03e763b38623

We should either remove the tags method from TemplateWrapper or raise a more meaningful error (to call all_tags instead) /cc Ben Ford, David Schmitt

Add Comment Add Comment
 
This message was sent by Atlassian Jira (v8.5.2#805002-sha1:a66f935)
Atlassian logo

Josh Cooper (Jira)

unread,
Nov 11, 2020, 4:02:03 PM11/11/20
to puppe...@googlegroups.com
Josh Cooper updated an issue
Change By: Josh Cooper
Sprint: Platform Core KANBAN

Josh Cooper (Jira)

unread,
Nov 11, 2020, 4:02:03 PM11/11/20
to puppe...@googlegroups.com
Josh Cooper assigned an issue to Josh Cooper
Change By: Josh Cooper
Assignee: Josh Cooper

Josh Cooper (Jira)

unread,
Nov 11, 2020, 4:02:03 PM11/11/20
to puppe...@googlegroups.com

Josh Cooper (Jira)

unread,
Nov 12, 2020, 1:46:02 PM11/12/20
to puppe...@googlegroups.com

Josh Cooper (Jira)

unread,
Nov 12, 2020, 1:46:03 PM11/12/20
to puppe...@googlegroups.com
Josh Cooper updated an issue
Change By: Josh Cooper
Fix Version/s: PUP 6.20.0

Josh Cooper (Jira)

unread,
Nov 12, 2020, 1:47:03 PM11/12/20
to puppe...@googlegroups.com
Josh Cooper updated an issue
Change By: Josh Cooper
Release Notes: Bug Fix
Release Notes Summary: Calling the `tags` method within an ERB template would result in a confusing error message. The error message now makes it clear that that method is not supported.

Mihai Buzgau (Jira)

unread,
Dec 9, 2020, 7:07:03 AM12/9/20
to puppe...@googlegroups.com
Mihai Buzgau updated an issue
Change By: Mihai Buzgau
Fix Version/s: PUP 7.1.0

Claire Cadman (Jira)

unread,
Dec 9, 2020, 11:35:03 AM12/9/20
to puppe...@googlegroups.com
Claire Cadman updated an issue
Change By: Claire Cadman
Labels: doc_reviewed
Reply all
Reply to author
Forward
0 new messages