Jira (FACT-2949) Facts that have a hash as a value cannot be extended by custom or external facts

21 views
Skip to first unread message

Bogdan Irimie (Jira)

unread,
Feb 26, 2021, 10:50:01 AM2/26/21
to puppe...@googlegroups.com
Bogdan Irimie updated an issue
 
Facter / Bug FACT-2949
Facts that have a hash as a value cannot be extended by custom or external facts
Change By: Bogdan Irimie
Summary: Facts that have a hash ass as a value cannot be extended by custom or external facts
Add Comment Add Comment
 
This message was sent by Atlassian Jira (v8.5.2#805002-sha1:a66f935)
Atlassian logo

Mihai Buzgau (Jira)

unread,
Feb 26, 2021, 10:53:01 AM2/26/21
to puppe...@googlegroups.com

Bogdan Irimie (Jira)

unread,
Feb 26, 2021, 10:59:10 AM2/26/21
to puppe...@googlegroups.com
Bogdan Irimie updated an issue
Change By: Bogdan Irimie
When trying to extend a fact that has a hash value with a custom fact, I get an error

E.g. If a try to extend the "disk" fact with
{code}Facter.add("disks.my_custom_disk2") do
  setcode do
    "d"
  end
end
{code}
and got
{code}[2021-02-26 12:35:46.784434 ] ERROR Facter::FactCollection - Custom fact `disks.my_custom_disk` cannot be added to collection. The format of this fact is incompatible with other facts that belong to `disks` group
{code}

Bogdan Irimie (Jira)

unread,
Mar 2, 2021, 7:08:56 PM3/2/21
to puppe...@googlegroups.com
Bogdan Irimie updated an issue
Change By: Bogdan Irimie
When trying to extend a fact that has a hash value with a custom fact, I get an error

E.g. If a try to extend the "disk" fact with
{code}Facter.add("disks.my_custom_disk2") do
  setcode do
    "d"
  end
end
{code}
and got
{code}[2021-02-26 12:35:46.784434 ] ERROR Facter::FactCollection - Custom fact `disks.my_custom_disk` cannot be added to collection. The format of this fact is incompatible with other facts that belong to `disks` group
{code}

Some facts (e.g. disks, networking.interfaces) have a hash as a value. If we want to override a value in the hash with a custom facts, we are not able to.

The suggestion is to extend [burry|https://github.com/puppetlabs/facter/blob/b7594837d72967e175c6ad0124a1377567f63904/lib/facter/models/fact_collection.rb#L26] from fact collection and allow burry insertions in hashes or transform the hash to a fact collection objects.

Mihai Buzgau (Jira)

unread,
Mar 2, 2021, 7:33:56 PM3/2/21
to puppe...@googlegroups.com

Mihai Buzgau (Jira)

unread,
Mar 2, 2021, 7:53:57 PM3/2/21
to puppe...@googlegroups.com

Bogdan Irimie (Jira)

unread,
Jun 30, 2021, 2:24:01 AM6/30/21
to puppe...@googlegroups.com
Bogdan Irimie updated an issue
Change By: Bogdan Irimie
Team: Ghost Night's Watch
This message was sent by Atlassian Jira (v8.13.2#813002-sha1:c495a97)
Atlassian logo

Josh Cooper (Jira)

unread,
Oct 19, 2022, 11:45:02 PM10/19/22
to puppe...@googlegroups.com
Josh Cooper updated an issue
Change By: Josh Cooper
Team: Night's Watch Phoenix
This message was sent by Atlassian Jira (v8.20.11#820011-sha1:0629dd8)
Atlassian logo

Claudia Petty (Jira)

unread,
Jun 21, 2023, 8:43:03 AM6/21/23
to puppe...@googlegroups.com
Claudia Petty updated an issue
Change By: Claudia Petty
Labels: community new-feature
This message was sent by Atlassian Jira (v8.20.21#820021-sha1:38274c8)
Atlassian logo
Reply all
Reply to author
Forward
0 new messages