Jira (PUP-1357) Class names that match the node name are not evaluated

25 views
Skip to first unread message

Moses Mendoza (JIRA)

unread,
Oct 31, 2016, 5:32:03 PM10/31/16
to puppe...@googlegroups.com
Moses Mendoza commented on Bug PUP-1357
 
Re: Class names that match the node name are not evaluated

Henrik Lindberg do you know if this is still a problem in pup latest?

Add Comment Add Comment
 
This message was sent by Atlassian JIRA (v6.4.14#64029-sha1:ae256fe)
Atlassian logo

Moses Mendoza (JIRA)

unread,
Oct 31, 2016, 5:32:04 PM10/31/16
to puppe...@googlegroups.com

Henrik Lindberg (JIRA)

unread,
Oct 31, 2016, 5:35:35 PM10/31/16
to puppe...@googlegroups.com

Nicholas Fagerlund (JIRA)

unread,
May 15, 2017, 4:07:05 PM5/15/17
to puppe...@googlegroups.com

Moses Mendoza (JIRA)

unread,
May 18, 2017, 1:49:39 PM5/18/17
to puppe...@googlegroups.com
Moses Mendoza updated an issue
Change By: Moses Mendoza
Labels: redmine  triaged

Tomáš Virtus

unread,
Oct 6, 2019, 10:20:04 PM10/6/19
to puppe...@googlegroups.com
Tomáš Virtus commented on Bug PUP-1357
 
Re: Class names that match the node name are not evaluated

Hello. I've just encountered the same problem with following open source components:

puppet-agent 6.10.0-1buster
puppetserver 6.7.0-1buster

Does it work as designed? It took me some time to figure out that it could be related to node having same certificate name as class name. It'd be great to at least document the current behavior.

I'm using Puppet to manage nodes on LAN without any domain and I have a module dedicated to certain node. I assumed that node and class names are different namespaces and therefore it wouldn't be a problem.

This message was sent by Atlassian JIRA (v7.7.1#77002-sha1:e75ca93)
Atlassian logo

Henrik Lindberg (JIRA)

unread,
Oct 7, 2019, 6:44:03 AM10/7/19
to puppe...@googlegroups.com

It is certainly not by design - that would be really stupid. The reason this problem is not getting attention is probably because most use an external node classifier or hiera rather than the node expression.

Rob Braden (JIRA)

unread,
Oct 7, 2019, 1:09:04 PM10/7/19
to puppe...@googlegroups.com

Rob Braden (JIRA)

unread,
Oct 7, 2019, 1:09:05 PM10/7/19
to puppe...@googlegroups.com

Josh Cooper (Jira)

unread,
Jan 26, 2021, 6:37:02 PM1/26/21
to puppe...@googlegroups.com
Josh Cooper updated an issue
Change By: Josh Cooper
If I setup:

{code:puppet}
class subversion {
  warning("I am class subversion")
}
{code}

and in my nodes.pp I have

{code}
node subversion { include subversion }
{code}

When i run puppet in verbose mode on subversion, I never see that warning.  
This message was sent by Atlassian Jira (v8.5.2#805002-sha1:a66f935)
Atlassian logo

Josh Cooper (Jira)

unread,
Jan 26, 2021, 8:22:04 PM1/26/21
to puppe...@googlegroups.com
Josh Cooper commented on Bug PUP-1357
 
Re: Class names that match the node name are not evaluated

I verified this issue still exists in 6.19.1, but does not occur when using an ENC.

As Nick Lewis said, the node scope is set in https://github.com/puppetlabs/puppet/blob/5d6412cf5de9ed93d80439c539c1416ecf3216b2/lib/puppet/resource/type.rb#L237. And then later we see if a class scope with that name has already been added https://github.com/puppetlabs/puppet/blob/5d6412cf5de9ed93d80439c539c1416ecf3216b2/lib/puppet/parser/scope.rb#L420. And since there's already a node scope with that name, we skip including the class in https://github.com/puppetlabs/puppet/blob/5d6412cf5de9ed93d80439c539c1416ecf3216b2/lib/puppet/parser/compiler.rb#L308-L313

Josh Cooper (Jira)

unread,
Jan 26, 2021, 8:46:04 PM1/26/21
to puppe...@googlegroups.com

Josh Cooper (Jira)

unread,
Jan 26, 2021, 8:46:04 PM1/26/21
to puppe...@googlegroups.com
Josh Cooper assigned an issue to Josh Cooper
Change By: Josh Cooper
Assignee: Henrik Lindberg Josh Cooper

Josh Cooper (Jira)

unread,
Jan 28, 2021, 12:31:04 PM1/28/21
to puppe...@googlegroups.com
Josh Cooper updated an issue
Change By: Josh Cooper
Sprint: Platform Core KANBAN

Josh Cooper (Jira)

unread,
Jan 28, 2021, 5:55:03 PM1/28/21
to puppe...@googlegroups.com
Josh Cooper updated an issue
Change By: Josh Cooper
Fix Version/s: PUP 6.21.0
Fix Version/s: PUP 7.4.0

Ciprian Badescu (Jira)

unread,
Feb 3, 2021, 12:06:04 PM2/3/21
to puppe...@googlegroups.com

Josh Cooper (Jira)

unread,
Feb 3, 2021, 1:02:04 PM2/3/21
to puppe...@googlegroups.com
Josh Cooper updated an issue
Change By: Josh Cooper
Fix Version/s: PUP 6.21.0
Fix Version/s: PUP 7.4.0

Josh Cooper (Jira)

unread,
Feb 3, 2021, 1:03:04 PM2/3/21
to puppe...@googlegroups.com
Josh Cooper commented on Bug PUP-1357
 
Re: Class names that match the node name are not evaluated

I removed the fix versions, and we can fix in the next set of .z releases. It's been broken for a long time, and as Henrik mentioned most people use an ENC.

Josh Cooper (Jira)

unread,
Jun 9, 2021, 4:18:02 PM6/9/21
to puppe...@googlegroups.com
Josh Cooper commented on Bug PUP-1357

Puppet currently stores node and class scopes in a hash in top scope. It's currently possible for node and class scopes to collide, where the latter can overwrite the latter, but relying on that behavior to solve this problem seems like a bad idea.

I'm going to close this in favor of PUP-3995 which will add an error if a class is, ignored because of a conflict with a node definition. Note using a regex or the default bareword doesn't have this problem.

This message was sent by Atlassian Jira (v8.13.2#813002-sha1:c495a97)
Atlassian logo
Reply all
Reply to author
Forward
0 new messages