Skip to content

Commit 9699958

Browse files
committed
Fallback to using uname machine for hosts using uutils/coreutils
Signed-off-by: Jason Alavaliant <alavaliant@ra09.com>
1 parent 98a7dec commit 9699958

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

lib/facter/resolvers/uname.rb

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,10 @@ def build_fact_list(output)
3535
@fact_list[:kernelrelease],
3636
@fact_list[:kernelname],
3737
@fact_list[:kernelversion] = uname_results.map(&:strip)
38+
# uutils/coreutils uname does not implement -p and returns "unknown".
39+
# Fall back to -m (machine), which is the procedure suggested by the
40+
# uutils/coreutils developers.
41+
@fact_list[:processor] = @fact_list[:machine] if @fact_list[:processor] == 'unknown'
3842
else
3943
log.warn('Request to uname returned no output. Uname related facts are not populated.')
4044
end

0 commit comments

Comments
 (0)