Jira (PUP-7588) Types should error when provider is missing a feature for an attribute

3 views
Skip to first unread message

Chad Armitstead (JIRA)

unread,
May 23, 2017, 5:55:02 AM5/23/17
to puppe...@googlegroups.com
Chad Armitstead created an issue
 
Puppet / Improvement PUP-7588
Types should error when provider is missing a feature for an attribute
Issue Type: Improvement Improvement
Assignee: Unassigned
Created: 2017/05/23 2:54 AM
Priority: Normal Normal
Reporter: Chad Armitstead

Based on observations in

PUP-7139 , when a user provides values to attributes of a resource where the provider doesn't support the required features, there is a debug message raised and the action is unsuccessful.

Because the action fails, this should be something that is visible to a user. As such, I'm proposing that the log level of the below be raised to error:

https://github.com/puppetlabs/puppet/blob/6c5b7043896977e51587df815bd8c9dbb071ace3/lib/puppet/type.rb#L771

To replicate this behaviour, use the below (I ran it on a CentOS 6 VM):

puppet apply -e 'group { "myspecialgroup": members => ['chad'], ensure => present, provider => groupadd }' --noop --debug

This results in the following log:

Debug: Caching environment 'production' (ttl = 0 sec)
Notice: Compiled catalog for centos6a.pdx.puppet.vm in environment production in 0.09 seconds
Debug: /Group[myspecialgroup]: Provider groupadd does not support features manages_members; not managing attribute members
Debug: Creating default schedules
Debug: Loaded state in 0.02 seconds
Debug: Loaded state in 0.04 seconds
Debug: Loaded transaction store file in 0.00 seconds
Info: Applying configuration version '1495533119'
Notice: /Stage[main]/Main/Group[myspecialgroup]/ensure: current_value absent, should be present (noop)
Debug: /Group[myspecialgroup]: The container Class[Main] will propagate my refresh event
Notice: Class[Main]: Would have triggered 'refresh' from 1 events
Debug: Class[Main]: The container Stage[main] will propagate my refresh event
Notice: Stage[main]: Would have triggered 'refresh' from 1 events
Debug: Finishing transaction 39288460
Debug: Storing state
Debug: Stored state in 0.03 seconds
Notice: Applied catalog in 0.08 seconds

As the target state is never reached, puppet should notify the user that there has been a failure in an error message.

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

Chad Armitstead (JIRA)

unread,
May 23, 2017, 5:57:02 AM5/23/17
to puppe...@googlegroups.com
Chad Armitstead updated an issue
Change By: Chad Armitstead
Based on observations in PUP-7139, when When  a user provides values to attributes of a resource where the provider doesn't support the required features, there is a debug message raised and the action is unsuccessful.


Because the action fails, this should be something that is visible to a user.  As such, I'm proposing that the log level of the below be raised to {{error}}:

https://github.com/puppetlabs/puppet/blob/6c5b7043896977e51587df815bd8c9dbb071ace3/lib/puppet/type.rb#L771

To replicate this behaviour, use the below (I ran it on a CentOS 6 VM):

{code}

puppet apply -e 'group { "myspecialgroup": members => ['chad'], ensure => present, provider => groupadd }' --noop --debug
{code}


This results in the following log:
{noformat}

Debug: Caching environment 'production' (ttl = 0 sec)
Notice: Compiled catalog for centos6a.pdx.puppet.vm in environment production in 0.09 seconds
Debug: /Group[myspecialgroup]: Provider groupadd does not support features manages_members; not managing attribute members
Debug: Creating default schedules
Debug: Loaded state in 0.02 seconds
Debug: Loaded state in 0.04 seconds
Debug: Loaded transaction store file in 0.00 seconds
Info: Applying configuration version '1495533119'
Notice: /Stage[main]/Main/Group[myspecialgroup]/ensure: current_value absent, should be present (noop)
Debug: /Group[myspecialgroup]: The container Class[Main] will propagate my refresh event
Notice: Class[Main]: Would have triggered 'refresh' from 1 events
Debug: Class[Main]: The container Stage[main] will propagate my refresh event
Notice: Stage[main]: Would have triggered 'refresh' from 1 events
Debug: Finishing transaction 39288460
Debug: Storing state
Debug: Stored state in 0.03 seconds
Notice: Applied catalog in 0.08 seconds
{noformat}


As the target state is never reached, puppet should notify the user that there has been a failure in an error message.


This ticket is based on observations in PUP-7139.

Geoff Nichols (JIRA)

unread,
May 25, 2017, 1:06:11 PM5/25/17
to puppe...@googlegroups.com

Josh Cooper (Jira)

unread,
Jun 11, 2021, 5:45:01 PM6/11/21
to puppe...@googlegroups.com
Josh Cooper commented on Improvement PUP-7588
 
Re: Types should error when provider is missing a feature for an attribute

This issue is best described in PUP-7486, so I'm going to close this as a duplicate.

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