func getOSInfo()

in providers/linux/os.go [82:105]


func getOSInfo(baseDir string) (*types.OSInfo, error) {
	osInfo, err := getOSRelease(baseDir)
	if err != nil {
		// Fallback
		return findDistribRelease(baseDir)
	}

	// For the redhat family, enrich version info with data from
	// /etc/[distrib]-release because the minor and patch info isn't always
	// present in os-release.
	if osInfo.Family != "redhat" {
		return osInfo, nil
	}

	distInfo, err := findDistribRelease(baseDir)
	if err != nil {
		return osInfo, err
	}
	osInfo.Major = distInfo.Major
	osInfo.Minor = distInfo.Minor
	osInfo.Patch = distInfo.Patch
	osInfo.Codename = distInfo.Codename
	return osInfo, nil
}