Jira (FACT-2582) external data yaml facts don't load Time values

16 views
Skip to first unread message

Ben Ford (Jira)

unread,
Apr 28, 2020, 1:09:03 AM4/28/20
to puppe...@googlegroups.com
Ben Ford created an issue
 
Facter / Task FACT-2582
external data yaml facts don't load Time values
Issue Type: Task Task
Assignee: Unassigned
Created: 2020/04/27 10:08 PM
Priority: Normal Normal
Reporter: Ben Ford

Facter 4 doesn't load yaml facts the same way that Facter 3 does. (at least on Windows.) Given a yaml file in <facterlib>/facts.d/facts.yaml like so,

---
somefact:
  time: 2020-04-28 01:44:08.148119000 +00:00

Facter 3 will report that value.

PS C:\Users\Administrator> facter somefact.time
2020-04-28 01:44:08.148119000 +00:00

But Facter 4 barfs:

PS C:\Users\Administrator> facter-ng.bat somefact.time
Failed to handle C:\ProgramData/PuppetLabs/facter/facts.d/facts.yaml as LegacyFacter::Util::Parser::YamlParser
facts: Tried to load unspecified class: Time
Fact file C:\ProgramData/PuppetLabs/facter/facts.d/facts.yaml was parsed but returned an empty data set

Add Comment Add Comment
 
This message was sent by Atlassian Jira (v8.5.2#805002-sha1:a66f935)
Atlassian logo

Mihai Buzgau (Jira)

unread,
Apr 28, 2020, 2:34:03 AM4/28/20
to puppe...@googlegroups.com

Mihai Buzgau (Jira)

unread,
Apr 28, 2020, 2:34:04 AM4/28/20
to puppe...@googlegroups.com

Bogdan Irimie (Jira)

unread,
Apr 28, 2020, 6:47:03 AM4/28/20
to puppe...@googlegroups.com
Bogdan Irimie updated an issue
Change By: Bogdan Irimie
Priority: Normal High

Bogdan Irimie (Jira)

unread,
Apr 28, 2020, 6:49:04 AM4/28/20
to puppe...@googlegroups.com

Bogdan Irimie (Jira)

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

Bogdan Irimie (Jira)

unread,
May 11, 2020, 7:45:04 AM5/11/20
to puppe...@googlegroups.com

Bogdan Irimie (Jira)

unread,
May 11, 2020, 7:51:04 AM5/11/20
to puppe...@googlegroups.com
Bogdan Irimie commented on Bug FACT-2582
 
Re: external data yaml facts don't load Time values

Hi Ben Ford, thanks for reporting this bug. The problem is in the Yaml parser and it affect all OS-es

With the new fix

./bin/facter --external-dir <full_path_to_external_facts_dir>  somefact.time
2020-04-28 01:44:08.148119000 +00:00

 

The fix will probably be released this week or the next on rubygems. Please give it a try from the PR branch in the meantime and let me know if there are any issues.

Bogdan Irimie (Jira)

unread,
May 11, 2020, 8:29:03 AM5/11/20
to puppe...@googlegroups.com

Tested on `Windows 2019` with the fix

$ facter-ng.bat somefact.time
2020-04-28 01:44:08.148119000 +00:00
Reply all
Reply to author
Forward
0 new messages