Jira (FACT-3087) 'os.name' value changed for OS VirtuozzoLinux

19 views
Skip to first unread message

Kilian Engelhardt (Jira)

unread,
Oct 27, 2021, 3:03:03 PM10/27/21
to puppe...@googlegroups.com
Kilian Engelhardt created an issue
 
Facter / Bug FACT-3087
'os.name' value changed for OS VirtuozzoLinux
Issue Type: Bug Bug
Affects Versions: FACT 4.2.4
Assignee: Unassigned
Components: Facter 4
Created: 2021/10/27 12:02 PM
Priority: Normal Normal
Reporter: Kilian Engelhardt

Facter 4.x changed the way the `os` facts are retrieved. Up to Facter 4.x (e.g. 3.14.20) `os.name` would return VirtuozzoLinux.

# facter --version
3.14.20 (commit 28fd6cc7adae74c7748502e4d18d34f75be92f93)
 
# facter os.name
VirtuozzoLinux

Starting with Facter 4.x `os.name` returns Virtuozzo instead.

# facter --version
4.2.5
 
# facter os.name
Virtuozzo

Content of `/etc/os-release` looks like this:

# cat /etc/os-release
NAME="Virtuozzo"
VERSION="7.5.1"
ID="virtuozzo"
ID_LIKE="rhel fedora"
VERSION_ID="7"
PRETTY_NAME="Virtuozzo release 7.5.1"
ANSI_COLOR="0;31"
CPE_NAME="cpe:/o:virtuozzoproject:vz:7"
HOME_URL="http://www.virtuozzo.com"
BUG_REPORT_URL="https://bugs.openvz.org/"

Changing `NAME=` to VirtuozzoLinux makes Facter return the "correct" value which is used by community modules (e.g. 'voxpupuli/puppet-yum').

In order to avoid changing Puppet manifests, Hiera lookups, and various metadata files please restore the previous behavior / return value.

Side note: I tried overwriting `os.name` using a custom fact, but since Facter 4.1.0 (FACT-3004) it seems not working anymore - at least with this code (copied from a comment in FACT-2958):

Facter.add('os.name', type: :structured) do
  has_weight(10)
  setcode { 'custom_fact' }
end

Haven't tried yet changing the config option.

Is there any other method to overwrite core facts?

Add Comment Add Comment
 
This message was sent by Atlassian Jira (v8.13.2#813002-sha1:c495a97)
Atlassian logo

Ciprian Badescu (Jira)

unread,
Oct 28, 2021, 4:43:02 AM10/28/21
to puppe...@googlegroups.com
Ciprian Badescu commented on Bug FACT-3087
 
Re: 'os.name' value changed for OS VirtuozzoLinux

This looks similar to https://tickets.puppetlabs.com/browse/FACT-3043 and the solution could be the same. Can you try to do the change and also create a PR with it?

If you want a quick-fix, removing `type: :structured` parameter and specifying absolute path for `custom-dir` argument should get what you want

[vagrant@localhost ~]$ facter --version
4.2.5
[vagrant@localhost ~]$ facter --custom-dir `pwd`/custom/ os.name
VirtuozzoLinux
[vagrant@localhost ~]$ more custom/os.rb 
Facter.add('os.name') do
  has_weight(10)
  setcode { 'VirtuozzoLinux' }
end

Ciprian Badescu (Jira)

unread,
Nov 1, 2021, 11:34:03 AM11/1/21
to puppe...@googlegroups.com
Ciprian Badescu updated an issue
 
Change By: Ciprian Badescu
Sprint: NW - 2021-11-17

Kilian Engelhardt (Jira)

unread,
Nov 2, 2021, 10:04:03 AM11/2/21
to puppe...@googlegroups.com

Ciprian Badescu (Jira)

unread,
Nov 3, 2021, 5:32:03 AM11/3/21
to puppe...@googlegroups.com

Ciprian Badescu (Jira)

unread,
Nov 3, 2021, 5:55:03 AM11/3/21
to puppe...@googlegroups.com

Gabriel Nagy (Jira)

unread,
Nov 12, 2021, 5:02:57 AM11/12/21
to puppe...@googlegroups.com
Gabriel Nagy assigned an issue to Gabriel Nagy
Change By: Gabriel Nagy
Assignee: Gabriel Nagy

Michael Hashizume (Jira)

unread,
Dec 6, 2021, 5:34:02 PM12/6/21
to puppe...@googlegroups.com
Michael Hashizume updated an issue
Change By: Michael Hashizume
Fix Version/s: FACT 4.2.6

Michael Hashizume (Jira)

unread,
Dec 6, 2021, 5:35:02 PM12/6/21
to puppe...@googlegroups.com
Michael Hashizume updated an issue
Change By: Michael Hashizume
Release Notes: Bug Fix
Release Notes Summary: Restore Facter3's value of 'os.name' for VirtuozzoLinux

Parker Leach (Jira)

unread,
Dec 8, 2021, 11:45:02 AM12/8/21
to puppe...@googlegroups.com
Parker Leach updated an issue
Change By: Parker Leach
Labels: docs_reviewed
This message was sent by Atlassian Jira (v8.20.2#820002-sha1:829506d)
Atlassian logo
Reply all
Reply to author
Forward
0 new messages