Jira (FACT-3150) Facter doesn't support comments in /etc/os-release - one vendor embeds them.

32 views
Skip to first unread message

Greg (Jira)

unread,
Sep 18, 2022, 4:35:03 AM9/18/22
to puppe...@googlegroups.com
Greg created an issue
 
Facter / New Feature FACT-3150
Facter doesn't support comments in /etc/os-release - one vendor embeds them.
Issue Type: New Feature New Feature
Affects Versions: FACT 4.2.12
Assignee: Unassigned
Components: Facter 4
Created: 2022/09/18 1:34 AM
Priority: Normal Normal
Reporter: Greg

In the file "

/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/facter/resolvers/os_release.rb" in the function "

read_and_parse_os_release_file" the "pairs" variable is constructed with a very simple parse of the file.

Suggested fix is to strip white space from either side of each line string, and discard lines that are either empty or start with a '#':

    content.map { | line | line.strip }.select { | line | ! line.start_with?('#') and line.size > 0 }.each do |line|

    pairs << line.strip.delete('"').split('=', 2)

  end

(The vendor is Arista, and the issue happens trying to get puppet7 running on their devices).

Add Comment Add Comment
 
This message was sent by Atlassian Jira (v8.20.11#820011-sha1:0629dd8)
Atlassian logo

Morgan Rhodes (Jira)

unread,
Sep 20, 2022, 4:11:01 PM9/20/22
to puppe...@googlegroups.com
Morgan Rhodes commented on New Feature FACT-3150
 
Re: Facter doesn't support comments in /etc/os-release - one vendor embeds them.

Hi Greg !

Arista isn't one of our supported operating systems. At this time we don't likely have the bandwidth to do this work but would be happy to review a PR if you get one up.

Thanks!

Greg (Jira)

unread,
Sep 20, 2022, 11:17:01 PM9/20/22
to puppe...@googlegroups.com
Greg commented on New Feature FACT-3150

Hi Morgan. . How would you like a fix submitted? (An updated ruby code that would resolve the issue was included when this ticket was opened).

Greg (Jira)

unread,
Sep 20, 2022, 11:18:01 PM9/20/22
to puppe...@googlegroups.com

Morgan Rhodes (Jira)

unread,
Sep 21, 2022, 10:51:01 AM9/21/22
to puppe...@googlegroups.com

Claudia Petty (Jira)

unread,
Jun 21, 2023, 8:43:04 AM6/21/23
to puppe...@googlegroups.com
Claudia Petty updated an issue
 
Change By: Claudia Petty
Labels: 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