Jira (PUP-7367) Replace use of "Puppet::Util::Errors#fail" in puppet code base when it is not the Ruby alias for "raise"

7 views
Skip to first unread message

Josh Cooper (Jira)

unread,
Jun 2, 2021, 8:36:02 PM6/2/21
to puppe...@googlegroups.com
Josh Cooper updated an issue
 
Puppet / Bug PUP-7367
Replace use of "Puppet::Util::Errors#fail" in puppet code base when it is not the Ruby alias for "raise"
Change By: Josh Cooper
Summary: Replace use of " Puppet::Util::Errors# fail" in puppet code base when it is not the Ruby alias for "raise"
Add Comment Add Comment
 
This message was sent by Atlassian Jira (v8.13.2#813002-sha1:c495a97)
Atlassian logo

Josh Cooper (Jira)

unread,
Jun 2, 2021, 8:39:02 PM6/2/21
to puppe...@googlegroups.com
Josh Cooper updated an issue
We are using the method {{fail}} in a couple of places in the puppet code base to deal with the issuing of an error (it ultimately leads to a raised error). The problem with using the name {{fail}} is that it is also an alias for {{raise}} and for newcomers to the puppet code base, the unorthodox use of {{fail}} may be confusing.

The Errors module is also mixed into providers, so it gets called from there too:

{code:ruby}
        fail Puppet::Error, _("File paths must be fully qualified, not '%{path}'") % { path: value }
{code}

Suggested name: {{raise_issue}}, and in the cases where the "raise" is optional {{optionally_raise_issue}} (when the issue is configurable as warning or error).

Josh Cooper (Jira)

unread,
Jun 2, 2021, 8:41:03 PM6/2/21
to puppe...@googlegroups.com
Josh Cooper commented on Bug PUP-7367
 
Re: Replace use of "Puppet::Util::Errors#fail" in puppet code base when it is not the Ruby alias for "raise"

I agree this would be good to clean up, but we have no plans on doing this anytime soon. If anyone wants to take this issue, feel free to reopen and we can provide help in #puppet in slack.

Reply all
Reply to author
Forward
0 new messages