Project

General

Profile

Actions

Bug #17335

closed

puppet_fact_parser.rb does not correctly add hosts facts whos minor number does not exist or is empty

Added by Noh Wayh over 7 years ago. Updated almost 6 years ago.

Status:
Closed
Priority:
High
Assignee:
Category:
Importers
Target version:
Difficulty:
Triaged:
Fixed in Releases:
Found in Releases:

Description

foreman/app/services/puppet_fact_parser.rb

"Fixes #14545, #13104 - Correctly parse y.z minor OS versions" change causes Solaris 10 hosts to not have their facts stored due to

os = Operatingsystem.find_or_initialize_by(args)

since the args then become name: Solaris, major: 10, minor: ''
the "operatingsystemrelease" fact looks like "10_u10" (Solaris 10 update 10 - ie 10.10), so it does not get split (and only the first host who's fact is uploaded does not get an error (the first time)
, rest of the time foreman spits out "error 500, internal server error" pointing to line 47 of this file ).

Solution to this is either to add a code like the following (ugly hack but works for Solaris 10):

   elsif os_name[/Solaris/i]
        orel.gsub!(/_u/, '.')

or a nicer way is to expand the orel.split with a regex that incorporates the "_u" and possibly even the FreeBSD regex
The "elsif" with Solaris works with Solaris 10 though, not so sure Solaris 11 keeps the same naming convention or uses "." notation so a orel.split with regex is preferrable.


Files

solaris-facter-json.json solaris-facter-json.json 2.79 KB Solaris 10 facter json output Noh Wayh, 11/15/2016 09:43 AM

Related issues 2 (0 open2 closed)

Related to Foreman - Bug #13104: CentOS minor version numbering issue - preventing buildClosedTomer Brisker01/10/2016Actions
Related to Foreman - Refactor #17354: Test for idempotent operating system creation in Puppet fact parserClosedDominic Cleal11/16/2016Actions
Actions

Also available in: Atom PDF