Jira (PUP-9367) Puppet::Confine prevents using inheritance to de-duplicate code

2 views
Skip to first unread message

Jacob Helwig (JIRA)

unread,
Dec 18, 2018, 5:38:05 PM12/18/18
to puppe...@googlegroups.com
Jacob Helwig created an issue
 
Puppet / Task PUP-9367
Puppet::Confine prevents using inheritance to de-duplicate code
Issue Type: Task Task
Assignee: Unassigned
Created: 2018/12/18 2:37 PM
Priority: Normal Normal
Reporter: Jacob Helwig

Puppet::Confine has tries to prevent a type of confine from being defined twice (Eg. Puppet::Confine::Foo and Puppet::Confine::Bar::Foo), because of how it uses the last part of the namespace as the name of the type of confine. This same check at inheritance time is used to register a confine to be able to be used later. Unfortunately, the way this is done also prevents using inheritance from de-duplicating any confinement code.

Where the duplicate check & registration happens: https://github.com/puppetlabs/puppet/blob/81ad86c0f7a0e7f4c4d351c83c250fd795869586/lib/puppet/confine.rb#L14-L21

We might need to change how confine types are registered, or at least make sure that we're only looking at leaf nodes in the inheritance chain when doing this check.

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

Josh Cooper (JIRA)

unread,
Dec 20, 2018, 1:57:05 PM12/20/18
to puppe...@googlegroups.com

Josh Cooper (Jira)

unread,
Feb 23, 2022, 10:01:02 PM2/23/22
to puppe...@googlegroups.com
Josh Cooper commented on Task PUP-9367
 
Re: Puppet::Confine prevents using inheritance to de-duplicate code

We don't have plans on changing how confine is implemented, so I'm going to close this.

This message was sent by Atlassian Jira (v8.20.2#820002-sha1:829506d)
Atlassian logo
Reply all
Reply to author
Forward
0 new messages