Jira (FACT-2632) Log error when we cannot load custom fact from file

0 views
Skip to first unread message

Bogdan Irimie (Jira)

unread,
May 21, 2020, 8:24:03 AM5/21/20
to puppe...@googlegroups.com
Bogdan Irimie created an issue
 
Facter / Bug FACT-2632
Log error when we cannot load custom fact from file
Issue Type: Bug Bug
Assignee: Unassigned
Created: 2020/05/21 5:23 AM
Priority: Normal Normal
Reporter: Bogdan Irimie
Add Comment Add Comment
 
This message was sent by Atlassian Jira (v8.5.2#805002-sha1:a66f935)
Atlassian logo

Bogdan Irimie (Jira)

unread,
May 21, 2020, 8:25:04 AM5/21/20
to puppe...@googlegroups.com

Bogdan Irimie (Jira)

unread,
May 22, 2020, 2:59:04 AM5/22/20
to puppe...@googlegroups.com
Bogdan Irimie updated an issue
Facter 4 is failing when there is an exception in the file with a custom fact. The failure should be outside `Facter.add(...)`

Custom fact example:
{code}# frozen_string_literal: true

nil.size

Facter.add(:my_custom_fact) do
  has_weight(10_000)
  setcode do
    'my_custom_fact'
  end
end
{code}

Facter 3 on the other hand, logs an error message, but still resolves all the facts that is able to. We should implement the same behaviour in Facter 4.

Bogdan Irimie (Jira)

unread,
May 22, 2020, 3:00:03 AM5/22/20
to puppe...@googlegroups.com
Bogdan Irimie updated an issue
Facter 4 is failing when there is an exception in the file with a custom fact. The failure should be outside `Facter.add(...)`

Custom fact example:
{code}# frozen_string_literal: true

nil.size

Facter.add(:my_custom_fact) do
  has_weight(10_000)
  setcode do
    'my_custom_fact'
  end
end
{code}

Facter 3 on the other hand, logs an error message for the files with exceptions , but still resolves all the other facts that is able to . We should implement the same behaviour in Facter 4.

Bogdan Irimie (Jira)

unread,
May 22, 2020, 3:02:03 AM5/22/20
to puppe...@googlegroups.com
Bogdan Irimie updated an issue
Facter 4 is failing when there is an exception in the file with a custom fact. The failure should be outside `Facter.add(...)`

Custom fact example:
{code}# frozen_string_literal: true

nil.size

Facter.add(:my_custom_fact) do
  has_weight(10_000)
  setcode do
    'my_custom_fact'
  end
end
{code}

Facter 3 on the other hand, logs an error message for the files with exceptions, but still resolves all other facts. We should implement the same behaviour in Facter 4.

The error message should be
{code}ERROR Facter - error while resolving custom facts in  <path_to_custom_facts>/my_custom_fact.rb undefined method `size' for nil:NilClass
{code}

Josh Cooper (Jira)

unread,
May 26, 2020, 11:35:03 AM5/26/20
to puppe...@googlegroups.com
Josh Cooper commented on Bug FACT-2632
 
Re: Log error when we cannot load custom fact from file

For future facter releases can you add release notes for tickets like this?

Garrett Guillotte (Jira)

unread,
May 26, 2020, 1:00:04 PM5/26/20
to puppe...@googlegroups.com
Garrett Guillotte updated an issue
 
Change By: Garrett Guillotte
Release Notes: Not Needed Bug Fix

Garrett Guillotte (Jira)

unread,
May 26, 2020, 1:02:03 PM5/26/20
to puppe...@googlegroups.com
Garrett Guillotte updated an issue
Change By: Garrett Guillotte
Release Notes Summary: Previous verisons of Facter 4 would fail and report an error when resolving invalid custom facts. This was a potentially breaking change in behavior compared to Facter 3, which logged errors for failed facts but continued resolving other facts. Facter 4.0.28 resolves this issue by using the same behavior as Facter 3.

Garrett Guillotte (Jira)

unread,
May 26, 2020, 1:02:04 PM5/26/20
to puppe...@googlegroups.com
Garrett Guillotte updated an issue
Change By: Garrett Guillotte
Release Notes Summary: Previous verisons of Facter 4 would fail and report an error when resolving invalid custom facts. This was a potentially breaking change in behavior compared to Facter 3, which logged errors for failed facts but continued resolving other facts. Facter 4.0. 28 23 resolves this issue by using the same behavior as Facter 3.
Reply all
Reply to author
Forward
0 new messages